Class EntityWarden

All Implemented Interfaces:
EntityControlUtils, LogicalUtils, EntityAgeable, EntityAsyncPrepare, EntityCanAttack, EntityDamageable, EntityNameable, EntityWalkable, EntityInventoryHolder, InventoryHolder, VibrationListener, Metadatable, Cloneable

public class EntityWarden extends EntityMob implements EntityWalkable, VibrationListener
  • Field Details

    • NETWORK_ID

      public static final int NETWORK_ID
      See Also:
    • lastDetectTime

      protected int lastDetectTime
    • lastCollideTime

      protected int lastCollideTime
    • waitForVibration

      protected boolean waitForVibration
  • Constructor Details

  • Method Details

    • requireBehaviorGroup

      public IBehaviorGroup requireBehaviorGroup()
      Description copied from class: EntityIntelligent
      请求一个行为组实例,此方法在实体初始化行为组时调用
      Overrides:
      requireBehaviorGroup in class EntityIntelligent
      Returns:
      新创建的行为组
    • getNetworkId

      public int getNetworkId()
      Description copied from class: Entity
      获得该实体的网络ID

      Get the network ID of the entity

      Specified by:
      getNetworkId in class Entity
      Returns:
      the network id
    • getHeight

      public float getHeight()
      Description copied from class: Entity
      实体高度

      entity Height

      Overrides:
      getHeight in class Entity
      Returns:
      the height
    • getFloatingHeight

      @Since("1.19.60-r1") public float getFloatingHeight()
      Description copied from class: EntityPhysical
      获得浮动到的实体高度 , 0为实体底部 Entity.getCurrentHeight()为实体顶部
      例:
      值为0时,实体的脚接触水平面
      值为getCurrentHeight/2时,实体的中间部分接触水平面
      值为getCurrentHeight时,实体的头部接触水平面
      Overrides:
      getFloatingHeight in class EntityPhysical
      Returns:
      the float
    • getWidth

      public float getWidth()
      Overrides:
      getWidth in class Entity
    • initEntity

      protected void initEntity()
      Overrides:
      initEntity in class EntityMob
    • getOriginalName

      public String getOriginalName()
      Description copied from class: Entity
      The name that English name of the type of this entity.
      Overrides:
      getOriginalName in class Entity
    • getListenerVector

      public Vector3 getListenerVector()
      Description copied from interface: VibrationListener
      返回振动监听器的位置
      Specified by:
      getListenerVector in interface VibrationListener
      Returns:
      Vector3
    • onVibrationOccur

      public boolean onVibrationOccur(VibrationEvent event)
      Description copied from interface: VibrationListener
      是否响应此振动 若响应,将会从声波源发射声波到监听器位置,并在到达时调用 onVibrationArrive() 方法 请注意,若此方法被调用,则声波必定可到达
      Specified by:
      onVibrationOccur in interface VibrationListener
      Parameters:
      event - 振动事件
      Returns:
      boolean
    • onVibrationArrive

      public void onVibrationArrive(VibrationEvent event)
      Description copied from interface: VibrationListener
      声波到达事件
      Specified by:
      onVibrationArrive in interface VibrationListener
      Parameters:
      event - 振动事件
    • getListenRange

      public double getListenRange()
      Description copied from interface: VibrationListener
      返回振动监听半径
      Specified by:
      getListenRange in interface VibrationListener
      Returns:
      double
    • close

      public void close()
      Overrides:
      close in class Entity
    • knockBack

      public void knockBack(Entity attacker, double damage, double x, double z, double base)
      Overrides:
      knockBack in class EntityLiving
    • onCollide

      protected boolean onCollide(int currentTick, List<Entity> collidingEntities)
      Overrides:
      onCollide in class EntityPhysical
      collidingEntities - 碰撞的实体
      Returns:
      false以拦截实体碰撞运动计算
    • attack

      public boolean attack(EntityDamageEvent source)
      Description copied from class: Entity
      当一个实体被攻击时(即接受一个实体伤害事件 这个事件可以是由其他实体攻击导致,也可能是自然伤害)调用.

      Called when an entity is attacked (i.e. receives an entity damage event. This event can be caused by an attack by another entity, or it can be a natural damage).

      Overrides:
      attack in class EntityMob
      Parameters:
      source - 记录伤害源的事件
      Record the event of the source of the attack
      Returns:
      是否攻击成功
      Whether the attack was successful
    • addEntityAngerValue

      public void addEntityAngerValue(Entity entity, int addition)
    • isValidAngerEntity

      public boolean isValidAngerEntity(Entity entity)
    • isValidAngerEntity

      public boolean isValidAngerEntity(Entity entity, boolean sniff)
    • isInSniffRange

      public boolean isInSniffRange(Entity entity)
    • isInRangedAttackRange

      public boolean isInRangedAttackRange(Entity entity)
    • isInAngerRange

      public boolean isInAngerRange(Entity entity)
    • calHeartBeatDelay

      public int calHeartBeatDelay()
    • setOnFire

      public void setOnFire(int seconds)
      Overrides:
      setOnFire in class EntityMob