Class BlockAttachedEntity

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

public abstract class BlockAttachedEntity extends Entity
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • checkInterval

      private int checkInterval
    • pos

      protected BlockPos pos
  • Constructor Details

  • Method Details

    • recalculateBoundingBox

      protected abstract void recalculateBoundingBox()
    • tick

      public void tick()
      Overrides:
      tick in class Entity
    • survives

      public abstract boolean survives()
    • isPickable

      public boolean isPickable()
      Overrides:
      isPickable in class Entity
    • skipAttackInteraction

      public boolean skipAttackInteraction(Entity pEntity)
      Called when a player attacks an entity. If this returns true the attack will not happen.
      Overrides:
      skipAttackInteraction in class Entity
    • hurt

      public boolean hurt(DamageSource pSource, float pAmount)
      Called when the entity is attacked.
      Overrides:
      hurt in class Entity
    • move

      public void move(MoverType pType, Vec3 pPos)
      Overrides:
      move in class Entity
    • push

      public void push(double pX, double pY, double pZ)
      Adds to the current velocity of the entity, and sets
      invalid reference
      #isAirBorne
      to true.
      Overrides:
      push in class Entity
    • addAdditionalSaveData

      public void addAdditionalSaveData(CompoundTag pCompound)
      Specified by:
      addAdditionalSaveData in class Entity
    • readAdditionalSaveData

      public void readAdditionalSaveData(CompoundTag pCompound)
      (abstract) Protected helper method to read subclass entity data from NBT.
      Specified by:
      readAdditionalSaveData in class Entity
    • dropItem

      public abstract void dropItem(@Nullable Entity pEntity)
    • repositionEntityAfterLoad

      protected boolean repositionEntityAfterLoad()
      Overrides:
      repositionEntityAfterLoad in class Entity
    • setPos

      public void setPos(double pX, double pY, double pZ)
      Sets the x,y,z of the entity from the given parameters. Also seems to set up a bounding box.
      Overrides:
      setPos in class Entity
    • getPos

      public BlockPos getPos()
    • thunderHit

      public void thunderHit(ServerLevel pLevel, LightningBolt pLightning)
      Overrides:
      thunderHit in class Entity
    • refreshDimensions

      public void refreshDimensions()
      Overrides:
      refreshDimensions in class Entity