minecraft:enchantable for you with a switch.Get GodCraftOverview
minecraft:enchantable is an item component: it goes in the components object of a custom item. Allows the item to be enchanted and chooses which group of enchantments it accepts. An enchantment only works if the item also has the matching behavior.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
value | integer | none | Enchantability: higher numbers give better enchantments at the enchanting table.Range: 0 to … |
slot | string | none | Which enchantment group the item uses, for example "sword", "bow" or "armor_head". |
Example
Inside the components object of BP/items/<name>.json (values are the defaults or placeholders):
BP/items/<name>.json
{
"minecraft:enchantable": {
"value": 0,
"slot": ""
}
}