Class PlayerNaturallySpawnCreaturesEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent
All Implemented Interfaces:
Cancellable

@NullMarked public class PlayerNaturallySpawnCreaturesEvent extends PlayerEvent implements Cancellable
Fired when the server is calculating what chunks to try to spawn monsters in every Monster Spawn Tick event
  • Constructor Details

    • PlayerNaturallySpawnCreaturesEvent

      @Internal public PlayerNaturallySpawnCreaturesEvent(Player player, byte radius)
  • Method Details

    • getSpawnRadius

      public byte getSpawnRadius()
      Returns:
      The radius of chunks around this player to be included in natural spawn selection
    • setSpawnRadius

      public void setSpawnRadius(byte radius)
      Parameters:
      radius - The radius of chunks around this player to be included in natural spawn selection
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: Cancellable
      Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins
      Specified by:
      isCancelled in interface Cancellable
      Returns:
      If this player's chunks will be excluded from natural spawns
    • setCancelled

      public void setCancelled(boolean cancel)
      Description copied from interface: Cancellable
      Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.
      Specified by:
      setCancelled in interface Cancellable
      Parameters:
      cancel - true if you wish to cancel this event, and not include this player's chunks for natural spawning
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()