Build data-driven enchantment JSON with effect components, and armor trim pattern/material JSON — for 1.21+ datapacks.
How to use this tool, and the questions players ask most.
Execute /give @p diamond_sword[enchantments={levels:{"namespace:enchantment_name":1}}] 1 in Minecraft 1.21 or higher. This command applies data-driven enchantment definitions stored under the data/namespace/enchantment/ directory directly to an item in player inventory.
Specify level values up to 255 using /give @p diamond_sword[enchantments={levels:{"minecraft:sharpness":10}}] 1 in 1.21. In custom datapacks, define the max_level integer value between 1 and 255 inside the enchantment JSON file.
Bedrock Edition does not support data-driven enchantments through vanilla JSON files. Creating custom enchantment effects on Bedrock requires custom item components, animation controllers, or JavaScript scripting through @minecraft/server version 1.20 or newer behavior packs rather than Java datapacks.
Add your custom enchantment ID to the tag file at data/minecraft/tags/enchantment/in_enchanting_table.json. The enchantment JSON must also specify positive integer values for min_cost and max_cost to calculate table power requirements up to level 30.
Create a trim_pattern JSON file inside data/namespace/trim_pattern/ and define the smithing template item ID in Minecraft 1.20 or later. You can build these data files with the Custom Enchantment & Trim Builder.
Other tools on 9Minecraft you may find useful.
Other tools on 9Minecraft you may find useful.