类 ItemUseOnBeforeEvent实验性

Contains information related to an item being used on a block.

层级 (查看完整内容)

属性

block: Block

物品使用的目标方块。

The block that the item is used on.

blockFace: Direction

物品在方块的哪一面被使用。

The face of the block that an item is being used on.

cancel: boolean

If set to true, this will cancel the item use behavior.

faceLocation: Vector3

物品在方块的面上被使用时,交互点相对于方块西北方底部顶点的坐标。

Location relative to the bottom north-west corner of the block where the item is placed.

isFirstEvent: boolean

This value will be true if the event was triggered on players initial interaction button press and false on events triggered from holding the interaction button.

itemStack: ItemStack

对方块使用物品时物品所在的物品堆叠。

The impacted item stack that is being used on a block.

source: Player

该事件的触发来源实体。

Returns the source entity that triggered this item event.