A Minecraft mod. Downloads can be found on CurseForge and Modrinth.
As of Minecraft 1.21 enchantments have received a major implementation overhaul and are now fully controlled by data packs. For detailed instructions check out the Minecraft Wiki.
Universal Enchants only makes a few minor additions to vanilla's enchanting implementation now to help achieve its goal in a mod compatible way.
What items support which enchantments in vanilla is controlled via the supported_items
and primary_items
enchantment properties. Unfortunately vanilla reuses the tags used here between multiple enchantments, and so removing or supporting items for individual enchantments is a bit tricky.
Therefore Universal Enchants dynamically implements two additional item tags per enchantment for adding new items. One for adding to supported_items
, and a second one for primary_items
.
<namespace>:secondary_enchantable/<path>
for adding tosupported_items
<namespace>:primary_enchantable/<path>
for adding toprimary_items
minecraft:efficiency
→data/minecraft/tags/item/secondary_enchantable/efficiency.json
minecraft:efficiency
→data/minecraft/tags/item/primary_enchantable/efficiency.json
Furthermore what enchantments can be applied on a single item simultaneously is controlled via the exclusive_set
enchantment property. Once again vanilla reuses the same tag for multiple enchantments.
Here Universal Enchants also adds one additional enchantment tag per enchantment for overriding entries in the vanilla set, so that enchantment compatibility can be restored.
<namespace>:inclusive_set/<path>
minecraft:efficiency
→data/minecraft/tags/enchantment/inclusive_set/efficiency.json
Universal Enchants allows you to define what enchantments can be applied to what items, and which enchantments are compatible with each other (meaning can be applied on a single item at the same time). This is done via individual .json
config files (one per enchantment) found in .minecraft/config/universalenchants
.
The internal implementation of individual enchantments is rather complex and relies on a bunch of hard-coded special cases. All items enabled by default in the items
fields are guaranteed to work, everything beyond that is untested and probably does not work, especially modded enchantments.
.minecraft/config/universalenchants/minecraft/smite.json
{
"items": [
"$minecraft:weapon",
"$minecraft:universalenchants_axe",
"$minecraft:trident"
],
"incompatible": [
"minecraft:bane_of_arthropods",
"minecraft:impaling"
]
}
items
: The items this enchantment can be applied to in an enchanting table or anvil. This entry supports three kinds of values: single enchantments, enchantment tags (prefixed using#
) and built-in enchantment categories (prefixed using$
, see below). Each kind of entry can be set as an inverse, to force it to be excluded instead of included (see below). When this list is empty, the enchantment cannot be applied to any item. If the list entry is missing though, vanilla compatibility rules for accepted items will be used.incompatible
: Other enchantments that are incompatible with this enchantment (they cannot be applied together on a single item at the same time). An enchantment is always incompatible with itself, there is no setting for that. Setting an incompatibility for one of the relevant enchantments is enough for it to apply.
Each entry in items
(single enchantment, enchantment tag or enchantment category) can be inversed, allowing it to be excluded from other entries instead of included. This is useful when just a few values from a category or tag are not desired, to avoid having to include all contents of said category or tag manually minus the few supposed to be excluded.
To inverse an entry instead of
{
"items": [
"minecraft:diamond_pickaxe"
]
}
you add
{
"items": [
{
"id": "minecraft:diamond_pickaxe",
"exclude": true
}
]
}
When exclude
is set to false the entry will behave normally as without the exclude
tag.
This table includes vanilla's items compatible with each enchantment category. When other mods are installed, these categories will dynamically include additional items. Categories are shared here to be able to get a sense of the kind of items that are included.
Enchantment Category Id | Vanilla Items In Category |
---|---|
$minecraft:armor |
minecraft:golden_boots , minecraft:chainmail_chestplate , minecraft:leather_chestplate , minecraft:diamond_helmet , minecraft:leather_helmet , minecraft:turtle_helmet , minecraft:chainmail_helmet , minecraft:leather_boots , minecraft:diamond_chestplate , minecraft:iron_leggings , minecraft:golden_chestplate , minecraft:golden_helmet , minecraft:netherite_boots , minecraft:leather_leggings , minecraft:netherite_chestplate , minecraft:iron_chestplate , minecraft:chainmail_leggings , minecraft:iron_helmet , minecraft:golden_leggings , minecraft:netherite_leggings , minecraft:chainmail_boots , minecraft:diamond_boots , minecraft:iron_boots , minecraft:netherite_helmet , minecraft:diamond_leggings |
$minecraft:armor_feet |
minecraft:golden_boots , minecraft:chainmail_boots , minecraft:diamond_boots , minecraft:iron_boots , minecraft:leather_boots , minecraft:netherite_boots |
$minecraft:armor_legs |
minecraft:iron_leggings , minecraft:chainmail_leggings , minecraft:diamond_leggings , minecraft:golden_leggings , minecraft:netherite_leggings , minecraft:leather_leggings |
$minecraft:armor_chest |
minecraft:chainmail_chestplate , minecraft:netherite_chestplate , minecraft:diamond_chestplate , minecraft:leather_chestplate , minecraft:iron_chestplate , minecraft:golden_chestplate |
$minecraft:armor_head |
minecraft:netherite_helmet , minecraft:diamond_helmet , minecraft:leather_helmet , minecraft:iron_helmet , minecraft:turtle_helmet , minecraft:golden_helmet , minecraft:chainmail_helmet |
$minecraft:weapon |
minecraft:diamond_sword , minecraft:stone_sword , minecraft:iron_sword , minecraft:netherite_sword , minecraft:wooden_sword , minecraft:golden_sword |
$minecraft:digger |
minecraft:netherite_pickaxe , minecraft:wooden_axe , minecraft:diamond_shovel , minecraft:iron_shovel , minecraft:iron_axe , minecraft:stone_shovel , minecraft:golden_pickaxe , minecraft:wooden_hoe , minecraft:stone_axe , minecraft:golden_axe , minecraft:iron_pickaxe , minecraft:stone_hoe , minecraft:netherite_axe , minecraft:diamond_axe , minecraft:wooden_shovel , minecraft:golden_shovel , minecraft:diamond_pickaxe , minecraft:diamond_hoe , minecraft:iron_hoe , minecraft:golden_hoe , minecraft:netherite_shovel , minecraft:netherite_hoe , minecraft:wooden_pickaxe , minecraft:stone_pickaxe |
$minecraft:fishing_rod |
minecraft:fishing_rod |
$minecraft:trident |
minecraft:trident |
$minecraft:breakable |
minecraft:golden_boots , minecraft:wooden_axe , minecraft:iron_shovel , minecraft:iron_axe , minecraft:leather_helmet , minecraft:turtle_helmet , minecraft:golden_pickaxe , minecraft:warped_fungus_on_a_stick , minecraft:golden_axe , minecraft:leather_boots , minecraft:stone_hoe , minecraft:diamond_axe , minecraft:crossbow , minecraft:golden_shovel , minecraft:netherite_boots , minecraft:leather_leggings , minecraft:bow , minecraft:netherite_pickaxe , minecraft:iron_sword , minecraft:netherite_chestplate , minecraft:carrot_on_a_stick , minecraft:stone_shovel , minecraft:iron_helmet , minecraft:stone_axe , minecraft:diamond_boots , minecraft:golden_sword , minecraft:diamond_hoe , minecraft:iron_hoe , minecraft:netherite_shovel , minecraft:wooden_pickaxe , minecraft:shears , minecraft:chainmail_chestplate , minecraft:diamond_sword , minecraft:stone_sword , minecraft:leather_chestplate , minecraft:netherite_sword , minecraft:wooden_sword , minecraft:diamond_helmet , minecraft:fishing_rod , minecraft:wooden_hoe , minecraft:chainmail_helmet , minecraft:iron_pickaxe , minecraft:shield , minecraft:netherite_axe , minecraft:diamond_chestplate , minecraft:wooden_shovel , minecraft:iron_leggings , minecraft:trident , minecraft:golden_chestplate , minecraft:golden_helmet , minecraft:flint_and_steel , minecraft:stone_pickaxe , minecraft:iron_chestplate , minecraft:diamond_shovel , minecraft:chainmail_leggings , minecraft:golden_leggings , minecraft:netherite_leggings , minecraft:chainmail_boots , minecraft:iron_boots , minecraft:netherite_helmet , minecraft:diamond_leggings , minecraft:diamond_pickaxe , minecraft:golden_hoe , minecraft:netherite_hoe , minecraft:elytra |
$minecraft:bow |
minecraft:bow |
$minecraft:wearable |
minecraft:golden_boots , minecraft:chainmail_chestplate , minecraft:jack_o_lantern , minecraft:leather_chestplate , minecraft:dragon_head , minecraft:diamond_helmet , minecraft:leather_helmet , minecraft:turtle_helmet , minecraft:zombie_head , minecraft:chainmail_helmet , minecraft:leather_boots , minecraft:player_head , minecraft:diamond_chestplate , minecraft:iron_leggings , minecraft:wither_skeleton_skull , minecraft:golden_chestplate , minecraft:golden_helmet , minecraft:netherite_boots , minecraft:leather_leggings , minecraft:netherite_chestplate , minecraft:iron_chestplate , minecraft:chainmail_leggings , minecraft:iron_helmet , minecraft:golden_leggings , minecraft:netherite_leggings , minecraft:chainmail_boots , minecraft:diamond_boots , minecraft:creeper_head , minecraft:iron_boots , minecraft:carved_pumpkin , minecraft:netherite_helmet , minecraft:diamond_leggings , minecraft:skeleton_skull , minecraft:elytra |
$minecraft:crossbow |
minecraft:crossbow |
$minecraft:vanishable |
minecraft:golden_boots , minecraft:jack_o_lantern , minecraft:wooden_axe , minecraft:iron_shovel , minecraft:iron_axe , minecraft:leather_helmet , minecraft:turtle_helmet , minecraft:golden_pickaxe , minecraft:warped_fungus_on_a_stick , minecraft:golden_axe , minecraft:leather_boots , minecraft:stone_hoe , minecraft:player_head , minecraft:diamond_axe , minecraft:crossbow , minecraft:golden_shovel , minecraft:compass , minecraft:netherite_boots , minecraft:leather_leggings , minecraft:bow , minecraft:netherite_pickaxe , minecraft:iron_sword , minecraft:netherite_chestplate , minecraft:carrot_on_a_stick , minecraft:stone_shovel , minecraft:iron_helmet , minecraft:stone_axe , minecraft:diamond_boots , minecraft:carved_pumpkin , minecraft:golden_sword , minecraft:diamond_hoe , minecraft:iron_hoe , minecraft:netherite_shovel , minecraft:wooden_pickaxe , minecraft:shears , minecraft:chainmail_chestplate , minecraft:diamond_sword , minecraft:stone_sword , minecraft:leather_chestplate , minecraft:netherite_sword , minecraft:wooden_sword , minecraft:dragon_head , minecraft:diamond_helmet , minecraft:zombie_head , minecraft:fishing_rod , minecraft:wooden_hoe , minecraft:chainmail_helmet , minecraft:iron_pickaxe , minecraft:shield , minecraft:netherite_axe , minecraft:diamond_chestplate , minecraft:wooden_shovel , minecraft:iron_leggings , minecraft:trident , minecraft:wither_skeleton_skull , minecraft:golden_chestplate , minecraft:golden_helmet , minecraft:flint_and_steel , minecraft:stone_pickaxe , minecraft:iron_chestplate , minecraft:diamond_shovel , minecraft:chainmail_leggings , minecraft:golden_leggings , minecraft:netherite_leggings , minecraft:chainmail_boots , minecraft:creeper_head , minecraft:iron_boots , minecraft:netherite_helmet , minecraft:diamond_leggings , minecraft:diamond_pickaxe , minecraft:skeleton_skull , minecraft:golden_hoe , minecraft:netherite_hoe , minecraft:elytra |
$minecraft:universal_enchants_axe |
minecraft:wooden_axe , minecraft:netherite_axe , minecraft:diamond_axe , minecraft:iron_axe , minecraft:stone_axe , minecraft:golden_axe |
$minecraft:universal_enchants_horse_armor |
minecraft:golden_horse_armor , minecraft:diamond_horse_armor , minecraft:leather_horse_armor , minecraft:iron_horse_armor |
$minecraft:universal_enchants_shield |
minecraft:shield |