Summon a piglin with any secondary item in their offhand and the item is stored in their inventory or placed in an armor slot rather than held in their offhand, unless their main hand is also empty. If the offhand item is golden this will take the place of the primary held item (e.g. golden sword will replace the crossbow) or will be worn (e.g. golden leggings will be put on instantly).
Example:
/summon piglin ~ ~ ~ {equipment:{mainhand:{id:"crossbow"},offhand:{id:"firework_rocket"}}}
The piglin does not have a firework rocket in its offhand/data get entity @n[type=minecraft:piglin] equipment
The firework rocket is indeed not in its offhand/data get entity @n[type=minecraft:piglin] Inventory
It’s in its inventory instead
Linked issues
is duplicated by 2
Comments 4
This issue seems to be specific to piglins with an item in their main hand; /summon minecraft:piglin ~ ~ ~ {equipment:{offhand:{id:"minecraft:totem_of_undying"}}}
works just fine, with the piglin simply ignoring any golden items on the ground and switching the totem to its main hand if you give it such an item directly. I will update the title and description to reflect this.
Probably something to do with piglins holding gold after bartering.