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/PlayerInteractWithEntityBeforeEvent.md.

Class: PlayerInteractWithEntityBeforeEvent

event player entity

Beta

包含关于玩家与实体交互前事件的信息。

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

Properties

cancel

cancel: boolean

Beta

Remarks

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

If set to true the interaction will be cancelled.


itemStack?

readonly optional itemStack?: ItemStack

Beta

Remarks

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

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.


target

readonly target: Entity

Beta

Remarks

将要被交互的实体。

The entity that will be interacted with.

同领域相关