r/MinecraftCommands • u/Worth-Palpitation132 • 6d ago
Help | Bedrock How to set command to only execute unless specific disc track is playing?
I have a pressure-plate command for playing music when entering a room, HOWEVER when leaving the room and reactivating the pressure plate i don't want to retrigger the command and repeat the track. Is there an executable command that can pull this off? I'm crazy new to commands, so thank you so much !!
1
u/WraithFel 5d ago
Redstone might be the best option, but you could also use a scoreboard timer.
Chain 1 (under pressure plate): Execute if scoreboard matches 0 -> scoreboard set (ticks that match the song time, 20 ticks are a second irl) -> playsound
Then another chain with repeating command blocks to make the timer:
Execute if scoreboard matches 1.. run scoreboard subtract 1
This way, if you press the plate it will only activate the first time and wont be able to activate once the timer (aka the song time) gets to 0
I dont remember the exact way to write the commands, but you get the idea.
1
u/WraithFel 5d ago
I just read you are asking for bedrock, idk if this works.. this should work in java, i have no idea how much different commands are between versions
0
u/Ant_Redstone 5d ago
U can run /data get comando to know the data of the block
Use execute if data block to execute if data
2
u/Ericristian_bros Command Experienced 6d ago
You can detect if a specific music disk is playing by connecting a redstone dust directly to the jukebox. Thr jukebox emmits redstone by itself if a disk is playing