-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EnchantmentBook Registration always with same NamespaceID -> Override #9
Comments
Hello @Verox001 we need more information to be able to solve the problem like for example your custom NamespaceId or even an in-game image and your code it can be useful |
@AzaleeX Could you have a look at this please? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
The text was updated successfully, but these errors were encountered: