Injection Press Enchanted Books Not Usable
EntropyParadigm opened this issue ยท 3 comments
Enchanted books always seem to cause me issues and it is down to the Enchantments vs StoredEnchantments - I though I had it right this time.
There are two ways to apply enchantments one is ItemStack.addEnchantment (Enchantments NBT) and a special one for EnchantedBookItem.addEnchantment (StoredEnchantments NBT). Looks like I'm using the wrong one again .
Fixed - output books now have the following NBT style straight from EnchantedBookItem:
Validated by using each of the test produced books in anvil with a diamond sword.
{id: "minecraft:enchanted_book", Count: 1b, tag: {StoredEnchantments: [{lvl: 1s, id: "minecraft:power"}]}}
{id: "minecraft:enchanted_book", Count: 1b, tag: {StoredEnchantments: [{lvl: 2s, id: "minecraft:quick_charge"}]}}
{id: "minecraft:enchanted_book", Count: 1b, tag: {StoredEnchantments: [{lvl: 3s, id: "minecraft:loyalty"}]}}
{id: "minecraft:enchanted_book", Count: 1b, tag: {StoredEnchantments: [{lvl: 4s, id: "minecraft:sharpness"}]}}
{id: "minecraft:enchanted_book", Count: 1b, tag: {StoredEnchantments: [{lvl: 5s, id: "minecraft:power"}]}}