Class ServerEntityWorldChangeEvents
- API Note:
- For a
ServerPlayerEntity
, please useAFTER_PLAYER_CHANGE_WORLD
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Event
<ServerEntityWorldChangeEvents.AfterEntityChange> An event which is called after an entity has been moved to a different world.static final Event
<ServerEntityWorldChangeEvents.AfterPlayerChange> An event which is called after a player has been moved to a different world. -
Method Summary
-
Field Details
-
AFTER_ENTITY_CHANGE_WORLD
public static final Event<ServerEntityWorldChangeEvents.AfterEntityChange> AFTER_ENTITY_CHANGE_WORLDAn 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
public static final Event<ServerEntityWorldChangeEvents.AfterPlayerChange> AFTER_PLAYER_CHANGE_WORLDAn 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 usually physically moved to the new world instead of being recreated at the destination.However, there is one exception to this. When the player respawns in a different world, the player is recreated at the destination. When that happens, this event passes in the new
ServerPlayerEntity
. If you need the oldServerPlayerEntity
, seeServerPlayerEvents.AFTER_RESPAWN
- See Also:
-