接口 BaseSpawner

所有已知子接口:
CreatureSpawner, Spawner, SpawnerMinecart, TrialSpawnerConfiguration

public interface BaseSpawner
代表一个基础实体刷怪笼。
可能是 SpawnerMinecart、CreatureSpawner 或 TrialSpawnerConfiguration。
  • 方法详细资料

    • getSpawnedType

      @Nullable @Nullable EntityType getSpawnedType()
      获取刷出的生物的类型.

      原文: Get the spawner's creature type.

      返回:
      生物类型, 如未设置返回 null
    • setSpawnedType

      void setSpawnedType(@Nullable @Nullable EntityType creatureType)
      设置刷怪笼的生物类型。
      这将覆盖任何通过 addPotentialSpawn(org.bukkit.entity.EntitySnapshot, int, org.bukkit.block.spawner.SpawnRule) 添加的实体。

      原文:Set the spawner's creature type.
      This will override any entities that have been added with addPotentialSpawn(org.bukkit.entity.EntitySnapshot, int, org.bukkit.block.spawner.SpawnRule)

      参数:
      creatureType - 生物类型,设为 null 以清除。
    • getDelay

      int getDelay()
      获取刷怪笼的刷怪延迟.
      延迟时间以tick为单位.

      原文: Get the spawner's delay.
      This is the delay, in ticks, until the spawner will spawn its next mob.

      返回:
      延迟.
    • setDelay

      void setDelay(int delay)
      设置刷怪笼刷怪延迟.

      原文:Set the spawner's delay.

      参数:
      delay - 延迟.
    • getRequiredPlayerRange

      int getRequiredPlayerRange()
      获取玩家使刷怪笼激活所需的最远距离.
      如果该值小于或等于0, 则此刷怪笼永远处于激活状态.
      默认值为 16.

      原文:Get the maximum distance a player can be in order for this spawner to be active.
      If this value is less than or equal to 0, this spawner is always active (given that there are players online).
      Default value is 16.

      返回:
      激活刷怪笼所需最远距离
    • setRequiredPlayerRange

      void setRequiredPlayerRange(int requiredPlayerRange)
      设置玩家使刷怪笼激活所需的最远距离.
      如果设置小于或等于0的值, 将使刷怪笼永远处于激活状态.

      原文:Set the maximum distance a player can be in order for this spawner to be active.
      Setting this value to less than or equal to 0 will make this spawner always active (given that there are players online).

      参数:
      requiredPlayerRange - 激活刷怪笼所需最远距离
    • getSpawnRange

      int getSpawnRange()
      获取刷怪笼刷怪区域的半径.
      这个区域形为正方形, 以刷怪笼所在地为中心, 向 x,z 轴方向延伸(不含刷怪笼本身).
      这个区域以刷怪笼的y轴(它的底部)为中心算起, 高2个方块, 这允许生物有足够空间在这个区域的顶部和底部平面下一格方块的区域内生成.
      默认值为 4.

      原文:Get the radius around which the spawner will attempt to spawn mobs in.
      This area is square, includes the block the spawner is in, and is centered on the spawner's x,z coordinates - not the spawner itself.
      It is 2 blocks high, centered on the spawner's y-coordinate (its bottom); thus allowing mobs to spawn as high as its top surface and as low as 1 block below its bottom surface.
      Default value is 4.

      返回:
      刷怪半径
    • setSpawnRange

      void setSpawnRange(int spawnRange)
      设置新的刷怪半径.

      原文:Set the new spawn range.

      参数:
      spawnRange - 半径
      另请参阅:
    • getSpawnedEntity

      @Nullable @Nullable EntitySnapshot getSpawnedEntity()
      获取将由此刷怪笼生成的 EntitySnapshot,如果未为此刷怪笼分配任何实体则返回 null。

      刷怪笼中所有适用的数据都将被复制,例如自定义名称、生命值和速度。

      原文:Gets the EntitySnapshot that will be spawned by this spawner or null if no entities have been assigned to this spawner.

      All applicable data from the spawner will be copied, such as custom name, health, and velocity.

      返回:
      实体快照,如果未为此刷怪笼分配任何实体则返回 null。
    • setSpawnedEntity

      void setSpawnedEntity(@Nullable @Nullable EntitySnapshot snapshot)
      设置将由此刷怪笼生成的实体。
      这将覆盖任何先前通过 addPotentialSpawn(org.bukkit.entity.EntitySnapshot, int, org.bukkit.block.spawner.SpawnRule) 添加的条目。

      快照中所有适用的数据都将被复制,例如自定义名称、生命值和速度。

      原文:Sets the entity that will be spawned by this spawner.
      This will override any previous entries that have been added with addPotentialSpawn(org.bukkit.entity.EntitySnapshot, int, org.bukkit.block.spawner.SpawnRule)

      All applicable data from the snapshot will be copied, such as custom name, health, and velocity.

      参数:
      snapshot - 实体快照,设为 null 以清除。
    • setSpawnedEntity

      void setSpawnedEntity(@NotNull @NotNull SpawnerEntry spawnerEntry)
      设置将由此刷怪笼生成的 SpawnerEntry。
      这将覆盖任何先前通过 addPotentialSpawn(org.bukkit.entity.EntitySnapshot, int, org.bukkit.block.spawner.SpawnRule) 添加的条目。

      原文:Sets the SpawnerEntry that will be spawned by this spawner.
      This will override any previous entries that have been added with addPotentialSpawn(org.bukkit.entity.EntitySnapshot, int, org.bukkit.block.spawner.SpawnRule)

      参数:
      spawnerEntry - 要使用的刷怪笼条目。
    • addPotentialSpawn

      void addPotentialSpawn(@NotNull @NotNull EntitySnapshot snapshot, int weight, @Nullable @Nullable SpawnRule spawnRule)
      向此刷怪笼可生成的实体列表中添加一个新的 EntitySnapshot。

      权重将决定此条目被选中生成的频率,权重较高的条目将比权重较低的条目更频繁地生成。
      SpawnRule 将决定此条目在什么条件下可以生成,传入 null 将使用给定实体的默认条件。

      原文:Adds a new EntitySnapshot to the list of entities this spawner can spawn.

      The weight will determine how often this entry is chosen to spawn, higher weighted entries will spawn more often than lower weighted ones.
      The SpawnRule will determine under what conditions this entry can spawn, passing null will use the default conditions for the given entity.

      参数:
      snapshot - 将被生成的快照
      weight - 权重
      spawnRule - 此实体的生成规则,或 null
    • addPotentialSpawn

      void addPotentialSpawn(@NotNull @NotNull SpawnerEntry spawnerEntry)
      向此刷怪笼可生成的实体列表中添加一个新的 SpawnerEntry。

      原文:Adds a new SpawnerEntry to the list of entities this spawner can spawn.

      参数:
      spawnerEntry - 要使用的刷怪笼条目
      另请参阅:
    • setPotentialSpawns

      void setPotentialSpawns(@NotNull @NotNull Collection<SpawnerEntry> entries)
      设置此刷怪笼可生成的 SpawnerEntry 列表。
      这将覆盖任何先前通过 addPotentialSpawn(org.bukkit.entity.EntitySnapshot, int, org.bukkit.block.spawner.SpawnRule) 添加的条目。

      原文:Sets the list of SpawnerEntry this spawner can spawn.
      This will override any previous entries added with addPotentialSpawn(org.bukkit.entity.EntitySnapshot, int, org.bukkit.block.spawner.SpawnRule)

      参数:
      entries - 条目列表
    • getPotentialSpawns

      @NotNull @NotNull List<SpawnerEntry> getPotentialSpawns()
      获取此刷怪笼的潜在生成列表,如果未为此刷怪笼分配任何实体则返回空列表。
      对返回列表所做的更改不会反映在刷怪笼中,除非通过 setPotentialSpawns(java.util.Collection<org.bukkit.block.spawner.SpawnerEntry>) 应用。

      原文:Gets a list of potential spawns from this spawner or an empty list if no entities have been assigned to this spawner.
      Changes made to the returned list will not be reflected in the spawner unless applied with setPotentialSpawns(java.util.Collection<org.bukkit.block.spawner.SpawnerEntry>)

      返回:
      此刷怪笼的潜在生成列表,如果未为此刷怪笼分配任何实体则返回空列表
      另请参阅: