Class LivingSpawnEvent.CheckSpawn

Enclosing class:
LivingSpawnEvent

public static class LivingSpawnEvent.CheckSpawn extends LivingSpawnEvent
Fires before mob spawn events. Result is significant: DEFAULT: use vanilla spawn rules ALLOW: allow the spawn DENY: deny the spawn
  • Field Details

  • Constructor Details

    • CheckSpawn

      public CheckSpawn(Mob entity, LevelAccessor world, double x, double y, double z, @Nullable BaseSpawner spawner, MobSpawnType spawnReason)
      CheckSpawn is fired when an Entity is about to be spawned.
      Parameters:
      entity - the spawning entity
      world - the world to spawn in
      x - x coordinate
      y - y coordinate
      z - z coordinate
      spawner - position of the MobSpawner null if it this spawn is coming from a WorldSpawner
  • Method Details

    • isSpawner

      public boolean isSpawner()
    • getSpawner

      @Nullable public BaseSpawner getSpawner()
    • getSpawnReason

      public MobSpawnType getSpawnReason()