Hold To Enchant — Auto Enchant

Hold To Enchant — Auto Enchant

Simply Hold Your Tools To Enchant! (Achievement Friendly)

ModScript⬇ 2Updated 2 months ago
BeraGGBeraGG8 items

Screenshots

Hold To Enchant — Auto Enchant — screenshot 1
Hold To Enchant — Auto Enchant — screenshot 2
Hold To Enchant — Auto Enchant — screenshot 3
Hold To Enchant — Auto Enchant — screenshot 4
Hold To Enchant — Auto Enchant — screenshot 5
Hold To Enchant — Auto Enchant — screenshot 6

Description

Hold to Enchant is a script-based utility that immediately enchants the item you're holding to the max level. Simply hold an item, and the add-on handles the rest.

--- This add-on doesn't disable achievement.

MAIN FEATURES


Instant Enchanting — Automatically applies relevant enchants the moment you hold an item. Swords get Sharpness V, Looting III, Fire Aspect II, and Unbreaking III. Picks get Fortune III or Silk Touch. And so on.

Conflicting Enchantments — Use the configuration menu to choose between conflicting enchants like Silk Touch vs Fortune, Mending vs Infinity, or Depth Strider vs Frost Walker — no guesswork needed.

(NewBows add-on from SystemTv)

Universal Compatibility — Works for all vanilla tools, weapons, and armor, plus custom items from other add-ons.

Perfect combo with my other add-on Fortune Extender — Duplicate any block you mine with Fortune enchantment!


⚙️TECHNICAL DEEP-DIVE

The engine is event-driven, subscribing to playerHotbarSelectedSlotChange and playerInventoryItemChange instead of polling on a fixed interval. Enchanting only runs when the player switches hotbar slots or a new item lands in the active slot.

- It scans EquipmentSlot.Mainhand against a lookup table called ENCHANTABLE_ITEMS.

- Once a category is identified, buildCommands() generates a sequence of player.runCommand() calls tailored to that specific item type.

- For add-on compatibility, the script includes a namespace fallback. If a custom item like example:example_sword isn't found in the lookup table, the code strips the namespace and checks whether the ID ends with _sword, _axe, _pickaxe, etc., to assign the correct enchantment set automatically. This prevents the script from spamming attempts on items that can't be enchanted.

--- NOTE: Only vanilla enchantments supported!

PERFORMANCE

- Item Cache — To prevent the add-on from spamming commands every tick, it uses a Map with a "playerId:slot:typeId" composite key.

- Lightweight Footprint — Since the actual enchanting is delegated to native /enchant commands, JavaScript overhead is kept to a minimum.


CONFIGURATION


Type /ae:menu in chat to open your personal settings panel.

- Custom Command — Registered via customCommandRegistry on system.beforeEvents.startup, so it supports autocomplete and works even with cheats disabled. No custom item or entity required.

- Per-Player Persistence — Your preferences (like choosing Smite over Sharpness) are saved via player.setDynamicProperty(), so they persist across sessions.

- Item Toggles — Don't want your pickaxe auto-enchanted? You can disable it here

NEW IN VERSION 1.1.0:

- Enchant Blacklist — Blacklist an enchantment you don't want from aut**o **enchant specifically.

And DON'T FORGET to submit!


TECHNICAL SPECS

Type : Behavior Pack (Script)

Min Engine Version : 1.21.20

@minecraft/server : 2.6.0

@minecraft/server-ui : 2.0.0


HOW TO INSTALL

1. Download the .mcpack file.

2. Import to Minecraft.

3. In your world settings, activate the behavior pack.

Changelog

V1.2.8 UPDATE CHANGELOG

Added automatic enchanting when equipping armor pieces (Helmet, Chestplate (and Elytra), Leggings, Boots) and Offhand items (Can be turned off in the settings menu).

- Refined the notifications from this addon.

- Fixed minor bug where dropdown values resetting to default after turning off the master switch.

Achievement issue in 26.50/26.51 is a known Minecraft bug.

Download Files

HoldToEnchant v1.2.8 (release-200926)27 KB.mcpack
Older versions (7)
HoldToEnchant v1.2.5 (release-020726)27 KB.mcpack
HoldToEnchant V1.2.0 (release-040626)36 KB.mcpack
Hold To Enchant v1.1.5(release-300526)42 KB.mcpack
HoldToEnchant_v1.1.2 HOTFIX(041226)36 KB.mcpack
HoldToEnchant_v1.1.0(release-041126)36 KB.mcpack
HoldToEnchant_v1_0_1 HOTFIX(040926)62 KB.mcpack
HoldToEnchant_v1.0.0(release-040926)61 KB.mcpack
Source: MCPEDL · by BeraGG · CurseForge