My original post, minus old pictures:
Hi. I put together this interesting device that can sense when a player is near and then play music for them. Please redstone experts, tell me how I can improve this device. I have limited redstone experience and I have two issues I could use help with please.
The first issue is that it is possible to trigger the music to play multiple times simultaneously and it sounds like a big mess when you do. What kind of redstone device can I add so that the music will only play once?
The second issue is that I don't really understand how to best use the /playsound command. There are additional arguments that I could enter into the command blocks but I don't understand how to use them. I think there may be an advantage to adjusting the minimumVolume setting. Right now the sound is directional so that it is louder when you face towards the command block and louder the closer you are to it. Is it possible to make the sound more omnidirectional? It is possible to make the sound heard from farther away? Please tell me specifically what you recommend I enter into the command blocks. I'm concerned that I can not use the XYZ coordinates because this device is intended to be spawned/imported into different maps.
Back story- The Chocolate Quest mod encourages players to build custom dungeons and then export them for the purpose of sharing with other people. Some players are making wholes series of dungeons with a story behind them and they would like to be able to add music to their dungeons. A musician named Justin Scotch is making custom music that will be included in a resource pack for Chocolate Quest and it will replace the Minecraft music disc songs. The songs are diverse and made to compliment dungeon exploration and boss fights. I'm working on making this device to help add music to the dungeons.
To play it once:
The ONLY time to use /testfor:
/testfor @a[r=15] -> comparator -> /playsound......
So as long as the player is in range, the signal stays on, and when they go away, it turns off and can play music again.
You can make a marker and /playsound villager.hurt @e[name=Marker]
so volume is, well volume, so is pitch, and I don't know about how direction affect it.
You can instead /playsound sound @a[r=10] ....
Rollback Post to RevisionRollBack
Get any of your command blocks problem solved here:
Thank you very much! Your suggestions dramatically improved the performance. However the music is still able to play multiple times simultaneously. I think I may need to add some type of redstone switch that only lets a signal through once. I don't know how to build that. I have searched Google but I don't really know what to call the thing so I can't find any information on it.
Thank you very much! Your suggestions dramatically improved the performance. The sound is now omnidirectional and I can make it so that the players can hear the music as far away as I want without the sound fading off! However the music is still able to play multiple times simultaneously. I think I may need to add some type of redstone switch that only lets a signal through once. I don't know how to build that. I have searched Google but I don't really know what to call the thing so I can't find any information on it.
These are the new settings I am using
/playsound records.cat @a[r=15]
I think we do want the music to start playing again if you go by it again after the music ends though...
What kind of redstone device only sends a signal once and then stays off?
I think it's important for us to understand how to make the song play only once. It will be preferable in some cases.
I noticed something else strange. The radius that the music plays in is limited to a maximum distance of 15m and it is tied to the location that you first hear the music play. The sound is not centered on the device. I learned this by turning the settings up to 100 meters on both command blocks.