Updated:
What adventure mode allows
/gamemode adventure @a
In adventure mode players cannot break or place blocks by default, but they can still use buttons, levers, doors and chests. To allow breaking or placing, give items that carry permission.
Tools that break only chosen blocks (Java)
| Version | A pickaxe that mines only stone |
|---|---|
| 1.20.5+ | /give @p minecraft:diamond_pickaxe[can_break= |
| 1.13–1.20.4 | /give @p minecraft:diamond_pickaxe{CanDestroy: |
List several blocks as blocks:["minecraft:stone","minecraft:coal_ore"]. A tag such as blocks:"#minecraft:logs" covers a whole group, like every log.
Blocks that go only on chosen blocks (Java)
| Version | Torches that go only on gold blocks |
|---|---|
| 1.20.5+ | /give @p minecraft:torch[can_place_on= |
| 1.13–1.20.4 | /give @p minecraft:torch{CanPlaceOn: |
The listed block is the one you place against, not the item being placed.
Hide the tooltip
Allowed blocks show in the item tooltip under "Can break". To hide them on 1.21.5+, add tooltip_display={hidden_components:["can_break"]} inside the same [ ]. On 1.20.4 and older, use HideFlags:8 (CanDestroy) or HideFlags:16 (CanPlaceOn).
Bedrock syntax
/give @p diamond_pickaxe 1 0 {"minecraft:can_destroy":{"blocks":["stone"]}}
/give @p torch 16 0 {"minecraft:can_place_on":{"blocks":["gold_block"]}}
Bedrock puts JSON after the amount and data value, and the name is can_destroy. The same JSON can add "minecraft:keep_on_death":{} so an item survives death, or "minecraft:item_lock":{"mode":"lock_in_inventory"} so it cannot leave the inventory.
Ideas
- Treasure hunt: a pickaxe that mines only one ore, to dig out hidden loot.
- Territory game: team wool that can only go on the arena floor.
- Escape room: one breakable wall, with the right tool hidden in a chest.
For the full game flow, see how to make a minigame.
Common problems
- Cannot break the block: test in adventure mode, and check the ID and the syntax for your version (
[ ]or{ }). - Cannot place: can_place_on lists the block you place against.
- Old examples fail: CanDestroy stopped working in 1.20.5. See NBT vs components.
- Nothing breaks near spawn: server spawn protection blocks non-operators there.
Common questions
- Does it matter in survival? No. Survival and creative players can break and place anything. It only applies in adventure mode.
- Does mining speed change? No, it is the normal speed for that tool and block.
- Can placed blocks be broken again? Only with an item that has can_break (can_destroy on Bedrock) for that block.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.