Package io.papermc.paper.event.player
Class PlayerItemFrameChangeEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
io.papermc.paper.event.player.PlayerItemFrameChangeEvent
- All Implemented Interfaces:
Cancellable
Called when an
ItemFrame is having an item rotated, added, or removed from it.-
Nested Class Summary
Nested ClassesNested 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
ConstructorsConstructorDescriptionPlayerItemFrameChangeEvent(@NotNull Player player, @NotNull ItemFrame itemFrame, @NotNull ItemStack itemStack, @NotNull PlayerItemFrameChangeEvent.ItemFrameChangeAction action) -
Method Summary
Modifier and TypeMethodDescriptionGets the action that was performed on thisItemFrame.static @NotNull HandlerListGets theItemFrameinvolved in this event.Gets theItemStackinvolved in this event.booleanGets the cancellation state of this event.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.voidsetItemStack(@Nullable ItemStack itemStack) Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayerMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerItemFrameChangeEvent
-
-
Method Details
-
getItemFrame
Gets theItemFrameinvolved in this event.- Returns:
- the
ItemFrame
-
getItemStack
Gets theItemStackinvolved in this event. This is the item being added, rotated, or removed from theItemFrame.If this method returns air, then the resulting item in the ItemFrame will be empty.
- Returns:
- the
ItemStackbeing added, rotated, or removed
-
setItemStack
Sets theItemStackthat thisItemFrameholds. If null is provided, the ItemStack will become air and the result in the ItemFrame will be empty.- Parameters:
itemStack-ItemFrameitem
-
getAction
Gets the action that was performed on thisItemFrame.- Returns:
- action performed on the item frame in this event
- See Also:
-
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:
- true if 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- true if you wish to cancel this event
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-