Class LivingSpawnEvent.CheckSpawn

Enclosing class:
LivingSpawnEvent

public static class LivingSpawnEvent.CheckSpawn extends LivingSpawnEvent
This event is fired when Mob.checkSpawnRules(net.minecraft.world.level.LevelAccessor, net.minecraft.world.entity.MobSpawnType) would be called.

This event is not cancellable, but does have a result. DEFAULT indicates that default spawn rules should be used. ALLOW indicates that the mob should spawn regardless of default spawn rules. DENY indicates that the mob should not spawn.

This event is fired on the main Forge event bus, only on the logical server.

  • Field Details

    • spawner

      @Nullable private final @Nullable BaseSpawner spawner
    • spawnReason

      private final MobSpawnType spawnReason
  • Constructor Details

  • Method Details

    • isSpawner

      public boolean isSpawner()
    • getSpawner

      @Nullable public @Nullable BaseSpawner getSpawner()
    • getSpawnReason

      public MobSpawnType getSpawnReason()