Azrock Posted June 23, 2022 Posted June 23, 2022 (edited) Hi! I've been looking for the past hours if there was an answer to my question and it appear like there aren't any recent answers for the version I am using. I am trying to create a simple item that has an enchanted glow to it just like the nether star has. Previous versions seemed to simply extend the Item class and then override the hasEffect(ItemStack) method. However, it looks like this method does not exist in newer versions. Unless I have not correctly setup my environment (which I may have, I am relatively new to modding,) would anyone know the new way to apply an enchanted glow to items, maybe through a specific NBT tag ? Thank you very much for any help! Edited June 23, 2022 by Azrock Quote
JimiIT92 Posted June 23, 2022 Posted June 23, 2022 In 1.18 there was the Item#isFoil method. I think it is the same in 1.19, however you can always look at the NetherStar Item class or how the Item is registered to ser how this is achieved in Vanilla Quote Don't blame me if i always ask for your help. I just want to learn to be better
Azrock Posted June 23, 2022 Author Posted June 23, 2022 (edited) Thank you for the help! I took a look at how the NETHER_STAR item was defined and it simply used the SimpleFoiledItem so I tried and it worked fine. But since I'll need the item to have some more interesting behaviour later and I don't necessarily want the SimpleFoiledItem, I still went with a custom class extending Item and tested by overriding the isFoil() method to true and.. it worked too! Guess the new method is not hasEffect() but isFoil() now! Once again, thank alot, didn't think I could go and look into the files this easily since I'm used to having my libs obfuscated ^^ Edited June 23, 2022 by Azrock 1 Quote
Recommended Posts
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.