Package net.minecraftforge.event.entity
Class EntityEvent.Size
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.entity.EntityEvent
net.minecraftforge.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
Cancelable
.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.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
Modifier and TypeFieldDescriptionprivate float
private EntityDimensions
private final float
private final EntityDimensions
private final Pose
-
Constructor Summary
ConstructorDescriptionSize
(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 TypeMethodDescriptionfloat
float
getPose()
void
setNewEyeHeight
(float newHeight) void
setNewSize
(EntityDimensions size) void
setNewSize
(EntityDimensions size, boolean updateEyeHeight) Set the new size of the entity.Methods inherited from class net.minecraftforge.event.entity.EntityEvent
getEntity
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, 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)
-