Jump to content

[1.12.2] Custom potion effects


Zach17

Recommended Posts

Hello, I'm new to modding and still trying to figure out what I can and cannot do. I want to make a new potion effect that can be given to the player, whether with commands or with an actual potion item. The goal is to just create a Poison Resistance effect that negates any damage done to the player from poison. Can anybody point me in the right direction to do this?

Link to comment
Share on other sites

  • 2 months later...
14 hours ago, Spanospy said:

Full code examples would be useful. Any chance you can link one? (bonus points if it's 1.14 specific)

Just make the subclass and override the necessary methods.

 

Then make a registry class (which could be inside this one, doesn't matter) with @EventBusSubscriber annotation. Then, in this class, subscribe to Register<Potion> event, where you'd use the provided methods to register the option effect. It's similar to making normal items and blocks.

Edited by Differentiation
Link to comment
Share on other sites

37 minutes ago, Spanospy said:

Let me know if you can follow your own instructions.

I can follow both of their instructions. It's just that I think diesieben was using "Potion" because of 1.14.4 when you are using 1.12.2

 

37 minutes ago, Spanospy said:

Unsure about how to throw it into a potion item though, but I'll figure it out when I can be bothered.

If you mean create a Potion Item that uses your Potion instance. It should be automatic after you've registered your PotionType. Brewing them in another question.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

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.

Announcements



×
×
  • Create New...

Important Information

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