Class ServerEntityWorldChangeEvents

java.lang.Object
net.fabricmc.fabric.api.entity.event.v1.ServerEntityWorldChangeEvents

public final class ServerEntityWorldChangeEvents
extends Object
Events related to an entity being moved to another world.
  • Field Details

    • AFTER_ENTITY_CHANGE_WORLD

      public static final Event<ServerEntityWorldChangeEvents.AfterEntityChange> AFTER_ENTITY_CHANGE_WORLD
      An event which is called after an entity has been moved to a different world.

      All entities are copied to the destination and the old entity removed. This event does not apply to the ServerPlayerEntity since players are physically moved to the new world instead of being copied over.

      A mod may use this event for reference cleanup if it is tracking an entity's current world.

      See Also:
      AFTER_PLAYER_CHANGE_WORLD
    • AFTER_PLAYER_CHANGE_WORLD

      public static final Event<ServerEntityWorldChangeEvents.AfterPlayerChange> AFTER_PLAYER_CHANGE_WORLD
      An event which is called after a player has been moved to a different world.

      This is similar to AFTER_ENTITY_CHANGE_WORLD but is only called for players. This is because the player is physically moved to the new world instead of being recreated at the destination.

      See Also:
      AFTER_ENTITY_CHANGE_WORLD