TransWikia.com

Where do I put item tags on items inside a chest or your inventory?

Arqade Asked by jardesert on December 29, 2020

I am making a Minecraft Mini Game adventure map, and one of the levels has a /setblock command, I am using the command in a way to spawn an item in a chest (Wooden Button) I need the wooden button to have CanPlaceOn tag so it can be placed on a log.

I have tried: /setblock 294 5 -1251 minecraft:chest 0 replace {Items:[:{Count:1,Slot:0,id:minecraft:wooden_button,CanPlaceOn:[log]}]}

One Answer

The CanPlaceOn list is inside the tag compound tag:

{
    Items:[ 
        {
            Count:1b,
            Slot:0b,
            id:"minecraft:wooden_button",
            tag:{
                CanPlaceOn:[
                    "minecraft:log"
                ]
            }
        }
    ]
}

Example command for 1.12−:

/setblock 294 5 -1251 minecraft:chest 0 replace {Items:[{Count:1b,Slot:0b,id:"minecraft:wooden_button",tag:{CanPlaceOn:["log"]}}]}

Example command for 1.13+:

/setblock 294 5 -1251 minecraft:chest{Items:[{Count:1b,Slot:0b,id:"minecraft:wooden_button",tag:{CanPlaceOn:["minecraft:log"]}}]}

Item NBT structure can be found on this wiki page.

Correct answer by SirBenet on December 29, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP