SpectatorPlus

SpectatorPlus

34.1k Downloads

Hide coordinates

YoLaw opened this issue ยท 24 comments

commented

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! :)

commented

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.

commented

Good job!

(One side note, why ReduceDebugInfos when the gamerule is ReducedDebugInfo?)

commented

(Oh, you're right.) (I'll change that everywhere, for coherence, while I still can.)

commented

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! :)

commented

If they're 'hacking' maybe they should be banned ;)

commented

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... :/

commented

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.

commented

I'm aware of this problem but I don't see any elegant workaround (as for now).

commented

@pgmann yes it's a good idea, but I think it could be difficult to do!

commented

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)

commented

If this is achieved, it should be in a dedicated plugin, I think. We are out of the SpectatorPlus scope.

commented

Hardcore! :o

commented

NoCheat++++ ;)

commented

Ever tested, but not working, with error messages! :) No problem it's not your job to give me other plugins! :)

commented

Yeah it's not been updated since 1.7, but I guess the code might be salvageable...

commented

May be! I think you can decompile this :)

commented

Look at the comments: there's a source code here (decompiled and refactored for an older version).

commented

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 :) .

commented

Yep, that might be better than me messing about with it ;)

commented

For reference, we only need to send this packet to enable or disable reduced debug infos.

commented

Ah yes! Never thought of looking there ;)

22 Enables reduced debug for the given player
23 Disables reduced debug for the given player

commented

My friend is a developer, and he can achieve this easily! :)