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
@NullMarked
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 -
Field Summary
Fields inherited from class io.papermc.paper.event.world.border.WorldBorderEvent
worldBorderFields inherited from class org.bukkit.event.world.WorldEvent
world -
Constructor Summary
ConstructorsConstructorDescriptionWorldBorderCenterChangeEvent(World world, WorldBorder worldBorder, Location oldCenter, Location newCenter) -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerListGets the new center location for the world border.Gets the original center location of the world border.booleanGets the cancellation state of this event.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.voidsetNewCenter(Location newCenter) Sets the new center location for the world border.Methods inherited from class io.papermc.paper.event.world.border.WorldBorderEvent
getWorldBorderMethods inherited from class org.bukkit.event.world.WorldEvent
getWorldMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
WorldBorderCenterChangeEvent
@Internal public WorldBorderCenterChangeEvent(World world, WorldBorder worldBorder, Location oldCenter, Location newCenter)
-
-
Method Details
-
getOldCenter
Gets the original center location of the world border.- Returns:
- the old center
-
getNewCenter
Gets the new center location for the world border.- Returns:
- the new center
-
setNewCenter
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:CancellableGets 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:
isCancelledin interfaceCancellable- Returns:
trueif this event is cancelled
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:CancellableSets 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:
setCancelledin interfaceCancellable- Parameters:
cancel-trueif you wish to cancel this event
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-