Skip to content

PlayerChangeWorldEvent

Triggered whenever a player is moved to a different world. This event cannot be canceled.

When this event is fired, the player has already been teleported to the destination world.

Example

local queue = spell:collect("PlayerChangeWorldEvent")
while true do
  local evt = queue:next() --[[@as PlayerChangeWorldEvent]]
  print("Player " .. evt.player.name .. " just entered " .. evt.destination.dimension)
end

Fields

destination: World — Read-Only

A reference to the world the player entered.

name: string — Read-Only

The name of this event.

origin: World — Read-Only

A reference to the world the player left.

player: Player — Read-Only

A reference to the player who changed worlds.