类 LevelEvent.PotentialSpawns

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.level.LevelEvent
net.minecraftforge.event.level.LevelEvent.PotentialSpawns
封闭类:
LevelEvent

public static class LevelEvent.PotentialSpawns extends LevelEvent
Fired when building a list of all possible entities that can spawn at the specified location.

If an entry is added to the list, it needs to be a globally unique instance.

The event is called in
引用无效
net.minecraft.world.level.NaturalSpawner#mobsAt(ServerLevel, StructureManager, ChunkGenerator, MobCategory, RandomSource, BlockPos)
.

This event is cancellable, and does not have a result. Canceling the event will result in an empty list, meaning no entity will be spawned.

  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • getMobCategory

      public MobCategory getMobCategory()
      返回 the category of the mobs in the spawn list.。
      返回:
      the category of the mobs in the spawn list.
    • getPos

      public BlockPos getPos()
      返回 the block position where the chosen mob will be spawned.。
      返回:
      the block position where the chosen mob will be spawned.
    • getSpawnerDataList

      public List<MobSpawnSettings.SpawnerData> getSpawnerDataList()
      返回 the list of mobs that can potentially be spawned.。
      返回:
      the list of mobs that can potentially be spawned.
    • addSpawnerData

      public void addSpawnerData(MobSpawnSettings.SpawnerData data)
      Appends a SpawnerData entry to the spawn list.
      参数:
      data - SpawnerData entry to be appended to the spawn list.
    • removeSpawnerData

      public boolean removeSpawnerData(MobSpawnSettings.SpawnerData data)
      Removes a SpawnerData entry from the spawn list.
      参数:
      data - SpawnerData entry to be removed from the spawn list. 返回 true if the spawn list contained the specified element.。