My questions have been answered! Here are some helpful pictures to tell you how to build a device that will detect when a player is near and then play music for them.
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
/testfor @a[r=15]
/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.
That's what we will do! Thanks again. This is great.
Here is a picture of the device installed underneath the entrance of a stadium I am working on. When you enter the stadium my Youtube intro music plays and fireworks go off.
I have updated my original post so that this thread will be more helpful to people who are researching this topic in the future. Thanks again to Mysteeriousguy for all the helpful advice!
The Proximity Detector Command Block
/testfor <player> [dataTag]
The Music Player Command Block
/playsound [x] [y] [z] [volume] [pitch] [minimumVolume]
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.
/playsound [x] [y] [z] [volume] [pitch] [minimumVolume]
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.
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] ....
These are the new settings I am using
/testfor @a[r=15]
/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...
also, for any reader who is wondering: the chocolatequest mod is here:
http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1278075-chocolate-quest-mods-for-the-adventurers
and the wiki (witch has the easiest to locate link to the 1.7 version) is here:
http://chocolatequest.wikia.com/
My Mods:
Fool's gold & other dumb things
Placebo Effect
Two others that I am pretending don't exist.
Also, Modding Theory.
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.
Or a command block that setblock air on the clock
Here is a picture of the device installed underneath the entrance of a stadium I am working on. When you enter the stadium my Youtube intro music plays and fireworks go off.
/playsound records.cat @a[r=15] ~ ~ ~ 9.0 1 1.0