Package net.minecraftforge.event.entity
Class EntityJoinWorldEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.entity.EntityEvent
net.minecraftforge.event.entity.EntityJoinWorldEvent
EntityJoinWorldEvent is fired when an Entity joins the world.
This event is fired whenever an Entity is added to the world in
Note: This event may be called before the underlying
This event is
If this event is canceled, the Entity is not added to the world.
This event does not have a result.
This event is fired on the
This event is fired whenever an Entity is added to the world in
Level#loadEntities(Collection)
,
net.minecraft.world.ServerWorld#loadEntities(Collection)
World#joinEntityInSurroundings(Entity)
, and
World#spawnEntity(Entity)
. Note: This event may be called before the underlying
LevelChunk
is promoted to ChunkStatus.FULL
.
You will cause chunk loading deadlocks if you don't delay your world interactions.world
contains the world in which the entity is to join.This event is
Cancelable
.If this event is canceled, the Entity is not added to the world.
This event does not have a result.
Event.HasResult
This event is fired on the
MinecraftForge.EVENT_BUS
.-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.CanUpdate, EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
-
Constructor Summary
ConstructorDescriptionEntityJoinWorldEvent(Entity entity, Level world)
EntityJoinWorldEvent(Entity entity, Level world, boolean loadedFromDisk)
-
Method Summary
Methods inherited from class net.minecraftforge.event.entity.EntityEvent
getEntity
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
-
Field Details
-
world
-
loadedFromDisk
private final boolean loadedFromDisk
-
-
Constructor Details
-
EntityJoinWorldEvent
-
EntityJoinWorldEvent
-
-
Method Details
-
getWorld
-
loadedFromDisk
public boolean loadedFromDisk()- Returns:
true
if the entity was loaded from disk. On client entities, the info isn't available and this will always returnfalse
.
-