Class EntityEvent.Size

  • Enclosing class:
    EntityEvent

    public static class EntityEvent.Size
    extends EntityEvent
    This event is fired whenever 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.
    • Field Detail

      • pose

        private final Pose pose
      • oldEyeHeight

        private final float oldEyeHeight
      • newEyeHeight

        private float newEyeHeight
    • Method Detail

      • getPose

        public Pose getPose()
      • 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)