Class HangingEntity

All Implemented Interfaces:
CommandSource, SyncedDataHolder, EntityAccess, Nameable, ScoreHolder, IAttachmentHolder, IEntityExtension, INBTSerializable<CompoundTag>
Direct Known Subclasses:
ItemFrame, Painting

public abstract class HangingEntity extends BlockAttachedEntity
  • Field Details

    • HANGING_ENTITY

      protected static final Predicate<Entity> HANGING_ENTITY
    • direction

      protected Direction direction
      The direction the entity is facing
  • Constructor Details

  • Method Details

    • setDirection

      protected void setDirection(Direction pFacingDirection)
      Updates facing and bounding box based on it
    • recalculateBoundingBox

      protected final void recalculateBoundingBox()
      Specified by:
      recalculateBoundingBox in class BlockAttachedEntity
    • calculateBoundingBox

      protected abstract AABB calculateBoundingBox(BlockPos pPos, Direction pDirection)
    • survives

      public boolean survives()
      Specified by:
      survives in class BlockAttachedEntity
    • calculateSupportBox

      protected AABB calculateSupportBox()
    • getDirection

      public Direction getDirection()
      Overrides:
      getDirection in class Entity
    • playPlacementSound

      public abstract void playPlacementSound()
    • spawnAtLocation

      public ItemEntity spawnAtLocation(ItemStack pStack, float pOffsetY)
      Drops an item at the position of the entity.
      Overrides:
      spawnAtLocation in class Entity
    • rotate

      public float rotate(Rotation pTransformRotation)
      Transforms the entity's current yaw with the given Rotation and returns it. This does not have a side-effect.
      Overrides:
      rotate in class Entity
    • mirror

      public float mirror(Mirror pTransformMirror)
      Transforms the entity's current yaw with the given Mirror and returns it. This does not have a side-effect.
      Overrides:
      mirror in class Entity