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.

[1.16.5] Unwanted Potions automatically generated in vanilla Creative Tabs

Featured Replies

Posted

Hello,

I'm currently making an effect and custom potions and it works fine and all, but in the Brewing and Weapons vanilla tabs there is automatically generated potions with my effect (potion, splashpotion, lingering potion and tipped arrows).

For example, here is my custom potion :

Spoiler

custom_potion.png.40ad29fbb0e7be1b9d9e1da11dd0b568.png

And here is the automatically generated potion :

Spoiler

auto_potion.png.1d28e806108daaeb02e6f771c8988d18.png

 

I found a method in the PotionItem and I think it may be related to this :

public void fillItemCategory(ItemGroup p_150895_1_, NonNullList<ItemStack> p_150895_2_) {
      if (this.allowdedIn(p_150895_1_)) {
         for(Potion potion : Registry.POTION) {
            if (potion != Potions.EMPTY) {
               p_150895_2_.add(PotionUtils.setPotion(new ItemStack(this), potion));
            }
         }
      }
}

 

Here is my ModPotions class :

public class ModPotions
{
    public static final RegistryObject<Effect> ASTRAAL_EFFECT = Registration.EFFECTS.register("astraal",
            () -> new ModEffect(EffectType.BENEFICIAL, 0xFF2AC8F2));

    public static final RegistryObject<Potion> ASTRAAL_POTION = Registration.POTIONS.register("astraal",
            () -> new Potion(new EffectInstance(ASTRAAL_EFFECT.get(), 3500, 0)));

    public static final RegistryObject<Potion> LONG_ASTRAAL_POTION = Registration.POTIONS.register("long_astraal",
            () -> new Potion(new EffectInstance(ASTRAAL_EFFECT.get(), 6500, 0)));

    public static final RegistryObject<Potion> STRONG_ASTRAAL_POTION = Registration.POTIONS.register("strong_astraal",
            () -> new Potion(new EffectInstance(ASTRAAL_EFFECT.get(), 3500, 1)));
}

 

For each new Potion I'm making, there is a potion and all its variants generated in the vanilla tabs.

I fail to see what I should do to fix this, so any sort of help is appreciated, thank you all in advance.

9 hours ago, Dakuro said:

For each new Potion I'm making, there is a potion and all its variants generated in the vanilla tabs.

I fail to see what I should do to fix this, so any sort of help is appreciated, thank you all in advance.

its not possible to fix that, because there is no event to modify this
It shouldn't really matter because there are no recipes for the potions, so you can't get them in survival

 

9 hours ago, Dakuro said:

Registration.EFFECTS

You should also put your DeferredRegisters in the same class as the associated RegistryObjects, since this can usually lead to problems

 

  • Author

Thank you for your response!

16 minutes ago, Luis_ST said:

its not possible to fix that, because there is no event to modify this
It shouldn't really matter because there are no recipes for the potions, so you can't get them in survival

Oh well, yes that's not so important, I just thought it would be inconsistent to have unwanted potions in the vanilla tabs, but we can't do anything about it.

 

18 minutes ago, Luis_ST said:

You should also put your DeferredRegisters in the same class as the associated RegistryObjects, since this can usually lead to problems

Oh I wasn't aware this was really important, than you for the tip! Just for my curiosity, what kind of problems could it cause?

45 minutes ago, Dakuro said:

Just for my curiosity, what kind of problems could it cause?

I'm not 100% sure because I've never tested it myself, but I think NullPointerException and ExceptionInInitializerError
-> putting the DeferredRegister in the class of the RegistryObjects ensures that the class is loaded

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.