OnPlayerDimensionChange

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 14:37, 11 October 2026 by QCherry (talk | contribs) (Document upcoming 0.1.8 character dimensions: six server APIs, three events and creator guide; not a release announcement)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

onPlayerDimensionChange

AVAILABLE FROM UPDATE 0.1.8
This event is available in G1R:MP 0.1.8 and later. The contract below includes the compatibility guarantees introduced in that update.

Emitted after an actual successful server-side dimension change of a player.

Availability

This event is available in server-side scripts.

Callback signature

function(playerId, oldDimension, newDimension)

Parameters

Name Type Description
playerId number Numeric ID of the connected player.
oldDimension number Previous dimension.
newDimension number New dimension accepted by the server.

Examples

addEventHandler("onPlayerDimensionChange", root,
    function(playerId, oldDimension, newDimension)
        outputDebugString("Dimension " .. oldDimension .. " -> " .. newDimension)
    end)

Notes

  • Available from 0.1.8 / Protocol 40, currently in testing and not yet publicly released. Not included in public 0.1.7. Both client and server must update together.
  • Register on root. This is a server-local event, not a client rendering or transition-readiness acknowledgement.
  • Not emitted for an unchanged dimension, rejected setter, initial spawn or ordinary connection.
  • See Character dimensions. Avoid unbounded recursive dimension changes inside this handler.