Package io.papermc.paper.event.player
Class PlayerSwapWithEquipmentSlotEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
io.papermc.paper.event.player.PlayerSwapWithEquipmentSlotEvent
- All Implemented Interfaces:
Cancellable
@NullMarked
public class PlayerSwapWithEquipmentSlotEvent
extends PlayerEvent
implements Cancellable
Triggered when a
Player swaps an item with an equipment slot.-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Field Summary
Fields inherited from class org.bukkit.event.player.PlayerEvent
player -
Constructor Summary
ConstructorsConstructorDescriptionPlayerSwapWithEquipmentSlotEvent(Player player, ItemStack itemInHand, EquipmentSlot slot, ItemStack itemToSwap) -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerListReturns the item in one of the hand slots.Returns the item to swap.getSlot()Returns the slot to swap into.booleanGets the cancellation state of this event.voidsetCancelled(boolean cancelled) Sets the cancellation state of this event.Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayerMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerSwapWithEquipmentSlotEvent
@Internal public PlayerSwapWithEquipmentSlotEvent(Player player, ItemStack itemInHand, EquipmentSlot slot, ItemStack itemToSwap)
-
-
Method Details
-
getItemInHand
Returns the item in one of the hand slots.- Returns:
- the item in one of the hand slots
-
getSlot
Returns the slot to swap into.- Returns:
- the slot to swap into
-
getItemToSwap
Returns the item to swap.- Returns:
- the item to swap
-
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 cancelled) 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:
cancelled-trueif you wish to cancel this event
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-