程序包 org.bukkit.event.entity

# 枚举 CreatureSpawnEvent.SpawnReason

java.lang.Object
java.lang.Enum<CreatureSpawnEvent.SpawnReason>
org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason

所有已实现的接口:
  `Serializable`, `Comparable<CreatureSpawnEvent.SpawnReason>`, `Constable`

封闭类:
  CreatureSpawnEvent

public static enum CreatureSpawnEvent.SpawnReason extends Enum<CreatureSpawnEvent.SpawnReason>
生成原因的枚举类.

- ## 嵌套类概要

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

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

- ## 枚举常量概要

  枚举常量
  枚举常量
  说明
  `BEEHIVE`
  When a bee is released from a beehive/bee nest
  `BREEDING`
  When an entity breeds to create a child, this also include Shulker and Allay
  `BUILD_IRONGOLEM`
  当一个铁傀儡被建造时
  `BUILD_SNOWMAN`
  当雪人被建造时
  `BUILD_WITHER`
  当一个凋零被建造时
  `CHUNK_GEN`
  已过时。
  不再调用, 区块与已经存在的实体一同生成.
  `COMMAND`
  When a creature is spawned by the "/summon" command
  `CURED`
  当村民从僵尸状态痊愈时
  `CUSTOM`
  当生物被插件生成时
  `DEFAULT`
  实体由于其他原因而生成
  `DISPENSE_EGG`
  当生物由于投掷器丢出鸡蛋而生成时
  `DROWNED`
  当一个实体溺亡而生成时
  `DUPLICATION`
  When an Allay duplicate itself
  `EGG`
  当生物由于蛋生成时 (不是刷怪蛋,是普通的鸡蛋)
  `ENCHANTMENT`
  When a creature is spawned by an enchantment
  `ENDER_PEARL`
  由于末影珍珠的使用而生成.
  `EXPLOSION`
  由于苦力怕等发生爆炸产生效果云时/When eg an effect cloud is spawned as a result of a creeper exploding
  `FROZEN`
  When an entity is shaking in Powder Snow and a new entity spawns.
  `INFECTION`
  当一个僵尸感染一个村民时
  `JOCKEY`
  当实体因为乘骑而被生成时 (大多是蜘蛛骑士)
  `LIGHTNING`
  当生物由于闪电而生成时
  `METAMORPHOSIS`
  When a tadpole converts to a frog
  `MOUNT`
  当一个实体成为其他实体坐骑时 (大多数时是鸡骑士)
  `NATURAL`
  自然生成
  `NETHER_PORTAL`
  当生物由于地狱传送门而生成时
  `OCELOT_BABY`
  当豹猫为了照顾自己的孩子而出生时
  `PATROL`
  When an entity is spawned as part of a patrol
  `PIGLIN_ZOMBIFIED`
  When a piglin is converted to a zombified piglin.
  `POTION_EFFECT`
  When a creature is spawned by a potion effect, for example: `PotionType.OOZING`, `PotionType.INFESTED`
  `RAID`
  When an entity is spawned as part of a raid
  `REINFORCEMENTS`
  当一个实体请求支援时
  `SHEARED`
  When an cow is spawned by shearing a mushroom cow
  `SHOULDER_ENTITY`
  When an entity is spawned as a result of the entity it is being perched on jumping or being damaged
  `SILVERFISH_BLOCK`
  当一条蠹虫从方块中生成时
  `SLIME_SPLIT`
  当史莱姆分裂时
  `SPAWNER`
  当生物由于刷怪箱生成时
  `SPAWNER_EGG`
  当生物由于刷怪蛋生成时
  `SPELL`
  When an entity is created by a cast spell.
  `TRAP`
  当实体作为陷阱陷害玩家时
  `TRIAL_SPAWNER`
  When a creature spawns from a trial spawner
  `VILLAGE_DEFENSE`
  当村庄生成保卫的铁傀儡时
  `VILLAGE_INVASION`
  当一个僵尸进攻村庄而生成时.

- ## 方法概要

  修饰符和类型
  方法
  说明
  `static CreatureSpawnEvent.SpawnReason`
  `valueOf(String name)`
  返回带有指定名称的该类型的枚举常量。
  `static CreatureSpawnEvent.SpawnReason[]`
  `values()`
  按照声明该枚举类型的常量的顺序, 返回一个包含这些常量的数组。

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

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

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

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

- ## 枚举常量详细资料

  - ### NATURAL

    public static final CreatureSpawnEvent.SpawnReason NATURAL
    自然生成

  - ### JOCKEY

    public static final CreatureSpawnEvent.SpawnReason JOCKEY
    当实体因为乘骑而被生成时 (大多是蜘蛛骑士)

  - ### CHUNK_GEN

    @Deprecated public static final CreatureSpawnEvent.SpawnReason CHUNK_GEN
    已过时。
    不再调用, 区块与已经存在的实体一同生成. 请考虑使用`ChunkLoadEvent.isNewChunk()` 和 `Chunk.getEntities()` 以达到类似效果
    当区块产生而生成生物时

  - ### SPAWNER

    public static final CreatureSpawnEvent.SpawnReason SPAWNER
    当生物由于刷怪箱生成时

  - ### TRIAL_SPAWNER

    public static final CreatureSpawnEvent.SpawnReason TRIAL_SPAWNER
    When a creature spawns from a trial spawner

  - ### EGG

    public static final CreatureSpawnEvent.SpawnReason EGG
    当生物由于蛋生成时 (不是刷怪蛋,是普通的鸡蛋)

  - ### SPAWNER_EGG

    public static final CreatureSpawnEvent.SpawnReason SPAWNER_EGG
    当生物由于刷怪蛋生成时

  - ### LIGHTNING

    public static final CreatureSpawnEvent.SpawnReason LIGHTNING
    当生物由于闪电而生成时

  - ### BUILD_SNOWMAN

    public static final CreatureSpawnEvent.SpawnReason BUILD_SNOWMAN
    当雪人被建造时

  - ### BUILD_IRONGOLEM

    public static final CreatureSpawnEvent.SpawnReason BUILD_IRONGOLEM
    当一个铁傀儡被建造时

  - ### BUILD_WITHER

    public static final CreatureSpawnEvent.SpawnReason BUILD_WITHER
    当一个凋零被建造时

  - ### VILLAGE_DEFENSE

    public static final CreatureSpawnEvent.SpawnReason VILLAGE_DEFENSE
    当村庄生成保卫的铁傀儡时

  - ### VILLAGE_INVASION

    public static final CreatureSpawnEvent.SpawnReason VILLAGE_INVASION
    当一个僵尸进攻村庄而生成时.

  - ### BREEDING

    public static final CreatureSpawnEvent.SpawnReason BREEDING
    When an entity breeds to create a child, this also include Shulker and Allay

  - ### SLIME_SPLIT

    public static final CreatureSpawnEvent.SpawnReason SLIME_SPLIT
    当史莱姆分裂时

  - ### REINFORCEMENTS

    public static final CreatureSpawnEvent.SpawnReason REINFORCEMENTS
    当一个实体请求支援时

  - ### NETHER_PORTAL

    public static final CreatureSpawnEvent.SpawnReason NETHER_PORTAL
    当生物由于地狱传送门而生成时

  - ### DISPENSE_EGG

    public static final CreatureSpawnEvent.SpawnReason DISPENSE_EGG
    当生物由于投掷器丢出鸡蛋而生成时

  - ### INFECTION

    public static final CreatureSpawnEvent.SpawnReason INFECTION
    当一个僵尸感染一个村民时

  - ### CURED

    public static final CreatureSpawnEvent.SpawnReason CURED
    当村民从僵尸状态痊愈时

  - ### OCELOT_BABY

    public static final CreatureSpawnEvent.SpawnReason OCELOT_BABY
    当豹猫为了照顾自己的孩子而出生时

  - ### SILVERFISH_BLOCK

    public static final CreatureSpawnEvent.SpawnReason SILVERFISH_BLOCK
    当一条蠹虫从方块中生成时

  - ### MOUNT

    public static final CreatureSpawnEvent.SpawnReason MOUNT
    当一个实体成为其他实体坐骑时 (大多数时是鸡骑士)

  - ### TRAP

    public static final CreatureSpawnEvent.SpawnReason TRAP
    当实体作为陷阱陷害玩家时

  - ### ENDER_PEARL

    public static final CreatureSpawnEvent.SpawnReason ENDER_PEARL
    由于末影珍珠的使用而生成.

  - ### SHOULDER_ENTITY

    public static final CreatureSpawnEvent.SpawnReason SHOULDER_ENTITY
    When an entity is spawned as a result of the entity it is being perched on jumping or being damaged

  - ### DROWNED

    public static final CreatureSpawnEvent.SpawnReason DROWNED
    当一个实体溺亡而生成时

  - ### SHEARED

    public static final CreatureSpawnEvent.SpawnReason SHEARED
    When an cow is spawned by shearing a mushroom cow

  - ### EXPLOSION

    public static final CreatureSpawnEvent.SpawnReason EXPLOSION
    由于苦力怕等发生爆炸产生效果云时/When eg an effect cloud is spawned as a result of a creeper exploding

  - ### RAID

    public static final CreatureSpawnEvent.SpawnReason RAID
    When an entity is spawned as part of a raid

  - ### PATROL

    public static final CreatureSpawnEvent.SpawnReason PATROL
    When an entity is spawned as part of a patrol

  - ### BEEHIVE

    public static final CreatureSpawnEvent.SpawnReason BEEHIVE
    When a bee is released from a beehive/bee nest

  - ### PIGLIN_ZOMBIFIED

    public static final CreatureSpawnEvent.SpawnReason PIGLIN_ZOMBIFIED
    When a piglin is converted to a zombified piglin.

  - ### SPELL

    public static final CreatureSpawnEvent.SpawnReason SPELL
    When an entity is created by a cast spell.

  - ### FROZEN

    public static final CreatureSpawnEvent.SpawnReason FROZEN
    When an entity is shaking in Powder Snow and a new entity spawns.

  - ### METAMORPHOSIS

    public static final CreatureSpawnEvent.SpawnReason METAMORPHOSIS
    When a tadpole converts to a frog

  - ### DUPLICATION

    public static final CreatureSpawnEvent.SpawnReason DUPLICATION
    When an Allay duplicate itself

  - ### COMMAND

    public static final CreatureSpawnEvent.SpawnReason COMMAND
    When a creature is spawned by the "/summon" command

  - ### ENCHANTMENT

    public static final CreatureSpawnEvent.SpawnReason ENCHANTMENT
    When a creature is spawned by an enchantment

  - ### POTION_EFFECT

    public static final CreatureSpawnEvent.SpawnReason POTION_EFFECT
    When a creature is spawned by a potion effect, for example: `PotionType.OOZING`, `PotionType.INFESTED`

  - ### CUSTOM

    public static final CreatureSpawnEvent.SpawnReason CUSTOM
    当生物被插件生成时

  - ### DEFAULT

    public static final CreatureSpawnEvent.SpawnReason DEFAULT
    实体由于其他原因而生成

- ## 方法详细资料

  - ### values

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

  - ### valueOf

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