Started by
LaTortiia
on
Topic category: Help with Minecraft modding (Java Edition)
I'm making a mod and I need to play a sound with a very large range, but I only want 1 player to hear it, is there any way to do that?
Topic category: Help with Minecraft modding (Java Edition)
I'm making a mod and I need to play a sound with a very large range, but I only want 1 player to hear it, is there any way to do that?
As far as I know, that is not how minecraft's sound engine works. This might be impossible, even with custom code.
LOL, no. It is possible to create a sound for only one player. All you have to do is use a custom command block in the procedures window. Find execute command and type in the text field:
When doing a sound, figure out the data tag of your sound you created or just a (Minecraft:) sound. Then, pick your source, which will usually be "master" since most people sometimes mute other sounds, and master will be on most of the time. Then, If executing a sound on a player, use your target as (@p). This will find the closest player and play that sound only to them. Then x y z can be ~ ~ ~ but sometimes, just those symbols can sometimes break the sound and not play anything, so add a 1 like this: ~1 ~1 ~1, and your volume and pitch is up to you. This is about the only way to execute something like this, so good luck! Hope you like it!
Finished product can look like this --> /playsound minecraft:entity.lightning.bolt master @p ~1 ~1 ~1 1000 1