mojira.dev
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:

[media]

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.

Linked issues

Attachments

Comments 3

I can confirm for 1.16.3

This issue is specially critical as removing items from the inventory using /data remove, merge, or modify doesn't seam to work. 

Can confirm in the latest pre-release for 1.20.5. Considering this issue has not been kept up with since snapshot 22w03a, I would like to request ownership of it. The primary reason is to update the description to be more robust and clear.

Ozone

[Mod] Jingy

(Unassigned)

Community Consensus

Platform

Important

Commands

piglin

20w17a, 20w18a, 20w19a, 20w20a, 20w21a, ..., 1.18.1, 22w03a, 1.20.5 Pre-Release 1, 1.20.6, 24w21b

Retrieved