Class EntityLeaveLevelEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.EntityEvent
net.neoforged.neoforge.event.entity.EntityLeaveLevelEvent

public class EntityLeaveLevelEvent extends EntityEvent
This event is fired whenever an Entity leaves a Level. This event is fired whenever an entity is removed from the level in LevelCallback.onTrackingEnd(Object).

This event is not

invalid reference
cancellable
and does not
invalid reference
have a result
.

This event is fired on the main Forge event bus on both logical sides.

  • Field Details

    • level

      private final Level level
  • Constructor Details

    • EntityLeaveLevelEvent

      public EntityLeaveLevelEvent(Entity entity, Level level)
  • Method Details

    • getLevel

      public Level getLevel()
      Returns the level the entity is set to leave.
      Returns:
      the level the entity is set to leave