Universal Tweaks

Universal Tweaks

871k Downloads

Item Stage ingredient matching tweak can cause issues with enchanted books if there is a staged enchant

jchung01 opened this issue ยท 0 comments

commented

If Ingredient Matching=true for the Item Stages mod integration, enchanted books may show as unfamiliar if any enchantment has been staged with mods.ItemStages.stageEnchant(). To elaborate, this is only under the following conditions:

  1. Ingredient Matching=true under Item Stages category in UT Mod Integration config
  2. An enchant has been staged with mods.ItemStages.stageEnchant()
  3. The enchanted book you are looking at has any other NBT data other than StoredEnchantments (for example, RepairCost or a name)
    This will result in the enchanted book being an unfamiliar item, staged according to 2)'s stage.

Example:

  • Using Universal Tweaks with Ingredient Matching=true under Item Stages integration, ItemStages and its dependencies.
  • With ItemStages installed, make a CT script with the following: mods.ItemStages.stageEnchant("stage1", <enchantment:minecraft:sharpness>); This should only stage sharpness enchanted books.
  • Try to combine 2 enchanted books that are not sharpness. Here I combine two Protection I books. This will add a RepairCost to the resultant book's NBT tag.
  • You will see the resulting book is an unfamiliar item. This book can still be applied properly on armor to get Protection II.

Seems like CrT's way of ingredient matching doesn't quite work as expected for comparing NBT data in this scenario. Disabling the tweak recovers the tooltip.

Should be Protection II, is an unfamiliar item
2024-03-15_17 26 46
Output of the book with /ct hand
2024-03-15_17 27 21
A Protection II book made from /ct give <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 2 as short, id: 0 as short}]}), notice it shows tooltip correctly
2024-03-15_17 30 22