Class EntityJoinLevelEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.EntityEvent
net.neoforged.neoforge.event.entity.EntityJoinLevelEvent
- All Implemented Interfaces:
- net.neoforged.bus.api.ICancellableEvent
public class EntityJoinLevelEvent
extends EntityEvent
implements net.neoforged.bus.api.ICancellableEvent
This event is fired whenever an 
Entity joins a Level.
 This event is fired whenever an entity is added to a level in LevelWriter.addFreshEntity(Entity)
 and PersistentEntitySectionManager#addNewEntity(Entity, boolean).
 
 Note: This event may be called before the underlying LevelChunk is promoted to ChunkStatus.FULL.
 You will cause chunk loading deadlocks if you do not delay your world interactions.
 
This event is cancellable and does not have a result. If the event is canceled, the entity will not be added to the level.
This event is fired on the main Forge event bus on both logical sides.
- 
Nested Class SummaryNested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.EntityEventEntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.SizeNested classes/interfaces inherited from class net.neoforged.bus.api.Eventnet.neoforged.bus.api.Event.HasResult, net.neoforged.bus.api.Event.Result
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionEntityJoinLevelEvent(Entity entity, Level level) EntityJoinLevelEvent(Entity entity, Level level, boolean loadedFromDisk) 
- 
Method SummaryModifier and TypeMethodDescriptiongetLevel()Returns the level that the entity is set to join.booleanMethods inherited from class net.neoforged.neoforge.event.entity.EntityEventgetEntityMethods inherited from class net.neoforged.bus.api.EventgetResult, hasResult, setResultMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.bus.api.ICancellableEventisCanceled, setCanceled
- 
Field Details- 
level
- 
loadedFromDiskprivate final boolean loadedFromDisk
 
- 
- 
Constructor Details- 
EntityJoinLevelEvent
- 
EntityJoinLevelEvent
 
- 
- 
Method Details- 
getLevelReturns the level that the entity is set to join.- Returns:
- the level that the entity is set to join
 
- 
loadedFromDiskpublic boolean loadedFromDisk()- Returns:
- trueif the entity was loaded from disk,- falseotherwise. On the logical client, this will always return- false.
 
 
-