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

Class: ItemComponentHitEntityEvent

event entity component

Beta

包含使用物品击中实体时的相关信息。

Contains information regarding when an item is used to hit an entity.

Properties

attackingEntity

readonly attackingEntity: Entity

Beta

Remarks

发起攻击的实体。

The attacking entity.


hadEffect

readonly hadEffect: boolean

Beta

Remarks

此次击打是否命中或产生了任何效果。

Whether the hit landed or had any effect.


hitEntity

readonly hitEntity: Entity

Beta

Remarks

被击中的实体。

The entity being hit.


itemStack?

readonly optional itemStack?: ItemStack

Beta

Remarks

用于击中实体的物品堆。

The item stack used to hit the entity.

同领域相关