Package cn.nukkit.event.block
Class ItemFrameUseEvent
java.lang.Object
cn.nukkit.event.Event
cn.nukkit.event.block.BlockEvent
cn.nukkit.event.block.ItemFrameUseEvent
- All Implemented Interfaces:
Cancellable
- Direct Known Subclasses:
ItemFrameDropItemEvent
@PowerNukkitXOnly
@Since("1.19.62-r1")
public class ItemFrameUseEvent
extends BlockEvent
implements Cancellable
物品展示框被使用的事件,会在放置物品,旋转物品,掉落物品时调用
The event that the item display box is used will be called when an item is placed, rotated, or dropped
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ItemFrameUseEvent.Action
protected final Item
protected final BlockEntityItemFrame
protected final Player
Fields inherited from class cn.nukkit.event.block.BlockEvent
block
-
Constructor Summary
ConstructorDescriptionItemFrameUseEvent
(Player player, Block block, BlockEntityItemFrame itemFrame, Item item, ItemFrameUseEvent.Action action) -
Method Summary
Modifier and TypeMethodDescription获取操作类型,掉落,放置,选择static HandlerList
getItem()
获取操作中的物品,例如放置物品到物品展示框,获取该物品获取被使用的物品展示框获取使用物品展示框的玩家 Gets player.Methods inherited from class cn.nukkit.event.block.BlockEvent
getBlock
Methods inherited from class cn.nukkit.event.Event
getEventName, isCancelled, setCancelled, setCancelled
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cn.nukkit.event.Cancellable
isCancelled, setCancelled, setCancelled
-
Field Details
-
player
-
item
-
itemFrame
-
action
-
-
Constructor Details
-
ItemFrameUseEvent
public ItemFrameUseEvent(@Nullable Player player, @NotNull Block block, @NotNull BlockEntityItemFrame itemFrame, @Nullable Item item, ItemFrameUseEvent.Action action)
-
-
Method Details
-
getHandlers
-
getPlayer
获取使用物品展示框的玩家 Gets player.- Returns:
- the player
-
getItemFrame
获取被使用的物品展示框Gets item frame.
- Returns:
- the item frame
-
getItem
获取操作中的物品,例如放置物品到物品展示框,获取该物品Get the item in action, e.g. place the item in the item display box and get the item
- Returns:
- the item
-
getAction
获取操作类型,掉落,放置,选择Get operation type, drop, place, select
- Returns:
- the action
-