Class WorldBorderBoundsChangeEvent

All Implemented Interfaces:
Cancellable

@NullMarked public class WorldBorderBoundsChangeEvent extends WorldBorderEvent implements Cancellable
Called when a world border changes its bounds, either over time, or instantly.
  • Constructor Details

  • Method Details

    • getType

      Gets if this change is an instant change or over-time change.
      Returns:
      the change type
    • getOldSize

      public double getOldSize()
      Gets the old size or the world border.
      Returns:
      the old size
    • getNewSize

      public double getNewSize()
      Gets the new size of the world border.
      Returns:
      the new size
    • setNewSize

      public void setNewSize(double newSize)
      Sets the new size of the world border.
      Parameters:
      newSize - the new size
    • getDurationTicks

      public @org.jetbrains.annotations.Range(from=0L, to=2147483647L) long getDurationTicks()
      Gets the time in ticks for the change. Will be 0 if instant.
      Returns:
      the time in ticks for the change
    • setDurationTicks

      public void setDurationTicks(@org.jetbrains.annotations.Range(from=0L, to=2147483647L) long duration)
      Sets the time in ticks for the change. Will change getType() to return WorldBorderBoundsChangeEvent.Type.STARTED_MOVE.
      Parameters:
      duration - the time in ticks for the change
    • getDuration

      @Deprecated(forRemoval=true, since="1.21.11") public @org.checkerframework.checker.index.qual.NonNegative long getDuration()
      Deprecated, for removal: This API element is subject to removal in a future version.
      in favor of getDurationTicks()
      Gets the time in milliseconds for the change. Will be 0 if instant.
      Returns:
      the time in milliseconds for the change
    • setDuration

      @Deprecated(forRemoval=true, since="1.21.11") public void setDuration(@org.checkerframework.checker.index.qual.NonNegative long duration)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the time in milliseconds for the change. Will change getType() to return WorldBorderBoundsChangeEvent.Type.STARTED_MOVE.
      Parameters:
      duration - the time in milliseconds for the change
    • 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:
      true if this event is cancelled
    • 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
    • getHandlers

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

      public static HandlerList getHandlerList()