Class EntityEvent.Size
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.EntityEvent
net.neoforged.neoforge.event.entity.EntityEvent.Size
- Enclosing class:
- EntityEvent
This event is fired whenever the
CAREFUL: This is also fired in the Entity constructor. Therefore the entity(subclass) might not be fully initialized. Check Entity#isAddedToWorld() or !Entity#firstUpdate.
If you change the player's size, you probably want to set the eye height accordingly as well
This event is not
This event does not have a result.
This event is fired on the
Pose changes, and in a few other hardcoded scenarios.CAREFUL: This is also fired in the Entity constructor. Therefore the entity(subclass) might not be fully initialized. Check Entity#isAddedToWorld() or !Entity#firstUpdate.
If you change the player's size, you probably want to set the eye height accordingly as well
This event is not
ICancellableEvent.This event does not have a result.
Event.HasResult
This event is fired on the
NeoForge.EVENT_BUS.-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.SizeNested classes/interfaces inherited from class net.neoforged.bus.api.Event
net.neoforged.bus.api.Event.HasResult, net.neoforged.bus.api.Event.Result -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate floatprivate EntityDimensionsprivate final floatprivate final EntityDimensionsprivate final Pose -
Constructor Summary
ConstructorsConstructorDescriptionSize(Entity entity, Pose pose, EntityDimensions size, float defaultEyeHeight) Size(Entity entity, Pose pose, EntityDimensions oldSize, EntityDimensions newSize, float oldEyeHeight, float newEyeHeight) -
Method Summary
Modifier and TypeMethodDescriptionfloatfloatgetPose()voidsetNewEyeHeight(float newHeight) voidsetNewSize(EntityDimensions size) voidsetNewSize(EntityDimensions size, boolean updateEyeHeight) Set the new size of the entity.Methods inherited from class net.neoforged.neoforge.event.entity.EntityEvent
getEntityMethods inherited from class net.neoforged.bus.api.Event
getResult, hasResult, setResult
-
Field Details
-
pose
-
oldSize
-
newSize
-
oldEyeHeight
private final float oldEyeHeight -
newEyeHeight
private float newEyeHeight
-
-
Constructor Details
-
Size
-
Size
public Size(Entity entity, Pose pose, EntityDimensions oldSize, EntityDimensions newSize, float oldEyeHeight, float newEyeHeight)
-
-
Method Details
-
getPose
-
getOldSize
-
getNewSize
-
setNewSize
-
setNewSize
Set the new size of the entity. Set updateEyeHeight to true to also update the eye height according to the new size. -
getOldEyeHeight
public float getOldEyeHeight() -
getNewEyeHeight
public float getNewEyeHeight() -
setNewEyeHeight
public void setNewEyeHeight(float newHeight)
-