I'm wondering if it's possible to program a Command Block to sound all Note Blocks at once by pressing a button. I'm updating a school map and I want to place Note Blocks with the same pitch around the school and have them all imitate a bell at the same time. Is this possible (and if so, what is the code)?
That doesn't seem to work. I'm new to command blocks, but it seems like they also changed the interface in 1.13 and not everything works the same way. Also, is there a way to do it by putting a button on each Note Block and making the Command Block press the buttons instead? I don't really want the interface showing block replacements every time the "ring bell" button would be pressed.
I changed plans because Note Blocks are not usable if there is a block right above them (which is the case with where I wanted to put them). Now I'm wondering if there is a way to set the range of one note block so it can be heard throughout the building. Can a Command Block do that?
I got it sorted out. I used a combination of an Execute command and a Playsound command to achieve the bell sounding at anywhere in the map. Playsound makes the Note Block pitch play and Execute makes the sound be relative to the player's position instead of coming from the direction of the command block.
I'm wondering if it's possible to program a Command Block to sound all Note Blocks at once by pressing a button. I'm updating a school map and I want to place Note Blocks with the same pitch around the school and have them all imitate a bell at the same time. Is this possible (and if so, what is the code)?
You could try summoning a redstone block next to all note blocks and then remove them.
I’m writing this on my phone so I can’t test, but this is how I would do it.
impulse, unconditional, requires red stone
execute @e[type=note_block] ~ ~ ~ setblock ~ ~ ~1 redstone_block
chain, conditional, always active
execute @e[type=note_block] ~ ~ ~ setblock ~ ~ ~1 glass_block
That doesn't seem to work. I'm new to command blocks, but it seems like they also changed the interface in 1.13 and not everything works the same way. Also, is there a way to do it by putting a button on each Note Block and making the Command Block press the buttons instead? I don't really want the interface showing block replacements every time the "ring bell" button would be pressed.
Are you on Java?
Yes.
I changed plans because Note Blocks are not usable if there is a block right above them (which is the case with where I wanted to put them). Now I'm wondering if there is a way to set the range of one note block so it can be heard throughout the building. Can a Command Block do that?
I got it sorted out. I used a combination of an Execute command and a Playsound command to achieve the bell sounding at anywhere in the map. Playsound makes the Note Block pitch play and Execute makes the sound be relative to the player's position instead of coming from the direction of the command block.
This video answered my questions: