Class ModifyCustomSpawnersEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.level.ModifyCustomSpawnersEvent

public class ModifyCustomSpawnersEvent extends net.neoforged.bus.api.Event
This event is fired on the logical server when a ServerLevel is building its custom spawners.

Subscribe to this event to add/remove custom spawners for the level.

This event is not cancellable and does not have a result.

  • Field Details

  • Constructor Details

  • Method Details

    • getLevel

      public ServerLevel getLevel()
      Returns the server level this event is affecting.
      Returns:
      the server level this event is affecting
    • getCustomSpawners

      public List<CustomSpawner> getCustomSpawners()
      Returns:
      the modifiable custom spawner list.
    • addCustomSpawner

      public void addCustomSpawner(CustomSpawner customSpawner)
      Adds a custom spawner to the list.