
XZUtils
XZUtils is a library designed to aid datapack developmnent in niche ways.
Functions
Enchantment Data RestructuringEnchantment data is stored in items like so:
{id:level,id:level}
This is difficult to work with. This outputs a copy formatted as [{id:<name>,level:<value>},{id:<name>,level:<value>}] for easy enchantment manipulation.
ie;
{"minecraft:sharpness":5,"minecraft:looting":2}
converts to
[{"id":"minecraft:sharpness","level":5},{"id":"minecraft:looting","level":2}]
USAGE:
- in storage, set
xzu:temp into your enchantment map. - run
function xzu:enchant/build_enchantment_map/main - your formatted map is located in
xzu:temp out
Example:
# put enchantments from players held item in storage input
data modify storage xzu:temp in set from entity @p SelectedItem.components."minecraft:enchantments"
# convert map
function xzu:enchant/build_enchantment_map/main
# see formatted data
data get storage xzu:temp out
NOTE: This requires 0 0 to be chunkloaded, and will set 0 0 0 to be air. XZUtils handles this automatically, but there will be an air block at 0 0 0 every time this function is used.
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.21.5, 1.21.6, 1.21.7
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Modrinth — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — see the MC Java Mods guides for the full walkthrough.
- Downloads as xzutils.zip
- Download size: 61 KB
- Download link checked 24 Aug 2026 — working
These come from our own check of the pack file, not from the source page.