mojira.dev
MC-172600

Piglin cannot be spawned/edited to hold an item in their offhand unless their main hand is empty

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:

  1. /summon piglin ~ ~ ~ {equipment:{mainhand:{id:"crossbow"},offhand:{id:"firework_rocket"}}}
    The piglin does not have a firework rocket in its offhand

  2. /data get entity @n[type=minecraft:piglin] equipment
    The firework rocket is indeed not in its offhand

  3. /data get entity @n[type=minecraft:piglin] Inventory
    It’s in its inventory instead

Linked issues

Comments 4

Probably something to do with piglins holding gold after bartering.

hi storm same problem 🙂 and piglins have 16 instead of 24

Piglins use their offhand to examine gold items

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.

stormfrenzy

(Unassigned)

Confirmed

Commands

20w07a

Retrieved