Перейти к содержимому
Mineforgian

xzutils

Useful and obscure. Provides enchantment reformatting for data manipulation.

Загрузки
15
Подписчики
0
Обновлён
10 марта 2026 г.
Лицензия
MIT

Опубликован 9 марта 2026 г.

XZUtils

XZUtils is a library designed to aid datapack developmnent in niche ways.

Functions

Enchantment Data Restructuring

Enchantment 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:

  1. in storage, set xzu:temp in to your enchantment map.
  2. run function xzu:enchant/build_enchantment_map/main
  3. 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.

Центр версий

1 версий
  • Бета61 КБ

Ченджлог

1.0.0Бета1.21.9, 1.21.10, 1.21.11 · 10 марта 2026 г.
  • Initial Release

Комментарии

Загружаем…