接口 Enderman

所有超级接口:
Attributable, CommandSender, Creature, Damageable, Enemy, Entity, LivingEntity, Lootable, Metadatable, Mob, Monster, Nameable, Permissible, PersistentDataHolder, ProjectileSource, ServerOperator

public interface Enderman extends Monster
代表末影人.
  • 方法详细资料

    • getCarriedMaterial

      @NotNull @NotNull MaterialData getCarriedMaterial()
      获取末影人手持的方块的id和数据.

      原文:Gets the id and data of the block that the Enderman is carrying.

      返回:
      包含方块的id和数据的MaterialData
    • setCarriedMaterial

      void setCarriedMaterial(@NotNull @NotNull MaterialData material)
      设置末影人手持的方块的id和数据.

      原文:Sets the id and data of the block that the Enderman is carrying.

      参数:
      material - 要设置的手持方块的数据
    • getCarriedBlock

      @Nullable @Nullable BlockData getCarriedBlock()
      获取末影人手持的方块的方块数据对象.

      原文:Gets the data of the block that the Enderman is carrying.

      返回:
      包含该方块数据的BlockData对象, 如果没有手持方块返回null
    • setCarriedBlock

      void setCarriedBlock(@Nullable @Nullable BlockData blockData)
      设置末影人手持的方块的方块数据对象.

      原文:Sets the data of the block that the Enderman is carrying.

      参数:
      blockData - 为该方块设置的BlockData对象, 设为null移除末影人手持的方块
    • teleport

      boolean teleport()
      Randomly teleports the Enderman in a 64x64x64 block cuboid region.

      If the randomly selected point is in the ground, the point is moved 1 block down until air is found or until it goes under WorldInfo.getMinHeight().

      This method will return false if this Enderman is not alive, or if the teleport location was obstructed, or if the teleport location is in water.

      返回:
      true if the teleport succeeded.
    • teleportTowards

      boolean teleportTowards(@NotNull @NotNull Entity entity)
      Randomly teleports the Enderman towards the given entity.

      The point is selected by drawing a vector between this enderman and the given entity. That vector's length is set to 16 blocks. That point is then moved within a 8x8x8 cuboid region. If the randomly selected point is in the ground, the point is moved 1 block down until air is found or until it goes under WorldInfo.getMinHeight().

      This method will return false if this Enderman is not alive, or if the teleport location was obstructed, or if the teleport location is in water.

      参数:
      entity - The entity to teleport towards.
      返回:
      true if the teleport succeeded.