
Hey everybody, it’s Under My Cap, and welcome back to another video. Today, I’m going to show you how to use the Minecraft play sound command. One sad thing I’ve discovered about my channel is that not many people who watch my videos are subscribed—it’s around 0.9 or 1.9 percent. So, can we please try to get that to 10 percent this time? If you could subscribe and hit the bell icon to make sure you get notified of every future video I upload, that would be great.
Let’s get started! As you can see, I’ve color-coded the types of commands from blue to yellow to red; blue represents the easiest and red indicates the hardest or those that require more thinking. The green blocks are where I will actually show you how to do the command. So, let’s start off with the first command.
The first command I’ll show you is the normal play sound command, which is displayed as `/play sound minecraft:entity.player.levelup`. This command will play the sound at the command block. So when I press the button, you should hear the random level-up sound. As you can see, it’s the normal level-up sound; every time you press it, it’s the same.
The command is `/play sound minecraft:entity.player.levelup ambient`. The reason I typed in `entity` and `player` is that the level-up sound is specifically made for the player. Other entities, like creepers or spiders, don’t normally make this sound, nor do blocks. For example, an anvil doesn’t play a sound when you place it. Different sounds vary. If I wanted to change that to a block sound, I would just scroll down and change `entity` to `block`.
After doing that, you need to specify the target; it will play the sound for all players by default. If you want it to be for the nearest player, you can use `@p`. For a random player, you can use `@r`, and if you want to target all entities, you can use `@e`. However, targeting all entities isn’t very useful because they won’t react to the sound.
Next, you should type in the coordinates where the sound will be played. By entering these three coordinates, it indicates that the command or sound will be played at that command block. After that, you should be done with this basic command. If I press it, you’ll get the same command as this one.
To add more customization to the sounds, we can alter the volume. For instance, I’ve set the volume to 100%, and it sounds the same as the other one. But if I change the volume to 0.1, you might not hear it well, but the sound actually gets much lower. Just to show you how to do that, here’s the command: `/play sound minecraft:entity.player.levelup ambient @a 0.1`.
You can use this with any other Minecraft sounds; it works with all. If you want it louder, you can set it up to 200%. You can even go over that; I’m not sure what the absolute limit is, but it does increase. The louder the volume, the further away you can hear the sound from.
The next feature is altering the pitch. In this example, we’ve lowered the sound, and it’s a similar command to the previous one, except the volume and pitch are added. If you enter `1` for pitch, it plays the sound at the normal pitch. If you make it lower, let’s say `0.5`, it plays a lower sound. Conversely, increasing the pitch to `1.5` will make it a higher pitch. In some servers, I’ve heard they go up to `2`, and that’s the max.
Now, let’s move on to commands that are a little more complex. The reason I say these are harder is that they use the execute command to run the play sound command, which allows for more specific targeting. The commands we worked with before executed sounds at a certain point for any player, while these allow you to execute sounds for specific mobs or players if specific conditions are met.
The first example of this is executing the play sound command for all entities except the player. It looks like this: `/execute at @e[type=!player] run play sound minecraft:item.totem.use ambient @a 0.5 1`. The exclamation mark means it will not target the player, but every other entity.
After executing this, you can see that the sound played for all entities apart from the player. The next example plays a sound for a specific mob. If we target a spider, for instance, we replace the exclamation mark and specify the spider in the command, resulting in a unique sound for that specific mob.
Lastly, I’ll cover testing if there is a certain block above the command block. This is a little more complex as I set it to work only if there is a specific block. For example, I’ve designated it to work with red concrete. If I place wooden planks above it, nothing happens, but when I place red concrete, it triggers the command.
The command will look like this: `/execute if block
This post has used AI to generate and enhance content