Want a better Minecraft server? Read about SpigotMC here!
Separate names with a comma.
Discussion in 'Spigot Plugin Development' started by Noel_123567, Jan 9, 2020.
Im looking for a anti toggle sneak plugin
Client will likely just constantly overwrite sneaking value sent from server.
??? whats the point of the event being cancellable if it doesn't work?
If the client just overrode it no matter what the event would not implement Cancellable, have you tried it?
It does work, it stops the player from sneaking for one time, and then when the client tries to sneak again, it will stop him again. There is no way that the server could just tell the client "you can't sneak from now on".
The only reason you’d want to block ToggleSneak is for cheat prevention purposes. The best way to detect this and punish/warn for it, is to flag them when they are sneaking with a GUI open or interact with a GUI while sneaking. Some other variation of this would be a form of NoSlow detection that would flag when sprinting while sneaking.
That's... quite obvious...
When people ask, how can I make people unable to hit eachother? They mean how can I prevent it and then after that prevent it again and again and again, not prevent it entirely, the only things I can think of that can be prevented fully is things like Player#setAllowFlight, that's just how the minecraft protocol works and the client server relationship with this sort of game in general...
You do realize, that toggle sneak is a vanilla mechanic now? https://minecraft.gamepedia.com/Java_Edition_19w41a#Gameplay
Yeah it's a vanilla mechanic now. We can only assume he's using an outdated version and wants to prevent it for competitive gameplay reasons.
You may be able to use EntityMetadataPackets, but I'm not sure how that would work out.
I think the best option is instead of canceling the player from sneaking is to alert online staff, so they can determine whether the player is using toggle sneak or not.
In older versions where toggle sneaking wasn't a thing and you couldn't sneak with a GUI open, I would automatically ban players for using it.
wait how do you toggle sneak?
yea but what buttons do i push?
click the link bruh.. it tells you