Arqade Asked by zombie1111 on November 20, 2020
If you use commands to get a book with an enchantment past its max level, and then you try to combine it with a sword or other tool in an anvil, the anvil will only give you the maximum level of that enchantment, even if the level on the book is higher. Is there any way to bypass this?
The only way I know of is making a custom system where you would drop the enchanted book on the ground. But if I have many levels of enchantment books in my map it will require way too many command blocks unless there already is a datapack for it. There is probably a mod that will make this work, but I don’t want to take the path of using mods unless this problem is unsolvable in vanilla.
See example video below:
Here's a setup that works for one enchantment on the enchanted book only.
execute as @e[type=item,nbt={Item:{id:"minecraft:diamond_sword"}}] if entity @e[type=item,nbt={Item:{id:"minecraft:enchanted_book"}}] if entity @s[nbt={Item:{tag:{Enchantments:[]}}}] run data modify entity @s Item.tag.Enchantments set value []
execute as @e[type=item,nbt={Item:{id:"minecraft:diamond_sword"}}] at @s run data modify entity @s Item.tag.Enchantments append from entity @e[type=item,limit=1,distance=0..0.5,nbt={Item:{id:"minecraft:enchanted_book"}}] Item.tag.StoredEnchantments[0]
execute as @e[type=item,nbt={Item:{id:"minecraft:enchanted_book"}}] at @s if entity @e[type=item,nbt={Item:{id:"minecraft:diamond_sword"}},distance=0..0.5] run kill @s
Explanation:
Enchantments
tag. If it doesn't, add it.Correct answer by ExpertCoder14 on November 20, 2020
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP