-
Notifications
You must be signed in to change notification settings - Fork 7
resetOnDistantTeleport
resetOnDistantTeleport
is a configuration option for Random and ZeroAtLocation offset providers that is considered unsafe, and requires a special opt-in to enable as of CoordinateOffset v2.3.0.
Similar to resetOnDeath
and resetOnWorldChange
, it is a provider option that triggers players' offsets to change whenever they teleport a large distance away. This is useful for preventing players from tracking where two warp points are relative to each other in the same world.
CoordinateOffset has to work around Minecraft's protocol and server implementations' APIs to obfuscate coordinates. The following protocol details make changing offsets within the same world problematic:
- If a teleport is over a short distance, the server will not re-send the client chunks it thinks the player already has, even though the player has moved a large distance away from the client's perspective.
- Teleports can be "relative" or "absolute", and the standard Spigot teleport API does not differentiate. (Paper does add this API)
- "Recovery Compass" items point to a location that can only change when the player respawns or changes world.
This means the following, respectively:
- Only teleports over a distance of roughly
(2 * view distance)
will activate an offset change. - If using a non-Paper-based server implementation, long-distance relative teleports (like
/tp ~500 ~ ~500
) will cause the client to glitch and need to quit and rejoin. - Recovery compasses will point to the wrong death location after a teleport, and only correct themselves after either a rejoin, world change, or death.
Add this line to the root of your plugins/CoordinateOffset/config.yml
:
allowUnsafeResetOnDistantTeleport: true
Then, enable reset on distant teleport in any RandomOffsetProvider
or ZeroAtLocationOffsetProvider
:
offsetProviders:
random:
class: RandomOffsetProvider
resetOnDeath: true
resetOnWorldChange: true
resetOnDistantTeleport: true # <--