In the latest Minecraft Bedrock Preview, the new entityHurt before event can be cancelled — but cancelling it produces inconsistent side effects:
Knockback dealt while standing still/walking is cancelled (expected if the event is cancelled. Unless the knockback enchantment is present), but if the attacker is sprinting the knockback still occurs even though the event was cancelled and no damage is applied.
The durability of the item used to attack is decreased / consumed even when the entityHurt before event is cancelled and the target does not take damage.
Enchantment effects (observed: Knockback, Fire Aspect) still apply (target gets more knockback, target is set on fire) even when the hit is cancelled and no damage occurs. (Unclear whether enchantment application during cancelled hits is intended — included as an observation.)
These behaviors appear to be bugs in the before-event handling / cancellation chain: the engine cancels the hit for HP/damage/after-events, but fails to stop certain side-effects that should be prevented when the attack is cancelled (sprint knockback, item durability loss, enchantment-triggered effects).
Steps to Reproduce
1. Download and import the attached .mcworld file (Either by opening the file, using the “Import world“ button in the play menu or by manually copying the world files in the game’s directory.)
2. Join the imported world.
3. Click the button to start the test.
4. Hit the Husk with and without using the given items and observe the outcome.
Expected Result
When world.beforeEvents.entityHurt is cancelled:
The target should take no damage.
No knockback should be applied (neither normal nor sprint-induced).
Item durability should not be reduced for the cancelled attack.
No enchantment effects (e.g., Fire Aspect, Knockback, etc.) should be applied as a result of the cancelled attack.
Actual Result
When world.beforeEvents.entityHurt is cancelled:
Target takes no HP damage (after event does not fire).
Sprint knockback still occurs (target is physically moved) for sprint-attacks despite cancellation.
Item durability is consumed for the hitting item even though no damage was applied.
Enchantment side-effects (observed: Knockback, Fire Aspect) still apply even though the attack was cancelled.
Attachments
Comments 0
No comments.