Copy and change item names in chest
I am trying to Copy a chests contents over and then change the display names of all the items in the chest.
I can easily do the first part by /clone.
I have been trying to do this part with the /blockdata command like this.
/blockdata -505 69 471 {Items:{display:{Name:"Altered_Item"}}}
I also tried some other variants. The method above removes all the items in the chest though. Is there a way without knowing the item ids to change just the display name of every item in the chest ?
Best Answer
Does this need to happen particularly quickly? Because if not, you could summon tnt or a fireball to destroy the cloned chest so it drops its items, use /entitydata
to change their display names, then teleport them to a hopper above another chest. This is a comparatively slow workaround and leaves you with an extra chest (the cloned one that was destroyed will drop as an item), but you can't edit an item's data without completely overwriting it unless it's in entity form. Hope this helps!
Pictures about "Copy and change item names in chest"
Items \u0026 Renaming Them - How to Make a Minecraft Resourcepack: Episode 2 | (ANY VERSION)
More answers regarding copy and change item names in chest
Answer 2
1.14+
Evolution of commands has made this possible using the /data modify
command.
/data modify block Cx Cy Cz Items[].display.Name set value '{"text":"The Item"}'
This command will set all item's name to The Item
.
But, if you only want to target an item in a specific slot, use this command:
/data modify block Cx Cy Cz Items[{Slot:1b}].display.Name set value '{"text":"The Item"}'
Replace the number in Slot:1b
with the desired slot.
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Ketut Subiyanto, Ketut Subiyanto, Ketut Subiyanto, Ketut Subiyanto