#How i can make specific áreas thst plays a music when you are inside it?
1 messages · Page 1 of 1 (latest)
execute as @a[r=(radius)] run (command)
execute as @a[rm=(awayFromRadius)] run (command)
@mint solar ^^^
But this you make The music keeps restating every tick
Só i will only hear the start everytime
add a tag
execute as @a[r=(radius),tag=(tag)] run (command)
execute as @a[rm=(awayFromRadius),tag=!(tag)] run (command)
There is no other way tô do it? Using this dont work for my project
See if you find the music command satisfactory:
/music play <trackName> [volume] [fadeSeconds] [repeatMode]
But the music command affects all players on the world, and i want to make only players insode the área hear the music
You can do /execute as @a[r=(radius)] run /music play <trackname> [volume] [fadeSeconds] [repeatMode] and put it on a 3600 delay tick
The problem of /music is that if someone or something on the world use it, every player will hear The músic
hmm, i think you can use execute as @a at @s so itll only be for that specific player
letme test this so we can solve it together
if this is still the case i recommend /playsound for the music
i basicly selected a specific area and gave in that area scores. if the score is 0 the music wont play. and if its 1 music will start. its not going to always restart because the score will be changed instantly for the player. and players outside the area will have a score of 0
i suggest you make this a function because command blocks are not that great
This looks functional, but if the sound ends when im inside The área how i can make it play again?
Why would the sound end when inside?
Its a music, at some point it will end
You can loop it back
Rather than using play_once you can use loop
At the end of the /music cokmand
Command*
But if youre using playsound you might need to make another function to make it play again
Like knowing which point the music ends would help
So you can set the score and reset the score
İ mean set the score to which point the music ends and then resetting it so itll play again
Every second is 20 tick so as an example 5 second is 100 ticks
Check how long the music youre going to use and set the score to that point
looks promising
would be nice if the command had target selectors, no idea why it doesn't tbh
Mojang is lazy..