Mojira Archive
MC-179949

You cannot edit the inventories of piglin by using '/item replace'

The player cannot use the /item command to edit or clear piglin inventories (including the hand* and armor slots). The hand slots are a partial case, as they can be modified using the weapon.mainhand/offhand, but not with a dedicated slot like villagers.

Steps to Reproduce:

  1. Spawn a piglin with armor:
    /summon piglin ~ ~ ~ {ArmorItems:[{},{},{id:"minecraft:golden_chestplate",count:1},{}]}
    
  2. Try and replace its chestplate:
    /item replace entity @e[type=minecraft:piglin,sort=nearest,limit=1] armor.body with minecraft:diamond_chestplate
    

Observed Behavior:

The command fails, and sends the following error:

Expected Result:

The command would properly execute as it would with other mobs.

Original Description:

It is not possible to edit piglin inventories with /item replace (just the hand and armour slots). This is inconsistent, as you CAN edit the inventories of villagers (villagers have villager.x slots counted from 0 to 7.), donkeys, llamas and even wandering traders and pillagers! Piglins' are not accesible in the same manner however.