程序包 org.bukkit.entity

# 枚举 EntityType

java.lang.Object
java.lang.Enum<EntityType>
org.bukkit.entity.EntityType

所有已实现的接口:
  `Serializable`, `Comparable<EntityType>`, `Constable`, `Keyed`, `Translatable`

public enum EntityType extends Enum<EntityType> implements Keyed, Translatable

- ## 嵌套类概要

  ## 从类继承的嵌套类/接口 java.lang.Enum

  `Enum.EnumDesc<E extends Enum<E>>`

- ## 枚举常量概要

  枚举常量
  枚举常量
  说明
  `ALLAY`
  `AREA_EFFECT_CLOUD`
  `ARMADILLO`
  `ARMOR_STAND`
  Mechanical entity with an inventory for placing weapons / armor into.
  `ARROW`
  An arrow projectile; may get stuck in the ground.
  `AXOLOTL`
  `BAT`
  `BEE`
  `BLAZE`
  `BLOCK_DISPLAY`
  `BOAT`
  A placed boat.
  `BOGGED`
  `BREEZE`
  `BREEZE_WIND_CHARGE`
  `CAMEL`
  `CAT`
  `CAVE_SPIDER`
  `CHEST_BOAT`
  `CHEST_MINECART`
  `CHICKEN`
  `COD`
  `COMMAND_BLOCK_MINECART`
  `COW`
  `CREEPER`
  `DOLPHIN`
  `DONKEY`
  `DRAGON_FIREBALL`
  Like `FIREBALL` but with added effects.
  `DROWNED`
  `EGG`
  A flying chicken egg.
  `ELDER_GUARDIAN`
  `END_CRYSTAL`
  `ENDER_DRAGON`
  `ENDER_PEARL`
  A flying ender pearl.
  `ENDERMAN`
  `ENDERMITE`
  `EVOKER`
  `EVOKER_FANGS`
  `EXPERIENCE_BOTTLE`
  A flying experience bottle.
  `EXPERIENCE_ORB`
  An experience orb.
  `EYE_OF_ENDER`
  An ender eye signal.
  `FALLING_BLOCK`
  A block that is going to or is about to fall.
  `FIREBALL`
  A flying large fireball, as thrown by a Ghast for example.
  `FIREWORK_ROCKET`
  Internal representation of a Firework once it has been launched.
  `FISHING_BOBBER`
  A fishing line and bobber.
  `FOX`
  `FROG`
  `FURNACE_MINECART`
  `GHAST`
  `GIANT`
  `GLOW_ITEM_FRAME`
  `GLOW_SQUID`
  `GOAT`
  `GUARDIAN`
  `HOGLIN`
  `HOPPER_MINECART`
  `HORSE`
  `HUSK`
  `ILLUSIONER`
  `INTERACTION`
  `IRON_GOLEM`
  `ITEM`
  An item resting on the ground.
  `ITEM_DISPLAY`
  `ITEM_FRAME`
  An item frame on a wall.
  `LEASH_KNOT`
  A leash attached to a fencepost.
  `LIGHTNING_BOLT`
  A bolt of lightning.
  `LLAMA`
  `LLAMA_SPIT`
  `MAGMA_CUBE`
  `MARKER`
  `MINECART`
  `MOOSHROOM`
  `MULE`
  `OCELOT`
  `OMINOUS_ITEM_SPAWNER`
  `PAINTING`
  A painting on a wall.
  `PANDA`
  `PARROT`
  `PHANTOM`
  `PIG`
  `PIGLIN`
  `PIGLIN_BRUTE`
  `PILLAGER`
  `PLAYER`
  `POLAR_BEAR`
  `POTION`
  A flying splash potion.
  `PUFFERFISH`
  `RABBIT`
  `RAVAGER`
  `SALMON`
  `SHEEP`
  `SHULKER`
  `SHULKER_BULLET`
  Bullet fired by `SHULKER`.
  `SILVERFISH`
  `SKELETON`
  `SKELETON_HORSE`
  `SLIME`
  `SMALL_FIREBALL`
  A flying small fireball, such as thrown by a Blaze or player.
  `SNIFFER`
  `SNOW_GOLEM`
  `SNOWBALL`
  A flying snowball.
  `SPAWNER_MINECART`
  `SPECTRAL_ARROW`
  Like `ARROW` but causes the `PotionEffectType.GLOWING` effect on all team members.
  `SPIDER`
  `SQUID`
  `STRAY`
  `STRIDER`
  `TADPOLE`
  `TEXT_DISPLAY`
  `TNT`
  Primed TNT that is about to explode.
  `TNT_MINECART`
  `TRADER_LLAMA`
  `TRIDENT`
  `TROPICAL_FISH`
  `TURTLE`
  `UNKNOWN`
  An unknown entity without an Entity Class
  `VEX`
  `VILLAGER`
  `VINDICATOR`
  `WANDERING_TRADER`
  `WARDEN`
  `WIND_CHARGE`
  `WITCH`
  `WITHER`
  `WITHER_SKELETON`
  `WITHER_SKULL`
  A flying wither skull projectile.
  `WOLF`
  `ZOGLIN`
  `ZOMBIE`
  `ZOMBIE_HORSE`
  `ZOMBIE_VILLAGER`
  `ZOMBIFIED_PIGLIN`

- ## 方法概要

  修饰符和类型
  方法
  说明
  `static @Nullable EntityType`
  `fromId(int id)`
  已过时。
  不安全的参数
  `static @Nullable EntityType`
  `fromName(@Nullable String name)`
  已过时。
  不安全的参数
  `@Nullable Class<? extends Entity>`
  `getEntityClass()`
  `@NotNull NamespacedKey`
  `getKey()`
  返回用于此对象的命名空间标识符.
  `@Nullable String`
  `getName()`
  已过时。
  不安全的参数
  `@NotNull String`
  `getTranslationKey()`
  Get the translation key, suitable for use in a translation component.
  `short`
  `getTypeId()`
  已过时。
  不安全的参数
  `boolean`
  `isAlive()`
  `boolean`
  `isEnabledByFeature(@NotNull World world)`
  Gets if this EntityType is enabled by feature in a world.
  `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.
  `static EntityType`
  `valueOf(String name)`
  返回带有指定名称的该类型的枚举常量。
  `static EntityType[]`
  `values()`
  按照声明该枚举类型的常量的顺序, 返回一个包含这些常量的数组。

  ### 从类继承的方法 java.lang.Enum

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

  ### 从类继承的方法 java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## 枚举常量详细资料

  - ### ITEM

    public static final EntityType ITEM
    An item resting on the ground.

    Spawn with `World.dropItem(Location, ItemStack)` or `World.dropItemNaturally(Location, ItemStack)`

  - ### EXPERIENCE_ORB

    public static final EntityType EXPERIENCE_ORB
    An experience orb.

  - ### AREA_EFFECT_CLOUD

    public static final EntityType AREA_EFFECT_CLOUD
    另请参阅:
      - `AreaEffectCloud`

  - ### ELDER_GUARDIAN

    public static final EntityType ELDER_GUARDIAN
    另请参阅:
      - `ElderGuardian`

  - ### WITHER_SKELETON

    public static final EntityType WITHER_SKELETON
    另请参阅:
      - `WitherSkeleton`

  - ### STRAY

    public static final EntityType STRAY
    另请参阅:
      - `Stray`

  - ### EGG

    public static final EntityType EGG
    A flying chicken egg.

  - ### LEASH_KNOT

    public static final EntityType LEASH_KNOT
    A leash attached to a fencepost.

  - ### PAINTING

    public static final EntityType PAINTING
    A painting on a wall.

  - ### ARROW

    public static final EntityType ARROW
    An arrow projectile; may get stuck in the ground.

  - ### SNOWBALL

    public static final EntityType SNOWBALL
    A flying snowball.

  - ### FIREBALL

    public static final EntityType FIREBALL
    A flying large fireball, as thrown by a Ghast for example.

  - ### SMALL_FIREBALL

    public static final EntityType SMALL_FIREBALL
    A flying small fireball, such as thrown by a Blaze or player.

  - ### ENDER_PEARL

    public static final EntityType ENDER_PEARL
    A flying ender pearl.

  - ### EYE_OF_ENDER

    public static final EntityType EYE_OF_ENDER
    An ender eye signal.

  - ### POTION

    public static final EntityType POTION
    A flying splash potion.

  - ### EXPERIENCE_BOTTLE

    public static final EntityType EXPERIENCE_BOTTLE
    A flying experience bottle.

  - ### ITEM_FRAME

    public static final EntityType ITEM_FRAME
    An item frame on a wall.

  - ### WITHER_SKULL

    public static final EntityType WITHER_SKULL
    A flying wither skull projectile.

  - ### TNT

    public static final EntityType TNT
    Primed TNT that is about to explode.

  - ### FALLING_BLOCK

    public static final EntityType FALLING_BLOCK
    A block that is going to or is about to fall.

  - ### FIREWORK_ROCKET

    public static final EntityType FIREWORK_ROCKET
    Internal representation of a Firework once it has been launched.

  - ### HUSK

    public static final EntityType HUSK
    另请参阅:
      - `Husk`

  - ### SPECTRAL_ARROW

    public static final EntityType SPECTRAL_ARROW
    Like `ARROW` but causes the `PotionEffectType.GLOWING` effect on all team members.

  - ### SHULKER_BULLET

    public static final EntityType SHULKER_BULLET
    Bullet fired by `SHULKER`.

  - ### DRAGON_FIREBALL

    public static final EntityType DRAGON_FIREBALL
    Like `FIREBALL` but with added effects.

  - ### ZOMBIE_VILLAGER

    public static final EntityType ZOMBIE_VILLAGER
    另请参阅:
      - `ZombieVillager`

  - ### SKELETON_HORSE

    public static final EntityType SKELETON_HORSE
    另请参阅:
      - `SkeletonHorse`

  - ### ZOMBIE_HORSE

    public static final EntityType ZOMBIE_HORSE
    另请参阅:
      - `ZombieHorse`

  - ### ARMOR_STAND

    public static final EntityType ARMOR_STAND
    Mechanical entity with an inventory for placing weapons / armor into.

  - ### DONKEY

    public static final EntityType DONKEY
    另请参阅:
      - `Donkey`

  - ### MULE

    public static final EntityType MULE
    另请参阅:
      - `Mule`

  - ### EVOKER_FANGS

    public static final EntityType EVOKER_FANGS
    另请参阅:
      - `EvokerFangs`

  - ### EVOKER

    public static final EntityType EVOKER
    另请参阅:
      - `Evoker`

  - ### VEX

    public static final EntityType VEX
    另请参阅:
      - `Vex`

  - ### VINDICATOR

    public static final EntityType VINDICATOR
    另请参阅:
      - `Vindicator`

  - ### ILLUSIONER

    public static final EntityType ILLUSIONER
    另请参阅:
      - `Illusioner`

  - ### COMMAND_BLOCK_MINECART

    public static final EntityType COMMAND_BLOCK_MINECART
    另请参阅:
      - `CommandMinecart`

  - ### BOAT

    public static final EntityType BOAT
    A placed boat.

  - ### MINECART

    public static final EntityType MINECART
    另请参阅:
      - `RideableMinecart`

  - ### CHEST_MINECART

    public static final EntityType CHEST_MINECART
    另请参阅:
      - `StorageMinecart`

  - ### FURNACE_MINECART

    public static final EntityType FURNACE_MINECART
    另请参阅:
      - `PoweredMinecart`

  - ### TNT_MINECART

    public static final EntityType TNT_MINECART
    另请参阅:
      - `ExplosiveMinecart`

  - ### HOPPER_MINECART

    public static final EntityType HOPPER_MINECART
    另请参阅:
      - `HopperMinecart`

  - ### SPAWNER_MINECART

    public static final EntityType SPAWNER_MINECART
    另请参阅:
      - `SpawnerMinecart`

  - ### CREEPER

    public static final EntityType CREEPER

  - ### SKELETON

    public static final EntityType SKELETON

  - ### SPIDER

    public static final EntityType SPIDER

  - ### GIANT

    public static final EntityType GIANT

  - ### ZOMBIE

    public static final EntityType ZOMBIE

  - ### SLIME

    public static final EntityType SLIME

  - ### GHAST

    public static final EntityType GHAST

  - ### ZOMBIFIED_PIGLIN

    public static final EntityType ZOMBIFIED_PIGLIN

  - ### ENDERMAN

    public static final EntityType ENDERMAN

  - ### CAVE_SPIDER

    public static final EntityType CAVE_SPIDER

  - ### SILVERFISH

    public static final EntityType SILVERFISH

  - ### BLAZE

    public static final EntityType BLAZE

  - ### MAGMA_CUBE

    public static final EntityType MAGMA_CUBE

  - ### ENDER_DRAGON

    public static final EntityType ENDER_DRAGON

  - ### WITHER

    public static final EntityType WITHER

  - ### BAT

    public static final EntityType BAT

  - ### WITCH

    public static final EntityType WITCH

  - ### ENDERMITE

    public static final EntityType ENDERMITE

  - ### GUARDIAN

    public static final EntityType GUARDIAN

  - ### SHULKER

    public static final EntityType SHULKER

  - ### PIG

    public static final EntityType PIG

  - ### SHEEP

    public static final EntityType SHEEP

  - ### COW

    public static final EntityType COW

  - ### CHICKEN

    public static final EntityType CHICKEN

  - ### SQUID

    public static final EntityType SQUID

  - ### WOLF

    public static final EntityType WOLF

  - ### MOOSHROOM

    public static final EntityType MOOSHROOM

  - ### SNOW_GOLEM

    public static final EntityType SNOW_GOLEM

  - ### OCELOT

    public static final EntityType OCELOT

  - ### IRON_GOLEM

    public static final EntityType IRON_GOLEM

  - ### HORSE

    public static final EntityType HORSE

  - ### RABBIT

    public static final EntityType RABBIT

  - ### POLAR_BEAR

    public static final EntityType POLAR_BEAR

  - ### LLAMA

    public static final EntityType LLAMA

  - ### LLAMA_SPIT

    public static final EntityType LLAMA_SPIT

  - ### PARROT

    public static final EntityType PARROT

  - ### VILLAGER

    public static final EntityType VILLAGER

  - ### END_CRYSTAL

    public static final EntityType END_CRYSTAL

  - ### TURTLE

    public static final EntityType TURTLE

  - ### PHANTOM

    public static final EntityType PHANTOM

  - ### TRIDENT

    public static final EntityType TRIDENT

  - ### COD

    public static final EntityType COD

  - ### SALMON

    public static final EntityType SALMON

  - ### PUFFERFISH

    public static final EntityType PUFFERFISH

  - ### TROPICAL_FISH

    public static final EntityType TROPICAL_FISH

  - ### DROWNED

    public static final EntityType DROWNED

  - ### DOLPHIN

    public static final EntityType DOLPHIN

  - ### CAT

    public static final EntityType CAT

  - ### PANDA

    public static final EntityType PANDA

  - ### PILLAGER

    public static final EntityType PILLAGER

  - ### RAVAGER

    public static final EntityType RAVAGER

  - ### TRADER_LLAMA

    public static final EntityType TRADER_LLAMA

  - ### WANDERING_TRADER

    public static final EntityType WANDERING_TRADER

  - ### FOX

    public static final EntityType FOX

  - ### BEE

    public static final EntityType BEE

  - ### HOGLIN

    public static final EntityType HOGLIN

  - ### PIGLIN

    public static final EntityType PIGLIN

  - ### STRIDER

    public static final EntityType STRIDER

  - ### ZOGLIN

    public static final EntityType ZOGLIN

  - ### PIGLIN_BRUTE

    public static final EntityType PIGLIN_BRUTE

  - ### AXOLOTL

    public static final EntityType AXOLOTL

  - ### GLOW_ITEM_FRAME

    public static final EntityType GLOW_ITEM_FRAME

  - ### GLOW_SQUID

    public static final EntityType GLOW_SQUID

  - ### GOAT

    public static final EntityType GOAT

  - ### MARKER

    public static final EntityType MARKER

  - ### ALLAY

    public static final EntityType ALLAY

  - ### CHEST_BOAT

    public static final EntityType CHEST_BOAT

  - ### FROG

    public static final EntityType FROG

  - ### TADPOLE

    public static final EntityType TADPOLE

  - ### WARDEN

    public static final EntityType WARDEN

  - ### CAMEL

    public static final EntityType CAMEL

  - ### BLOCK_DISPLAY

    public static final EntityType BLOCK_DISPLAY

  - ### INTERACTION

    public static final EntityType INTERACTION

  - ### ITEM_DISPLAY

    public static final EntityType ITEM_DISPLAY

  - ### SNIFFER

    public static final EntityType SNIFFER

  - ### TEXT_DISPLAY

    public static final EntityType TEXT_DISPLAY

  - ### BREEZE

    public static final EntityType BREEZE

  - ### WIND_CHARGE

    public static final EntityType WIND_CHARGE

  - ### BREEZE_WIND_CHARGE

    public static final EntityType BREEZE_WIND_CHARGE

  - ### ARMADILLO

    public static final EntityType ARMADILLO

  - ### BOGGED

    public static final EntityType BOGGED

  - ### OMINOUS_ITEM_SPAWNER

    public static final EntityType OMINOUS_ITEM_SPAWNER

  - ### FISHING_BOBBER

    public static final EntityType FISHING_BOBBER
    A fishing line and bobber.

  - ### LIGHTNING_BOLT

    public static final EntityType LIGHTNING_BOLT
    A bolt of lightning.

    Spawn with `World.strikeLightning(Location)`.

  - ### PLAYER

    public static final EntityType PLAYER

  - ### UNKNOWN

    public static final EntityType UNKNOWN
    An unknown entity without an Entity Class

- ## 方法详细资料

  - ### values

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

  - ### valueOf

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

  - ### getName

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

    原文:Gets the entity type name.

    返回:
      the entity type's name

  - ### getKey

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

    原文:Return the namespaced identifier for this object.

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

  - ### getEntityClass

    @Nullable public @Nullable Class<? extends Entity> getEntityClass()

  - ### getTypeId

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

    原文:Gets the entity type id.

    返回:
      种类id

  - ### fromName

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

    原文:Gets an entity type from its name.

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

  - ### fromId

    @Deprecated @Nullable public static @Nullable 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()

  - ### getTranslationKey

    @NotNull public @NotNull String getTranslationKey()
    从接口复制的说明: `Translatable`
    Get the translation key, suitable for use in a translation component.
    指定者:
      `getTranslationKey` 在接口中 `Translatable`
    返回:
      the translation key

  - ### isEnabledByFeature

    public boolean isEnabledByFeature(@NotNull @NotNull World world)
    Gets if this EntityType is enabled by feature in a world.
    参数:
      `world` - the world to check
    返回:
      true if this EntityType can be used to spawn an Entity for this World.