Class ServerEntityWorldChangeEvents
java.lang.Object
net.fabricmc.fabric.api.entity.event.v1.ServerEntityWorldChangeEvents
Events related to an entity being moved to another world.
- API Note:
- For a
ServerPlayerEntity
, please useAFTER_PLAYER_CHANGE_WORLD
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
-
Field Summary
Modifier 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 physically moved to the new world instead of being recreated at the destination.- See Also:
-