#How i can make specific áreas thst plays a music when you are inside it?

1 messages · Page 1 of 1 (latest)

mint solar
#

And after you leave The área, the music stop playing

deft moat
#

execute as @a[r=(radius)] run (command)

#

execute as @a[rm=(awayFromRadius)] run (command)

#

@mint solar ^^^

mint solar
#

But this you make The music keeps restating every tick

#

Só i will only hear the start everytime

neon magnet
#

execute as @a[r=(radius),tag=(tag)] run (command)

execute as @a[rm=(awayFromRadius),tag=!(tag)] run (command)

mint solar
#

There is no other way tô do it? Using this dont work for my project

spiral canyon
mint solar
#

But the music command affects all players on the world, and i want to make only players insode the área hear the music

stable maple
#

You can do /execute as @a[r=(radius)] run /music play <trackname> [volume] [fadeSeconds] [repeatMode] and put it on a 3600 delay tick

mint solar
#

The problem of /music is that if someone or something on the world use it, every player will hear The músic

eager willow
#

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

eager willow
eager willow
eager willow
# eager willow

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

mint solar
# eager willow

This looks functional, but if the sound ends when im inside The área how i can make it play again?

eager willow
mint solar
#

Its a music, at some point it will end

eager willow
#

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

mint solar
#

looks promising

lost helm