枚举 EntityType

java.lang.Object
java.lang.Enum<EntityType>
org.bukkit.entity.EntityType
所有已实现的接口:
Serializable, Comparable<EntityType>, Constable, Keyed

public enum EntityType extends Enum<EntityType> implements Keyed
  • 枚举常量详细资料

  • 方法详细资料

    • values

      public static EntityType[] values()
      按照声明该枚举类型的常量的顺序, 返回一个包含这些常量的数组。
      返回:
      按照声明该枚举类型的常量的顺序返回的包含这些常量的数组
    • valueOf

      public static EntityType valueOf(String name)
      返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)
      参数:
      name - 要返回的枚举常量的名称。
      返回:
      返回带有指定名称的枚举常量
      抛出:
      IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量
      NullPointerException - 如果参数为空值
    • getName

      @Deprecated public String getName()
      已过时。
      不安全的参数
      获取实体种类名.

      原文:Gets the entity type name.

      返回:
      the entity type's name
    • getKey

      public NamespacedKey getKey()
      从接口复制的说明: Keyed
      返回用于此对象的命名空间标识符.

      原文:Return the namespaced identifier for this object.

      指定者:
      getKey 在接口中 Keyed
      返回:
      标识此对象的 key
    • getEntityClass

      public Class<? extends Entity> getEntityClass()
    • getTypeId

      @Deprecated public short getTypeId()
      已过时。
      不安全的参数
      获取实体种类id.

      原文:Gets the entity type id.

      返回:
      种类id
    • fromName

      @Deprecated public static EntityType fromName(String name)
      已过时。
      不安全的参数
      以给定名称获取对应实体种类.

      原文:Gets an entity type from its name.

      参数:
      name - 实体种类名
      返回:
      匹配的实体种类, 找不到为null
    • fromId

      @Deprecated public static EntityType fromId(int id)
      已过时。
      不安全的参数
      以给定id获取实体种类.

      原文:Gets an entity from its id.

      参数:
      id - 实体种类id
      返回:
      匹配的实体种类或null
    • isSpawnable

      public boolean isSpawnable()
      Some entities cannot be spawned using RegionAccessor.spawnEntity(Location, EntityType) or RegionAccessor.spawn(Location, Class), usually because they require additional information in order to spawn.
      返回:
      False if the entity type cannot be spawned
    • isAlive

      public boolean isAlive()