minecraft:can_destroy_in_creative for you with a switch.Get GodCraftOverview
minecraft:can_destroy_in_creative is an item component: it goes in the components object of a custom item. Controls whether a player in Creative mode can break blocks while holding this item. Turn it off for items like swords or wands that should never break blocks by accident.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
value | boolean | false | Set to false to stop the item from breaking blocks in Creative mode. |
Example
Inside the components object of BP/items/<name>.json (values are the defaults or placeholders):
BP/items/<name>.json
{
"minecraft:can_destroy_in_creative": {
"value": false
}
}