I want people to only be able to place TNT on only Quartz Blocks and I've see this done before where you can only place blocks on certain other blocks but I'm not sure of the command used to do that.
Does anyone know?
From the wiki, about Item NBT tags :
Blocks can be given tags to specify what blocks they may be placed against in Adventure mode [...]
tag: The tag tag.
- CanPlaceOn: Determines which blocks that blocks with this tag can be placed against in adventure mode.
As the give
command takes the Item's tag
tag as last parameter, you just have to drop your list of blocks in there :
// Give one block of stone that can be placed on grass or dirt
give @p minecraft:stone 1 0 {CanPlaceOn:["minecraft:grass","minecraft:dirt"]}
Or, in 1.13+:
give @p stone{CanPlaceOn:["minecraft:grass","minecraft:dirt"]}
give
's data and amount parameters are the other way around :)
Type this in commands:
/give (your name) minecraft:TNT 1 0 {CanPlaceOn:["minecraft:quartz_block"]}
IMPORTANT:
You can change
minecraft:TNT 1 0 {CanPlaceOn:["minecraft:quartzblock"]}
to whatever you like.
give (your name) minecraft:TNT{CanPlaceOn:["minecraft:quartz_block"]}
1.20.5+ syntax:
/give @s stone[minecraft:can_place_on={blocks:["minecraft:acacia_leaves"]}]
Lever that you can place on diamond block! Can be used in Custom/Puzzle-Map!
/give [Username] lever 1 0 {CanPlaceOn:["minecraft:diamond_block"]}
That is a lever that you can place on diamond block! You can change it!:
/give [Username] [block] 1 0 {CanPlaceOn:["minecraft:**[Your block]**"]}
Or can place on more blocks!
/give [Username] [block] 1 0 {CanPlaceOn:["minecraft:[Your block],minecraft:[2nd block]"]}