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

Hello all,

In my mod I have it so that when pressing a key under special circumstances the player gets a potion effect, or rather a lot of effects.

 

I've been searching for methods to add Potion Effects without the annoying GUI-Display (which shifts your Inventory over to the right) for quite a long time, but I haven't found anything good yet.

 

I tried removing the effects as soon as you open the Inventory, but it has a tiny very annoying delay, I tried doing it with ".performEffect", which doesn't work for all potions, and I tried replicating the effects of the potions, but there are some (like Night-vision) that are pretty hard to do.

 

I know where the Inventory Render gets called (InventoryEffectRenderer.displayDebuffEffects), but I can't hinder minecraft from doing it…

 

Now my question, is there any good way to add potion effects without the display in the Inventory?

 

Thanks,

Max

  • 7 months later...

I am trying to do the same thing. So far I have realized that the EntityLiving class has an updatePotionEffects method which takes the hashmap( a hashmap is sort of like an array, but each cell of the array has several attributes) of potioneffects curerntly on the living entity and displays them. There are no parameters to the method, so we cannot modify the way the potioneffects are rendered. However, there are several other ways to achieve our goal:

 

  1. Mimic the commands of instantiating a potioneffect on the living entity in a food item, armor, or such class without adding it to the living entity's potioneffect hashmap( I tried this on a custom food item, still trying to get it to work)

 

  2. Creating a custom class that extends EntityLiving and rewriting the updatePotionEffects method. One would have to change the instance of the player that the potioneffect is suppose to be affecting from a EntityLivingBase to a XXXX class that extends EntityLivingBase

 

Try the first option and I will try the second option. This way we can collaborate on our mutual dilemma. =)

Make a entityLivingEvent handler and then look if this key is pressed: Add the player who pressed the key a potioneffect.

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...

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.