The bug
When using /replaceitem entity
on a chest or hopper minecart, the command fails as shown in the picture, telling you that it could not replace the container slot with the specified item.
How to reproduce
Summon or place a normal chest minecart
Run the following command while standing fairly close to the minecart
/replaceitem entity @e[distance=..5,type=minecraft:chest_minecart] container.0 minecraft:dirt
Code analysis
Based on 1.11.2 decompiled using MCP 9.35 rc1
Chest and hopper minecarts do not override the method net.minecraft.entity.Entity.replaceItemInInventory(int, ItemStack)
.
Linked issues
is duplicated by 2
Attachments
Comments 25
That's why I posted this, I realized it and had to stop the project that you can see in the background of the picture for the moment.
Well it doesn't i swear you dont even tried because i use it in a datapack and it works ^^
But if you think it Clears the Inventory tell me why?
There is no reason why the whole Inventory should be cleared
after this command because i just Modify Slot:0b (the first slot)
/data merge with lists always clears the list; there's one exception, and that's the villager inventory (which is a separate bug).
And I just checked.
You're right i tried it on a World where i have a datapack that fills the chests permanently thats why i dont had empty chests after merging something
Confirmed.