Class EntityHorse

All Implemented Interfaces:
EntityControlUtils, LogicalUtils, EntityAgeable, EntityAsyncPrepare, EntityComponent, EntityDamageable, EntityMarkVariant, EntityNameable, EntityOwnable, EntityRideable, EntityVariant, EntityWalkable, InventoryHolder, Metadatable, Cloneable

Author:
PikyCZ
  • Field Details

  • Constructor Details

  • Method Details

    • 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
    • getWidth

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

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

      entity Height

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

      public void initEntity()
      Description copied from class: Entity
      实体初始化顺序,先初始化Entity类字段->Entity构造函数->进入init方法->调用initEntity方法->子类字段初始化->子类构造函数

      用于初始化实体的NBT和实体字段的方法

      Entity initialization order, first initialize the Entity class field->Entity constructor->Enter the init method->Call the init Entity method-> subclass field initialization-> subclass constructor

      The method used to initialize the NBT and entity fields of the entity

      Overrides:
      initEntity in class EntityAnimal
    • saveNBT

      public void saveNBT()
      Overrides:
      saveNBT in class EntityAnimal
    • setHealth

      public void setHealth(float health)
      Overrides:
      setHealth in class EntityLiving
    • setMaxHealth

      public void setMaxHealth(int maxHealth)
      Overrides:
      setMaxHealth in class Entity
    • getDrops

      public Item[] getDrops()
      Overrides:
      getDrops in class EntityLiving
    • getOriginalName

      @PowerNukkitOnly @Since("1.5.1.0-PN") public String getOriginalName()
      Description copied from class: Entity
      The name that English name of the type of this entity.
      Overrides:
      getOriginalName in class Entity
    • getAllVariant

      public int[] getAllVariant()
      Description copied from interface: EntityVariant
      定义全部可能的变种
      Specified by:
      getAllVariant in interface EntityVariant
    • getAllMarkVariant

      public int[] getAllMarkVariant()
      Description copied from interface: EntityMarkVariant
      定义全部可能的变种
      Specified by:
      getAllMarkVariant in interface EntityMarkVariant
    • getJumping

      public AtomicBoolean getJumping()
    • requireBehaviorGroup

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

      public void asyncPrepare(int currentTick)
      Description copied from interface: EntityAsyncPrepare
      该方法将被并行执行,每一刻都执行一次,并保证每一次onUpdate之前都执行完毕
      Specified by:
      asyncPrepare in interface EntityAsyncPrepare
      Overrides:
      asyncPrepare in class EntityIntelligent
      Parameters:
      currentTick - 当前游戏刻
    • fall

      public void fall(float fallDistance)
      Overrides:
      fall in class Entity
    • onUpdate

      public boolean onUpdate(int currentTick)
      Overrides:
      onUpdate in class EntityPhysical
    • canCollideWith

      public boolean canCollideWith(Entity entity)
      Overrides:
      canCollideWith in class Entity
    • onPlayerInput

      public void onPlayerInput(Location clientLoc)
    • getOwnerName

      @Nullable public String getOwnerName()
      Specified by:
      getOwnerName in interface EntityOwnable
    • onInteract

      public boolean onInteract(Player player, Item item, Vector3 clickedPos)
      Specified by:
      onInteract in interface EntityNameable
      Overrides:
      onInteract in class EntityAnimal
    • mountEntity

      public boolean mountEntity(Entity entity)
      Description copied from interface: EntityRideable
      Mount or Dismounts an Entity from a rideable entity
      Specified by:
      mountEntity in interface EntityRideable
      Overrides:
      mountEntity in class Entity
      Parameters:
      entity - The target Entity
      Returns:
      true if the mounting successful
    • dismountEntity

      public boolean dismountEntity(Entity entity)
      Specified by:
      dismountEntity in interface EntityRideable
      Overrides:
      dismountEntity in class Entity
    • getMountedOffset

      public Vector3f getMountedOffset(Entity entity)
      Overrides:
      getMountedOffset in class Entity
    • getInventory

      public HorseInventory getInventory()
      Specified by:
      getInventory in interface InventoryHolder
    • getRider

      @Nullable public Entity getRider()
    • getClientMaxJumpHeight

      public float getClientMaxJumpHeight()
    • setSaddle

      public void setSaddle(Item item)
      See Also:
    • setHorseArmor

      public void setHorseArmor(Item item)
      See Also:
    • getSaddle

      public Item getSaddle()
      See Also:
    • getHorseArmor

      public Item getHorseArmor()
      See Also:
    • playTameFailAnimation

      public void playTameFailAnimation()
      播放驯服失败的动画

      Play an animation of a failed tamer

    • stopTameFailAnimation

      public void stopTameFailAnimation()
      停止播放驯服失败的动画

      Stop playing the animation that failed to tame

    • spawnTo

      public void spawnTo(Player player)
      Description copied from class: Entity
      将这个实体在客户端生成,让该玩家可以看到它

      Spawn this entity on the client side so that the player can see it

      Overrides:
      spawnTo in class Entity
      Parameters:
      player - the player
    • generateRandomMaxHealth

      protected float generateRandomMaxHealth()
    • generateRandomJumpStrength

      protected float generateRandomJumpStrength()
    • generateRandomSpeed

      protected float generateRandomSpeed()
    • randomizeAttributes

      protected Attribute[] randomizeAttributes()
    • createAddEntityPacket

      protected DataPacket createAddEntityPacket()
      Overrides:
      createAddEntityPacket in class Entity