Class PlayerSwapHandItemsEvent
java.lang.Object
fr.fidorial.event.player.PlayerSwapHandItemsEvent
- All Implemented Interfaces:
Cancellable, Event, PlayerEvent
Fired when a player swaps the items of their two hands.
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerSwapHandItemsEvent(Player player, ItemStack mainHand, ItemStack offHand) Creates an event. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturnstrueif the action this event describes will not happen.mainHand()Returns what the main hand holds before the swap, and the off hand after it.offHand()Returns what the off hand holds before the swap, and the main hand after it.player()Returns the player involved in this event.voidsetCancelled(boolean cancelled) Prevents or re-allows the action this event describes.
-
Constructor Details
-
PlayerSwapHandItemsEvent
Creates an event.- Parameters:
player- the playermainHand- what the main hand holds before the swap,ItemStack.EMPTYwhen nothingoffHand- what the off hand holds before the swap,ItemStack.EMPTYwhen nothing- Since:
- 0.1.0
-
-
Method Details
-
player
Description copied from interface:PlayerEventReturns the player involved in this event.- Specified by:
playerin interfacePlayerEvent- Returns:
- the player involved in this event
-
mainHand
Returns what the main hand holds before the swap, and the off hand after it.- Returns:
- what the main hand holds before the swap, and the off hand after it
- Since:
- 0.1.0
-
offHand
Returns what the off hand holds before the swap, and the main hand after it.- Returns:
- what the off hand holds before the swap, and the main hand after it
- Since:
- 0.1.0
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableReturnstrueif the action this event describes will not happen.- Specified by:
isCancelledin interfaceCancellable- Returns:
trueif the action this event describes will not happen
-
setCancelled
public void setCancelled(boolean cancelled) Description copied from interface:CancellablePrevents or re-allows the action this event describes.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancelled-trueto prevent it
-