1

Help with command block playsound

Luxaholic's Avatar Luxaholic1/22/16 9:01 pm
1 emeralds 283 1
1/25/2016 5:14 pm
Volans's Avatar Volans
Hey guys, so i recently made a resource pack with several extra sounds in it and put them all into the json and did it all proper and now I have a dilemma with my circuits. basically i want it to be like if a player enters a region a sound plays, such as when a player approaches a cliff in a cave, rocks falling down plays, so i did testfor on one command block then the playsound @p on the other, the issue is i don't want the sound to play every single time they enter the area and re enter because that would just seem unrealistic that the same exact sound plays every time they enter the spot (they could just constantly step over the line that makes it so it plays), i want it to be like a cooldown before the next sound can be played, something like 1 minute or something, if anyone has any ideas let me know, thanks
Posted by Luxaholic's Avatar
Luxaholic
Level 42 : Master Engineer
157

Create an account or sign in to comment.

1

1
01/25/2016 5:14 pm
Level 7 : Apprentice Artist
Volans
Volans's Avatar
The only thing I can suggest within my knowledge is a one time thing. I have done many times on my map, and it works well. So you have your command block testing for the player at certain coordinates, and then the one that plays the sound. What you need to do is place a "one time" command block in between the two. So after the test for command block, place the comparator connected to the first command block, then place the "one time" command block, then another comparator linked to that, then place your sound command block. Now, in the "one time" command block, place a command that will not say anything in the chat (as long as you have sendCommandFeedback turned off), or make any noticeable changes, when it's activated, such as "/weather clear". So now, when it finds the player, it will activate the "one time" command block, then activating the sound command block. The thing about putting in "/weather clear", is that not only does it not make any noticeable difference to your surroundings, but when the command block is activated, the comparator stays "activated", shall we say (the two redstone torches on the comparator stay lit until you edit the command block). So now when the player is on the cliff, it only plays the sound once. Does that make sense?

Hope it helped!
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome