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 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
ConstructorDescriptionPlayerItemFrameChangeEvent
(@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 HandlerList
Gets theItemFrame
involved in this event.Gets theItemStack
involved in this event.boolean
Gets the cancellation state of this event.void
setCancelled
(boolean cancel) Sets the cancellation state of this event.void
setItemStack
(@Nullable ItemStack itemStack) Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
Methods inherited from class org.bukkit.event.Event
asynchronous, callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerItemFrameChangeEvent
-
-
Method Details
-
getItemFrame
Gets theItemFrame
involved in this event.- Returns:
- the
ItemFrame
-
getItemStack
Gets theItemStack
involved 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
ItemStack
being added, rotated, or removed
-
setItemStack
Sets theItemStack
that thisItemFrame
holds. If null is provided, the ItemStack will become air and the result in the ItemFrame will be empty.- Parameters:
itemStack
-ItemFrame
item
-
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: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 interfaceCancellable
- 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 interfaceCancellable
- Parameters:
cancel
- true if you wish to cancel this event
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-