Package io.papermc.paper.event.world.border

# Class WorldBorderBoundsChangeEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.world.WorldEvent
io.papermc.paper.event.world.border.WorldBorderEvent
io.papermc.paper.event.world.border.WorldBorderBoundsChangeEvent

All Implemented Interfaces:
  `Cancellable`

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

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`WorldBorderBoundsChangeEvent.Type`

## Nested classes/interfaces inherited from class org.bukkit.event.Event

`Event.Result`

## Constructor Summary

Constructors
Constructor
Description
`WorldBorderBoundsChangeEvent(@NotNull World world, @NotNull WorldBorder worldBorder, @NotNull WorldBorderBoundsChangeEvent.Type type, double oldSize, double newSize, long duration)`

## Method Summary

Modifier and Type
Method
Description
`long`
`getDuration()`
Gets the time in milliseconds for the change.
`static @NotNull HandlerList`
`getHandlerList()`
`@NotNull HandlerList`
`getHandlers()`
`double`
`getNewSize()`
Gets the new size of the world border.
`double`
`getOldSize()`
Gets the old size or the world border.
`@NotNull WorldBorderBoundsChangeEvent.Type`
`getType()`
Gets if this change is an instant change or over-time change.
`boolean`
`isCancelled()`
Gets the cancellation state of this event.
`void`
`setCancelled(boolean cancel)`
Sets the cancellation state of this event.
`void`
`setDuration(long duration)`
Sets the time in milliseconds for the change.
`void`
`setNewSize(double newSize)`
Sets the new size of the world border.

### Methods inherited from class io.papermc.paper.event.world.border.WorldBorderEvent

`getWorldBorder`

### Methods inherited from class org.bukkit.event.world.WorldEvent

`getWorld`

### Methods inherited from class org.bukkit.event.Event

`callEvent, getEventName, isAsynchronous`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### WorldBorderBoundsChangeEvent

public WorldBorderBoundsChangeEvent(@NotNull @NotNull World world, @NotNull @NotNull WorldBorder worldBorder, @NotNull @NotNull WorldBorderBoundsChangeEvent.Type type, double oldSize, double newSize, long duration)

## Method Details

### getType

@NotNull public @NotNull WorldBorderBoundsChangeEvent.Type 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

### getDuration

public long getDuration()
Gets the time in milliseconds for the change. Will be 0 if instant.

Returns:
  the time in milliseconds for the change

### setDuration

public void setDuration(long duration)
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

@NotNull public @NotNull HandlerList getHandlers()

Specified by:
  `getHandlers` in class `Event`

### getHandlerList

@NotNull public static @NotNull HandlerList getHandlerList()