Jump to content

[1.16.5] Unwanted Potions automatically generated in vanilla Creative Tabs


Dakuro

Recommended Posts

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.

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

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.