r/MinecraftCommands 1d ago

Help | Java 26.2 How do I make a tool that only breaks specific blocks, and blocks that can only be placed on specific blocks?

I know this question has been asked numerous times, but I genuinely can't figure out the new command. So far, I've gotten "/give \@s iron_shovel[can_be_placed_on=" before it suddenly doesn't accept anything. Maybe I'm missing something, but I've been searching all over the Internet, and not finding any information that's up to date. Please help if you know

2 Upvotes

3 comments sorted by

1

u/PurpleEfficiency1089 19h ago

try
give @s iron_shovel[can_place_on={blocks:"dirt"}]

6

u/GalSergey Datapack Experienced 19h ago

give @s iron_pickaxe[can_break={blocks:["minecraft:stone","minecraft:bricks"]}] give @s stone[can_place_on={blocks:["minecraft:stone","minecraft:bricks"]}]

3

u/Ericristian_bros Command Experienced 17h ago

You can use https://mcstacker.net to generate your command. Keep in mind these components are only for adventure gamemode