Posted July 22, 20214 yr 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 And here is the automatically generated potion : Spoiler 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.
July 23, 20214 yr 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
July 23, 20214 yr 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?
July 23, 20214 yr 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.