Class PlayerNaturallySpawnCreaturesEvent

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

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

      public PlayerNaturallySpawnCreaturesEvent(@NotNull @NotNull 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
    • getHandlers

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

      @NotNull public static @NotNull HandlerList getHandlerList()
    • 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 players 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 players chunks for natural spawning