Hide coordinates
YoLaw opened this issue ยท 24 comments
Hello!
I've a good idea for your plugin.
In effect I use this for an UHC server. So players can see others players's coordinates.
It is a problem, and it will be good if you add an option to disable coordinates in F3 menu! :)
Thanks! :)
Hmm, thought this would be quite easy but actually it won't - I'm not sure if it's possible to set gamerules per player (/gamerule reducedDebugInfo true
). Is it even possible using packets? I had a look at ProtocolLib but wasn't sure if it supported this or how...
Of course, the simple alternative would be to hide coordinates for everyone then use a command from a plugin such as Essentials, which spectators couldn't access due to command whitelisting.
Good job!
(One side note, why ReduceDebugInfos
when the gamerule is ReducedDebugInfo
?)
(Oh, you're right.) (I'll change that everywhere, for coherence, while I still can.)
This feature is useful, but with my friend we detected a fault: players who have a specific client with mods who displays coordinates, they can see coordinates!
It's the case of Laby Mod! :)
Yes! But it is not easy to detect... But I know that plugins can't manage clients, and hide F3 coordinates is the best solution... :/
Well, we could technically fake the coordinates by adding a random number to them (maybe? might mess up chunk loading), which would make the coordinates useless.
I'm aware of this problem but I don't see any elegant workaround (as for now).
@pgmann yes it's a good idea, but I think it could be difficult to do!
Yeah...
You must modify ALL packets.
As you may know not only players have location, also items, mobs, other players, weather effects.
world and chunk packets, also block updates and a few others, like respawn and login.
All packets must be "adapted" to follow the given player's "local space and time".
(Source)
If this is achieved, it should be in a dedicated plugin, I think. We are out of the SpectatorPlus scope.
Ever tested, but not working, with error messages! :) No problem it's not your job to give me other plugins! :)
Decompiled version: https://pgmann.cf/projects/mc/RandomCoords.zip
Look at the comments: there's a source code here (decompiled and refactored for an older version).
It is probably easy to send manually a packet (even without ProtocolLib, with a bit of reflection) to achieve that. I can try something if you want :) .
For reference, we only need to send this packet to enable or disable reduced debug infos.
Ah yes! Never thought of looking there ;)
22 Enables reduced debug for the given player
23 Disables reduced debug for the given player