I have a hub and we have players hidden using the entity-tracking-range, which currently makes it so you can't see players. The only problem, you hear their footsteps :_ Can someone point me in the right direction please. Thank you.
Footstep sounds are done via the client so it is not possible to 'remove' them from the game but you could have the player floating an inch or two off the ground (flying) which will stop the sound of footsteps. And the players won't really notice as they can't see the other players. If you still haven't got this sorted in one hour, let me know and I will sort it out for you! -Keiran
I don't know for sure at all, but I think this MAY be possible somehow (perhaps with ProtocolLib Comphenix ?)
using protocol lib Dont use it much myself so i cant help you on how to do it should be fairly simple though
That's only partially true. Yes, the walking sound is handled by the client, but only for the player's own entity. The server does in fact send a sound packet for every nearby entity. Here's an example of how to suppress player walking sounds (download): Code:java public void onEnable() { ProtocolLibrary.getProtocolManager().addPacketListener( new PacketAdapter(this, ConnectionSide.SERVER_SIDE, Packets.Server.NAMED_SOUND_EFFECT) { public void onPacketSending(PacketEvent event) { PacketContainer packet = event.getPacket(); World world = event.getPlayer().getWorld(); String soundName = packet.getStrings().read(0); double x = (packet.getIntegers().read(0) / 8.0); double y = (packet.getIntegers().read(1) / 8.0); double z = (packet.getIntegers().read(2) / 8.0); Location loc = new Location(world, x, y, z); if (soundName.startsWith("step.")) { Player closest = null; double bestDistance = Double.MAX_VALUE; // Find the player closest to the sound for (Player player : world.getPlayers()) { double distance = player.getLocation().distance(loc); if (distance < bestDistance) { bestDistance = distance; closest = player; } } System.out.println("Cancelled " + soundName + " caused by " + closest); event.setCancelled(true); } } });}
Thanks so much! Thank you, now I must learn how to insert this code on my own. Appreciate it again can't wait to give it a go! EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Can't you just hide that player from every player on the hub? I believe doing so will basically hide the player from any interaction such as pvp, sound, etc. Code:java @EventHandlerpublic void joinHidePlayer(PlayerJoinEvent event){Player player = event.getPlayer();for(Player p : Bukkit.getOnlinePlayers()){p.hidePlayer(player);player.hidePlayer(p);}}