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

# Class WorldBorderCenterChangeEvent

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.WorldBorderCenterChangeEvent

All Implemented Interfaces:
  `Cancellable`

public class WorldBorderCenterChangeEvent extends WorldBorderEvent implements Cancellable
Called when a world border's center is changed.

## Nested Class Summary

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

`Event.Result`

## Constructor Summary

Constructors
Constructor
Description
`WorldBorderCenterChangeEvent(@NotNull World world, @NotNull WorldBorder worldBorder, @NotNull Location oldCenter, @NotNull Location newCenter)`

## Method Summary

Modifier and Type
Method
Description
`static @NotNull HandlerList`
`getHandlerList()`
`@NotNull HandlerList`
`getHandlers()`
`@NotNull Location`
`getNewCenter()`
Gets the new center location for the world border.
`@NotNull Location`
`getOldCenter()`
Gets the original center location of the world border.
`boolean`
`isCancelled()`
Gets the cancellation state of this event.
`void`
`setCancelled(boolean cancel)`
Sets the cancellation state of this event.
`void`
`setNewCenter(@NotNull Location newCenter)`
Sets the new center location for 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

### WorldBorderCenterChangeEvent

public WorldBorderCenterChangeEvent(@NotNull @NotNull World world, @NotNull @NotNull WorldBorder worldBorder, @NotNull @NotNull Location oldCenter, @NotNull @NotNull Location newCenter)

## Method Details

### getOldCenter

@NotNull public @NotNull Location getOldCenter()
Gets the original center location of the world border.

Returns:
  the old center

### getNewCenter

@NotNull public @NotNull Location getNewCenter()
Gets the new center location for the world border.

Returns:
  the new center

### setNewCenter

public void setNewCenter(@NotNull @NotNull Location newCenter)
Sets the new center location for the world border. Y coordinate is ignored.

Parameters:
  `newCenter` - the new center

### 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()