mojira.dev

elbtx

Assigned

No issues.

Reported

No issues.

Comments

I can confirm this issue is still reproducible on the current stable Bedrock release.

The original report predates EntityHurtBeforeEvent, so I also tested the newer cancellable hurt event to determine whether it provides a way to intercept these attacks.

Tested environment

  • Minecraft Bedrock 26.51 stable

  • @minecraft/server 2.10.0 stable

  • Survival and Creative

Steps to reproduce

  1. Apply the attached reproduction behavior pack.

  2. Spawn a cow as normal living entity control.

  3. Spawn affected non-living entities such as a boat, minecart, chest minecart, hopper minecart, chest boat, or armor stand.

  4. Attack the entities in Survival.

  5. Repeat with fresh targets in Creative.

The pack logs entityHurt before/after, entityHitEntity, playerSwingStart, and entity removal events.

Observed results

For normal living entities, attacks produce EntityHurtBeforeEvent, EntityHitEntityAfterEvent, and EntityHurtAfterEvent. EntityHurtBeforeEvent is cancellable, so the damage can be prevented.

For the affected non-living entities:

  • EntityHurtBeforeEvent and EntityHurtAfterEvent are not emitted.

  • In Survival, EntityHitEntityAfterEvent can fire when the target survives the hit, but this is an after-event and cannot prevent the attack.

  • When the target is destroyed, EntityRemoveBeforeEvent may fire, but it is not cancellable.

  • In Creative, these entities can be destroyed in a single hit. The destruction/removal path can complete before EntityHitEntityAfterEvent is delivered, so the target may already be gone before the API reports the hit. EntityHurtBeforeEvent still does not fire beforehand, leaving no opportunity to cancel the attack.

This leaves no cancellable event equivalent to EntityHurtBeforeEvent with which to prevent the attack/destruction.

I have attached the minimal observation-only reproduction pack covering both Survival and Creative behavior. Source and the packaged reproduction are also available on GitHub here: MCPE-174388 Repro v1.0.0

[media]