Jump to content

[Solved] Potion effects on armor


Recommended Posts

I am porting my mod over to 1.9 and I have night vision on my helmet. In 1.7.10 this is the code I used:

player.addPotionEffect(new PotionEffect(Potion.nightVision.getId(), 220, 0));

What I ported over so far is:

player.addPotionEffect(new PotionEffect (Potion.getPotionById(16)));

but the potion effect doesn't last long, and because of that the screen flashes. All the help will be appropriated.

~ Ronaldi2001

Link to comment
Share on other sites

player.addPotionEffect(new PotionEffect (Potion.getPotionById(16), 220, 0));

?  Seriously, how hard is it to add the parameters you removed back in?


Except you'd replace the hardcoded ID with MobEffects as mentioned earlier.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.


Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.


DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

This topic is now closed to further replies.


  • Create New...

Important Information

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