Class EntityHuman

All Implemented Interfaces:
EntityAgeable, EntityDamageable, EntityNameable, IHuman, InventoryHolder, Metadatable, Cloneable
Direct Known Subclasses:
Player

public class EntityHuman extends EntityHumanType
Author:
MagicDroidX (Nukkit Project)
  • Field Details

    • uuid

      protected UUID uuid
    • rawUUID

      protected byte[] rawUUID
    • skin

      protected Skin skin
  • Constructor Details

  • Method Details

    • getWidth

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

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

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

      entity Height

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

      @Since("1.5.1.0-PN") @PowerNukkitOnly public float getSwimmingHeight()
      Overrides:
      getSwimmingHeight in class Entity
    • getEyeHeight

      public float getEyeHeight()
      Overrides:
      getEyeHeight in class Entity
    • getBaseOffset

      protected float getBaseOffset()
      偏移客户端传输玩家位置的y轴误差
      Overrides:
      getBaseOffset in class Entity
      Returns:
      the base offset
    • 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
    • getSkin

      public Skin getSkin()
    • setSkin

      public void setSkin(Skin skin)
    • getUniqueId

      public UUID getUniqueId()
      Specified by:
      getUniqueId in interface IHuman
      Overrides:
      getUniqueId in class Entity
    • setUniqueId

      public void setUniqueId(UUID uuid)
    • setRawUniqueId

      public void setRawUniqueId(byte[] rawUUID)
    • getRawUniqueId

      public byte[] getRawUniqueId()
    • initEntity

      protected 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 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
    • getName

      public String getName()
      Description copied from class: Entity
      The current name used by this entity in the name tag, or the static name if the entity don't have nametag.
      Overrides:
      getName in class Entity
    • saveNBT

      public void saveNBT()
      Overrides:
      saveNBT in class EntityLiving
    • entityBaseTick

      public boolean entityBaseTick()
      Overrides:
      entityBaseTick in class EntityLiving
    • entityBaseTick

      public boolean entityBaseTick(int tickDiff)
      Overrides:
      entityBaseTick in class EntityLiving
    • addMovement

      public void addMovement(double x, double y, double z, double yaw, double pitch, double headYaw)
      Description copied from class: Entity
      增加运动 (仅发送数据包,如果需要请使用Entity.setMotion(cn.nukkit.math.Vector3))

      Add motion (just sending packet will not make the entity actually move, use Entity.setMotion(cn.nukkit.math.Vector3) if needed)

      Overrides:
      addMovement in class Entity
      Parameters:
      x - x
      y - y
      z - z
      yaw - 左右旋转
      pitch - 上下旋转
      headYaw - headYaw
    • 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
    • despawnFrom

      public void despawnFrom(Player player)
      Overrides:
      despawnFrom in class Entity
    • close

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

      @PowerNukkitOnly protected void onBlock(Entity entity, EntityDamageEvent event, boolean animate)
      Overrides:
      onBlock in class EntityLiving