类 SpawnClusterSizeEvent

java.lang.Object
net.neoforged.bus.api.Event

public class SpawnClusterSizeEvent extends LivingEvent
This event is fired from NaturalSpawner.spawnCategoryForPosition(net.minecraft.world.entity.MobCategory, net.minecraft.server.level.ServerLevel, net.minecraft.core.BlockPos) when the spawning system determines the maximum amount of the selected entity that can spawn at the same time.
  • 字段详细资料

    • size

      private int size
  • 构造器详细资料

    • SpawnClusterSizeEvent

      public SpawnClusterSizeEvent(Mob entity)
  • 方法详细资料

    • getSize

      public int getSize()
      Gets the possibly event-modified max spawn cluster size for the entity.

      To see the default size, use Mob.getMaxSpawnClusterSize()

      返回:
      The max spawn cluster size
    • setSize

      public void setSize(int size)
      Changes the max cluster size for the entity.
      参数:
      size - The new size
    • getEntity

      public Mob getEntity()
      覆盖:
      getEntity 在类中 LivingEvent