Use the Command on the Inventory of Entity.
(Minecart Chest, Donkey, mule...)
Need to Close and open the GUI.
Also after a "/data modify" the command /replaceitem dosen't work.
Exemple :
/data modify entity <Entity> Items[].tag.Enchantments[] set value {id:"infinity"}
On the Block (Chest, ShulkerBox...) use /data modify work fine.
Just Entity doesn't work.
Really problémactic for Custom UI.
Duplicate of MC-29318