For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/PlayerInteractWithBlockBeforeEvent.md.

Class: PlayerInteractWithBlockBeforeEvent

event player block

Beta

包含有关玩家与方块交互之前的事件信息。

Contains information regarding an event before a player interacts with a block.

Properties

block

readonly block: Block

Beta

将被交互的方块。

Remarks

The block that will be interacted with.


blockFace

readonly blockFace: Direction

Beta

正在被交互的方块面。

Remarks

The face of the block that is being interacted with.


cancel

cancel: boolean

Beta

如果设置为 true,交互将被取消。

Remarks

If set to true the interaction will be cancelled.


faceLocation

readonly faceLocation: Vector3

Beta

相对于方块底部西北角的物品放置位置。

Remarks

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


isFirstEvent

readonly isFirstEvent: boolean

Beta

如果事件是在玩家初始交互按钮按下时触发的,则为 true;如果在按住交互按钮时触发的事件,则为 false

Remarks

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?

readonly optional itemStack?: ItemStack

Beta

交互中正在使用的物品堆,如果为空手则为 undefined

Remarks

The item stack that is being used in the interaction, or undefined if empty hand.


player

readonly player: Player

Beta

此事件的源玩家。

Remarks

Source Player for this event.

同领域相关