mojira.dev
MCPE-165197

Component minecraft:on_hurt does not do anything

The entity components documentation describes a component, minecraft:on_hurt, and the vanilla behavior json for blazes, pillagers, and end crystals contain this component. However, this component does not do anything.

Steps to reproduce

  1. Load

[media]
  1. . This pack removes the component "minecraft:on_hurt_by_player" from blazes, and adds the component "minecraft:on_hurt" to bats. In each mob, "minecraft:on_hurt" is set to run an event that includes the command, "say Ow!".

  2. Activate this pack on a world and enable Holiday Creator experiments.

  3. Make a 1 x 2 x 1 room for a blaze and a 1 x 1 x 1 room for a bat. Leave one block out of the side of the blaze room, and make one of the side blocks for the bat room a slab, so that you can hit each mob. Make one side wall block of each room a dispenser. Put arrows in the dispenser and a button on its side.

  4. Spawn a blaze in the blaze room and a bat in the bat room.

  5. Punch each mob, press the button on the dispenser to shoot each mob, and run the command </damage @e 1>.

Expected results

Each mob says "Ow!" when punched, when shot by a dispenser arrow, and when damaged by the damage command.

Observed results

The mobs do not say "Ow!"

Linked issues

Attachments

Comments 3

The example json text in the documentation for minecraft:on_hurt is also incorrect. It shows parameters from a different component.
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitytriggers/minecrafttrigger_on_hurt

Strangely, on_hurt does seem to be effective inside the vanilla ender_crystal. If you create a behavior pack that replaces the ender_crystal.json with a version that has minecraft:on_hurt removed, then ender crystals cannot be triggered to explode.

Thank you for your report!
After consideration, the issue is being closed as Won't Fix.

Please note that this is not the same as Working as Intended, as this bug report correctly describes behavior in the game that might not be the intended or desirable behavior, but it will not be fixed right now. Sometimes, this is because the issue reported is minor and/or impossible to change without large architectural changes to the code base.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

GoldenHelmet

(Unassigned)

947071

Confirmed

Multiple

1.19.50, 1.20.73 Hotfix, 1.21.0

Retrieved