The "CanDestroy" tag allows mapmakers to list specific blocks that they want to allow a player in adventure mode to break using a tool.
I expected that adding fire to the list would allow me to give a player in adventure mode the ability to destroy fire.
While the tool does display "Can Break: Fire" in game, actually hitting fire with the tool does nothing. It seems that there is no way to allow players in adventure mode to destroy fire without letting them destroy the blocks beneath it.
To reproduce, you will need a way to edit the NBT tags in your world (such as NBT Explorer). The simplest method is adding the tool of your choice to your inventory, then exiting your world. Open up the world in your NBT editor, then look within level.dat > data > player > inventory to find the tool (it will be a compound tag with 4-5 entries; the Slot and id tags should help you find it). Within the "tag" Compound tag (create it if it isn't there), create a List tag named CanDestroy. Within the list, you simply need to make a String tag for each block you would like the player to be able to destroy in Adventure mode (the String should hold the block's ID, such as minecraft:stone; you can add something to test it if you'd like). Add a String tag for minecraft:fire, then save, and open your world back up in Minecraft. Set your gamemode to adventure, and try to break the appropriate blocks – for any block IDs you added, the tool should mine them as if you were in survival, with the (sole, I believe) exception of fire.
Linked issues
is duplicated by 1
Comments 12
I think the main issue is that fire isn't really a block. Pressing F3 only shows the block that the fire is sitting on.
As a workaround guys, you can give an item that can be place on that block below the fire, and you can put out the fire that way.
Well fire is a block but it doesn't have a hitbox to hit it or to collide with it. So if you're punching it out you're actually hitting the block that is on fire. So I just tried if the CanDestroy permission for the block that is on fire would allow to punch it out and it actually does allow that. So if you ignite Bedrock for example and have a tool that has CanDestroy set for Bedrock you can actually punch out the fire. But in a map where you don't want players to be able to destroy the environment, just to be able to punch out fires that isn't really an option.
I'll say this again. Fire does not count. You can't see it in F3. You can't place a block on top of it, So why would you be able use an item with CanDestroy?
Fire is a non-solid block. It doesn't appear to have a hitbox, and can't be aimed at. I'm not sure CanDestroy is the most appropriate avenue for determining whether players can put out fires, considering its unusual properties.
You don't understand. NO block can destroy fire. CanDestroy does NOT change the minecraft code. It simply allows Survival rules to take over. CanDestroy doesn't work on water of lava either. Another example, you can create redstone dust with a CanPlaceOn:glass command but it won't work because minecraft isn't coded that way. This is indeed Works as Intended. Try it with lava or water.
Fire is a special block type, like water and lava and maybe some that I forgot to mention. They can't be broken by tools with this tag, because that would require special casing the behavior of these blocks.
The resolution can be changed to fixed, because it is fixed in the 1.16 snapshots, because fire now has a hitbox. So if you use this command: /give @p diamond_pickaxe{AttributeModifiers:[{AttributeName:generic.maxHealth,Amount:20,Operation:0,UUIDLeast:129265200,UUIDMost:99,Name:generic.maxHealth}],CanDestroy:[fire]} 1 You can use it to destroy fire.
This issue is still present in 14w11b.