Posted December 20, 20222 yr I am fairly new and am not sure how to use the canEnchant() method. How do I specify what items can be enchanted? How do i define the pStack
December 20, 20222 yr Normally you wouldn't override that method. You pick an EnchantmentCategory and that decides which items it applies to, see that class. You can use your IDE to search for vanilla enchantments that do override it. e.g. the DiggerEnchantment overrides it to also allow it to be applied to shears which isn't a DiggerItem Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
December 20, 20222 yr Author Thank you very much for this info! however it lead me to a new question, how would i go about adding a new EnchantmentCategory?
December 20, 20222 yr EnchantmentCategory implements IExtensibleEnum Here's a simple example I found using a github search: https://github.com/search?q=EnchantmentCategory&type=code https://github.com/vemerion/Runeworld/blob/7865c63faf41e47885113f73ab125efdad4b0fa8/src/main/java/mod/vemerion/runeworld/enchantment/ModEnchantmentCategories.java Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.