mojira.dev
MCPE-48587

/summon spawnEvent bypasses entity_spawned, creating broken/corrupt mobs

The bug

The recent spawnEvent option in /summon creates corrupt mobs the majority of the time. It causes the regular minecraft:entity_spawned to be skipped, which many mobs rely on for initialization. Mobs that skip this event are permanently broken or corrupted, each in a different way depending on how that mob behavior is implemented.

How to reproduce

1. /summon sheep ~ ~ ~ 0 0 wololo
2. Try to shear the sheep
→ ❌ You can't, this mob is missing a bunch of components that were supposed to have been applied by the entity_spawned event. It is now broken permanently.

Notes

Even if the specified event is run after entity_spawned, it would still be possible to create corrupt mobs, for example a chicken that has both adult and child components at the same time. Most mob events are implementation details of the behavior and probably should not be exposed in /summon alone, or a distinction should be made between creation events and lifetime events.

Linked issues

Comments 5

user-189af

Confirmed in 1.16.100.55/1.16.40 hotfix. If i summon a pillager with the incorrect entity tag, the pillager never attacks the player, even when provoked.

tryashtar

The addition of the /event command has mostly remedied this issue, since you can run initialization on the mobs after spawning them. However, it's still possible to violate the intended state combinations, like making a mob that's both an adult and baby simultaneously, and some of these are irreversible.

DeeFeeCee

Affects 1.17.2

GoldenHelmet

The official entity events documentation now fully explains this issue under the section "Strange Entity States Are Possible", here: https://learn.microsoft.com/en-us/minecraft/creator/documents/entityevents. At the end of this section there is a note that, to me, seems to say this is not considered a bug because using non-vanilla spawn events in commands is not supported:

These strange conditions of entities can be very entertaining, because they're unexpected, they also aren't intentionally supported. It's possible the specific behaviors of these odd states will change from one game version to the next as other intentional behavior is adjusted for new features or for bug fixing.

KyGigni

They can’t be bread either. This bug, concerning a lot of mobs, is especially bad for me because I can’t get any unique mob variants on my superflat creative world currently. I hope it’ll get fixed soon.

tryashtar

(Unassigned)

307060, 319003

Confirmed

Multiple

1.18.10.26 Beta, 1.17.0.50 Beta, 1.16.0.51 Beta, 1.14.1 Hotfix, 1.14.0.2 Beta, ..., 1.20.40.22 Preview, 1.20.30, 1.20.80.21 Preview, 1.21.10.22 Preview, 1.21.0

Retrieved