Compatibility
Minecraft: Java Edition
Platforms
Supported environments
Links
Tags
Creators
Details
Better Enchant Commands
Override /enchant, /give, and friends with extended enchantment levels, simplified syntax, presets, and an audited confirmation/undo workflow for Minecraft 1.21.x.
Vanilla /enchant refuses non-integer levels and caps out where the enchantment says so. Vanilla /give needs verbose component syntax for enchanted items. Better Enchant Commands replaces the two core commands and adds a handful of workflow helpers, all gated behind op level 2 and backed by a structured audit log.
Features
/enchant โ enchant beyond vanilla limits
Drop-in replacement for vanilla /enchant. Apply any enchantment to the item in a player's hand at levels 1โ255.
/enchant @s minecraft:sharpness 255/enchant aGamingGod minecraft:protection 10/enchant list
/enchant list prints the enchantments on the held item of the player running the command.
/give โ inline enchantment syntax
Drop-in replacement for vanilla /give. Works exactly like normal when used without enchantments. Append an optional enchantments: block for instant enchanted items:
/give @s minecraft:netherite_chestplate enchantments:protection:10,unbreaking:3/give @s minecraft:diamond_sword 1 enchantments:sharpness:255,fire_aspect:5,looting:10
The minecraft: namespace is optional โ sharpness:255 works. No JSON, no brackets, no quotes. Tab completion filters candidates to enchantments actually compatible with the chosen item.
/enchantpreset โ save and replay enchantment bundles
/enchantpreset save <name>โ save currently-held item's enchantments/enchantpreset apply <name> <targets>/enchantpreset delete <name>/enchantpreset list
Names are validated (1โ64 chars, AโZ, aโz, 0โ9, _, -). Skipped empty-hand targets are reported in the output.
/unenchant, /enchantinfo, /enchantlist
Cleanup and inspection helpers:
/unenchant <targets>โ strip all enchantments/unenchant <targets> <enchantment>โ strip one/enchantinfoโ full detail on held item/enchantlist [filter]โ registry listing, optionally filtered
/repair โ mended gear in one command
Hands out a copy of any item with Mending (and Unbreaking III where compatible) pre-applied. The reflective compat lookup is cached per session so repeat invocations are fast.
/enchants โ bulk operations, undo, and config
/enchants undoโ restore your last bulk modification/enchants confirm <token>โ complete a gated bulk operation/enchants status/enchants allow_all_enchantments true|false
Operations over confirmation_threshold targets require a short-lived token โ no more accidental "enchanted the entire server" incidents. Undo is a bounded per-operator deque (default 8 entries).
Design highlights
- Fail-safe validation. Enchantment strings parse into fully-validated
(Identifier, level)pairs before any item is touched. Parse failures leave items unmodified. - Structured audit log. Every privileged action is emitted to a dedicated SLF4J
[AUDIT]logger with sanitised operator, target, and label fields โ safe to route to a log-aggregation pipeline. - Log-injection hardened. Any string originating from player input is stripped of ASCII control characters before being formatted into log lines, so a crafted scoreboard name can't forge or break audit entries.
- Bounded bulk modifications. Commands that affect more targets than
confirmation_thresholdrequire a token-based confirmation round-trip. - Reflective compatibility layer. Permission checks, registry lookups, and component reads resolve via method-shape heuristics cached per class, so the same jar runs across all 1.21.x minor versions without recompilation.
- Zero mixins. Pure Fabric API command registration โ maximum compatibility with other mods.
- Server-side only. Clients don't need the mod installed.
Why Better Enchant Commands?
- Drop-in replacements. Overrides vanilla
/enchantand/givedirectly; no new commands to memorise for the core workflow. - Fully backward compatible.
/give @s diamond 64still works exactly like vanilla. - Lightweight. ~105 KB, server-side only, no tick hooks, no mixins.
- Crash-proof. Every code path is defensively wrapped; malformed input gives helpful error messages, never a server crash.
- Cross-version. Built against 1.21 base โ works on every 1.21.x subversion without recompilation.
- Preset-driven workflow. Save standard loadouts once; apply them to any number of players with one command.
- Audit trail. Operators can be held accountable for what they enchanted, for whom, and when.
Requirements
- Minecraft 1.21.x (any subversion)
- Fabric Loader 0.16.0+
- Fabric API
Permissions
All commands require operator level 2, matching vanilla /enchant and /give.
Technical notes
Better Enchant Commands writes directly to the DataComponents.ENCHANTMENTS component on item stacks, bypassing vanilla's level validation but enforcing its own bounds (1โ255). Enchantments are stored exactly like vanilla ones โ no custom data, no compatibility issues with other mods reading your items.

