Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

  • Author

I changed it because you can't do "potion." and name the potion, that is no longer an option in 1.9.

~ Ronaldi2001

  • Author

So how would I code it so that way the night vision is on for 220 ticks? I'm so confused...

~ Ronaldi2001

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.

  • Author

That worked. What he was saying made no sense to me at all but now that I see it I get it.

~ Ronaldi2001

Guest
This topic is now closed to further replies.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.