Description
Refund XP Enchant
Minecraft: Bedrock Edition | Behavior Pack | v1 (achievement friendly)
Refund XP Enchant automatically attempts to restore 1–3 XP levels when a player's level drops near an enchanting table. It uses Minecraft's ordinary enchanting table; lapis lazuli is still required. Successful refunds display a chat message and play a level-up sound.
Key Features
- Checks each player's XP level every 4 game ticks (around 0.2 seconds at 20 TPS).
- Detects a 1, 2, or 3 level decrease since the previous check.
- Only attempts to refund when an enchanting table is found within 5 blocks in X/Z and 3 blocks in Y, measured by block coordinates relative to the player's current block.
- Restores levels with player.addLevels(lost) when no cooldown is active.
- Displays a message, for example: [Refund XP] Refunded 2 levels!.
- Plays the Minecraft level-up sound (random.levelup).
- Uses a 40-game-tick cooldown after a refund (around 2 seconds at 20 TPS).
- Clears player-tracking information after the player leaves the world.
How to use
1. Back up your world before installing or updating an add-on.
2. Download and import from the .mcpack/.mcaddon file or extract them and copy paste them into the behavior packs folder .
3. In world settings, enable Refund XP Enchant under Behavior Packs.
4. Use a normal enchanting table and lapis lazuli. If the script notices a decrease of 1–3 levels while you are close enough to a table, it attempts to refund the levels.
5. Check chat for the green confirmation message.
- No custom crafting recipe, enchanting GUI, configurable settings, or resource pack was provided.
= Achievement compatibility
Support TechFreq ❤️
Thanks for downloading and supporting my Minecraft add-ons and modpacks! I really appreciate everyone who tries my projects. Feel free to check out my other mods, follow my socials, or send over a cup of coffee if you'd like — totally optional, of course! ☕
Everything TechFreq:
[https://beacons.ai/TechFreq](https://beacons.ai/TechFreq)
PayPal — Optional Support
[https://paypal.me/TechFreq](https://paypal.me/TechFreq)
More Mods on CurseForge
[https://www.curseforge.com/members/techfreq/projects](https://www.curseforge.com/members/techfreq/projects)
More Mods on Nexus Mods:
[https://www.nexusmods.com/profile/TechFreq](https://www.nexusmods.com/profile/TechFreq)
Made by TechFreq — Happy Enchanting! ✨⚔️



