mojira.dev
MC-304420

Pigs' equipment is deleted when converting to zombified piglins

Since it was requested that MC-311623 be split up, this report covers equipment transfer when a pig converts to a zombified piglin.

When such a conversion occurs, the pig’s equipment is deleted. Per the standard outlined in MC-311623, it would be expected that the items a zombified piglin cannot make use of (body and saddle) would be dropped according to drop_chances (preferably reflecting the chance value exactly), while the remaining items (hands, armor) would be retained by the zombified piglin. However, for this particular conversion, there should be a unique interaction: a weapon for the zombified piglin (either a golden sword or golden spear) is selected, and if the piglin prefers it to the pig’s main-hand item, the latter is also dropped according to drop_chances instead of retained. (If the pig was holding a better weapon no golden sword or spear would be dropped.)

To reproduce

  1. /summon minecraft:pig ~ ~ ~ {NoAI:1b,equipment:{saddle:{id:saddle}},drop_chances:{saddle:2f}}

  2. /summon minecraft:lightning_bolt

  3. /data get entity @n[type=minecraft:zombified_piglin] equipment
    ❌ The saddle has been deleted

Expected behavior

The saddle would be dropped on the ground (utilizing invulnerable_time to avoid the lightning damage).

Code analysis

Code analysis by YouTuber JASON13 can be found here: https://youtu.be/BBFaNYwZ8-o?si=NPhIG_gUQUwTnR4y&t=283

Linked issues

MC-276342 Player continues riding on Zombified Piglin after saddled pig is converted Resolved MC-260592 Zombie Villagers wearing/holding Curse of Binding items do not drop or keep these items after they are cured Open MC-305199 Villagers' equipped armor is deleted when converting to witches Reopened MC-311524 Zombie villagers' equipped armor is not retained when converting to villagers Open MC-311623 Inconsistent equipment preservation when a mob converts to another mob which cannot normally hold or wear it Resolved

Attachments

Comments 3

Can confirm. This is most likely intended, but arguably the saddle should be dropped on the ground (and rendered invulnerable to the lightning bolt in question).

Can confirm 1.21.11 Pre-Release 1

Rewrote report so that it serves as a complete sub-case of MC-311623.

anthony cicinelli

(Unassigned)

Confirmed

Gameplay

Normal

Items

1.21.10, 1.21.11 Pre-Release 2, 26.3 Pre-Release 2

Retrieved