Open
Description
By using the Enchantment#register method and setting the second argument (registerItem) to true, doesn't register ALL enchantment books correctly. Even though having an enchantment with MaxLevel 5, it only registers the book for level one.
Why does this happen?
The reason may be that all custom registered books use the same NamespaceId of the Enchantment, which results in all other enchantment books after level one not being registered, since there already is one with the same NamespaceId registered.
https://github.com/PowerNukkitX/PowerNukkitX/blob/1dfc7db755ecd638366d65caf4c1c179817841da/src/main/java/cn/nukkit/item/enchantment/Enchantment.java#L367
I created my own EnchantmentBook classes with unique NamespaceIds and it worked like a charm.
📋 Debug information
- PowerNukkit version: 1.20.10-r1
Metadata
Metadata
Assignees
Labels
No labels