2
Play music infinitely with command block (HELP)
Hello, I know how to play your own music in MC, but couse the duration of the song it stop playing. So...I will be glad if you help me with a command to play music indefiniely. thanks.
Create an account or sign in to comment.
4
3
I really like this idea! I think I have a solution for you, if you're using java edition
To make a timer, run:
/scoreboard objectives add musictimer minecraft.custom:minecraft.play_one_minute
Then create play_song.mcfunction, and put these commands in it:
stopsound @p music
playsound minecraft:music_disc.mellohi music @p
scoreboard players set @p musictimer 0
In a command block (repeat, unconditional, always active):
execute at @a[scores={musictimer=100..}] run function music:play_song
this will stop and replay the song every 100 ticks, which is 5-6 seconds or so. Change the number to match the length of the song. In 1.14 we will get the /schedule command, which would make this easier.
To make a timer, run:
/scoreboard objectives add musictimer minecraft.custom:minecraft.play_one_minute
Then create play_song.mcfunction, and put these commands in it:
stopsound @p music
playsound minecraft:music_disc.mellohi music @p
scoreboard players set @p musictimer 0
In a command block (repeat, unconditional, always active):
execute at @a[scores={musictimer=100..}] run function music:play_song
this will stop and replay the song every 100 ticks, which is 5-6 seconds or so. Change the number to match the length of the song. In 1.14 we will get the /schedule command, which would make this easier.
3
Now that is an interesting question :)
I don't think this can be done using a command. See, although you have options to issue a command over and over again the downside to that is that the song you play will then restart if it was already playing. I just checked using the /data command and from what I can tell (disclaimer: I could be overlooking something) there is no property which tells if a player is listening to music or not.
Ergo: right now my conclusion is that your only liable option would be to use a mod. But that's at first glance, I added this to my (now really existing) todo list and I'll look further into it this weekend.
I don't think this can be done using a command. See, although you have options to issue a command over and over again the downside to that is that the song you play will then restart if it was already playing. I just checked using the /data command and from what I can tell (disclaimer: I could be overlooking something) there is no property which tells if a player is listening to music or not.
Ergo: right now my conclusion is that your only liable option would be to use a mod. But that's at first glance, I added this to my (now really existing) todo list and I'll look further into it this weekend.
2
oh it is possible just use repeaters
1
Well dang, I always thought somehow that was possible Good old ShelLuser answering the big questions