Jump to content

[SOLVED] [1.19] Item Enchanted Glow


Azrock

Recommended Posts

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 by Azrock
Link to comment
Share on other sites

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 :)

Don't blame me if i always ask for your help. I just want to learn to be better :)

Link to comment
Share on other sites

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 by Azrock
  • Thanks 1
Link to comment
Share on other sites

  • Azrock changed the title to [SOLVED] [1.19] Item Enchanted Glow

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.