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
public static class EntityEvent.Size extends EntityEvent
This event is fired whenever thePose
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 notCancelable
.
This event does not have a result.Event.HasResult
This event is fired on theMinecraftForge.EVENT_BUS
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructing, EntityEvent.Size
-
-
Field Summary
Fields Modifier and Type Field Description private float
newEyeHeight
private EntitySize
newSize
private float
oldEyeHeight
private EntitySize
oldSize
private Pose
pose
-
Constructor Summary
Constructors Constructor Description Size(Entity entity, Pose pose, EntitySize size, float defaultEyeHeight)
Size(Entity entity, Pose pose, EntitySize oldSize, EntitySize newSize, float oldEyeHeight, float newEyeHeight)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getNewEyeHeight()
EntitySize
getNewSize()
float
getOldEyeHeight()
EntitySize
getOldSize()
Pose
getPose()
void
setNewEyeHeight(float newHeight)
void
setNewSize(EntitySize size)
void
setNewSize(EntitySize size, boolean updateEyeHeight)
Set the new size of the entity.-
Methods inherited from class net.minecraftforge.event.entity.EntityEvent
getEntity
-
-
-
-
Field Detail
-
pose
private final Pose pose
-
oldSize
private final EntitySize oldSize
-
newSize
private EntitySize newSize
-
oldEyeHeight
private final float oldEyeHeight
-
newEyeHeight
private float newEyeHeight
-
-
Constructor Detail
-
Size
public Size(Entity entity, Pose pose, EntitySize size, float defaultEyeHeight)
-
Size
public Size(Entity entity, Pose pose, EntitySize oldSize, EntitySize newSize, float oldEyeHeight, float newEyeHeight)
-
-
Method Detail
-
getPose
public Pose getPose()
-
getOldSize
public EntitySize getOldSize()
-
getNewSize
public EntitySize getNewSize()
-
setNewSize
public void setNewSize(EntitySize size)
-
setNewSize
public void setNewSize(EntitySize size, boolean updateEyeHeight)
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)
-
-