PythonHunter Posted October 10, 2020 Posted October 10, 2020 (edited) Hi, I was wondering how would one make it so entities that are players would play no sound when walking. Basically I want to make it so when I am on a server, all other players' footsteps generate no sound? I also would like this mod to be client side only since I am not the owner of the servers I go on. The reason why I am making this mod is because whenever I am on a popular server with thousands of people, it gets noisy in the lobbies when everyone is moving around. However, I don't want to just turn off player sounds since there are other sounds that I do want to keep. Also I play using 1.12.2 version of Minecraft with forge. The code I have tried is Also, assume in the following below that instead of silence, I want pig noises, but in actuality I want no noise so I would probably make a custom ogg file that is well, silence. package net.mcreator.silencermod.procedure; import net.minecraft.world.World; import net.minecraft.util.SoundCategory; import net.minecraft.util.ResourceLocation; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.Entity; import net.mcreator.silencermod.ElementsModName; import net.minecraft.entity.player.EntityPlayerMP; @ElementsModName.ModElement.Tag public class ProcedureSilencer extends ElementsModName.ModElement { public ProcedureSilencer(ElementsModName instance) { super(instance, 1); } public static void executeProcedure(java.util.HashMap<String, Object> dependencies) { if (dependencies.get("entity") == null) { System.err.println("Failed to load dependency entity for procedure Silencer!"); return; } if (dependencies.get("x") == null) { System.err.println("Failed to load dependency x for procedure Silencer!"); return; } if (dependencies.get("y") == null) { System.err.println("Failed to load dependency y for procedure Silencer!"); return; } if (dependencies.get("z") == null) { System.err.println("Failed to load dependency z for procedure Silencer!"); return; } if (dependencies.get("world") == null) { System.err.println("Failed to load dependency world for procedure Silencer!"); return; } Entity entity = (Entity) dependencies.get("entity"); int x = (int) dependencies.get("x"); int y = (int) dependencies.get("y"); int z = (int) dependencies.get("z"); World world = (World) dependencies.get("world"); if ((entity instanceof EntityPlayerMP)) { world.playSound((EntityPlayer) null, x, y, z, (net.minecraft.util.SoundEvent) net.minecraft.util.SoundEvent.REGISTRY.getObject(new ResourceLocation("entity.pig.hurt")), SoundCategory.MASTER, (float) 1, (float) 1); } } } Edited October 10, 2020 by PythonHunter
ChampionAsh5357 Posted October 10, 2020 Posted October 10, 2020 1.12.2 is not supported on this forum. Please update to at least LTS 1.15.2 to receive support.
PythonHunter Posted October 10, 2020 Author Posted October 10, 2020 Okay, then I have no clue what to do then, so how would I do it if i played on 1.15.2?
ChampionAsh5357 Posted October 10, 2020 Posted October 10, 2020 Update to 1.15.2 and show proof. Otherwise, we cannot give you support.
PythonHunter Posted October 10, 2020 Author Posted October 10, 2020 What do you mean show "proof"? And why can't you give support?
PythonHunter Posted October 10, 2020 Author Posted October 10, 2020 Also where could I find what I am looking for if I want it to be 1.12.2, cause there must be somehwere that supports help for this mc version, right?
ChampionAsh5357 Posted October 10, 2020 Posted October 10, 2020 (edited) 3 minutes ago, PythonHunter said: What do you mean show "proof"? If you want us to provide support for either latest or LTS and you originally posted a topic for a legacy version, you need to show some kind of evidence that you ported to one of these versions. 3 minutes ago, PythonHunter said: And why can't you give support? Those are the rules of the forums. Even tells you which versions are supported in the blue info bar up top. 1 minute ago, PythonHunter said: Also where could I find what I am looking for if I want it to be 1.12.2, cause there must be somehwere that supports help for this mc version, right? Probably, but you would have to look for it yourself. Apologies I can't be of any more assistance. Edited October 10, 2020 by ChampionAsh5357
PythonHunter Posted October 10, 2020 Author Posted October 10, 2020 I haven't changed the mod yet since I don't even know where to start. So what should I do for 1.15.X ?
PythonHunter Posted October 10, 2020 Author Posted October 10, 2020 (edited) The same applies as the 1.12.2 but instead it is a 1.15.X mod What I mean is my objective is the same except it would be a 1.15.X mod. Also how do I prove I ported to a 1.15.X version? Edited October 10, 2020 by PythonHunter
Turtledove Posted October 10, 2020 Posted October 10, 2020 Post your same class in 1.15, it'll be obvious if it's 1.12 or not based on the class names.
Recommended Posts