Jump to content

[1.14.4] How do I remove custom splash and lingering potion variants?


BlockyPenguin

Recommended Posts

Okay, so this is kind of a follow-up to this post, so, I've now made a potion, and in the creative inventory, it appears. So do the Lingering and Splash variants. I do not want this. In the aforementioned post, diesieben07 mentioned using an IBrewingRecipe to do this. I have tried creating one for my potion, but I ended up deleting it in favour of BrewingRecipeRegistry.addRecipe(). However, my recipe doesn't work (I can't even insert my custom item that I want to use as an ingredient into a brewing stand), and I've no idea where in an IBrewingRecipe I''d disable potion variants. I'm 100% new to potions, how would I do this?

 

All help appreciated!

 

[Merged from a comment and edited to fit the present]

Okay, now, I've made a new IBrewingRecipe class called FlyingPotionRecipe, here's the code:

package ...

import ...

public class FlyingPotionRecipe implements IBrewingRecipe {
	
	private ItemStack output = PotionUtils.addPotionToItemStack(new ItemStack(Items.POTION), ModPotions.FLYING_POTION);

	@Override
	public boolean isInput(ItemStack input) {
		return input.getItem() == PotionUtils.addPotionToItemStack(input, Potions.WATER).getItem();
	}

	@Override
	public boolean isIngredient(ItemStack ingredient) {
		return ingredient.getItem() == ModItems.GOLDEN_FEATHER;
	}

	@Override
	public ItemStack getOutput(ItemStack input, ItemStack ingredient) {
		return PotionUtils.addPotionToItemStack(output, ModPotions.FLYING_POTION);
	}

}

So, I've tested that now, and all looks good, but where in here would I set the splash and lingering potions on/off? TIA!

Edited by BlockyPenguin
Made title more descriptive

Today (22/10/20) I reached 100 posts!

I'm probably more excited than I should be for something so realistically minor...

Link to comment
Share on other sites

I was trying to check if what was in the input slot is the correct input (a water bottle)... I'm guessing that's not what it does? I couldn't find much up-to-date documentation on brewing, sorry if this is an obvious solution.

EDIT: So I've done some digging and I think what  you saying is to check if the input is a splash water bottle, right? Please bear in mind, I'd like these potions to completely disappear from the game, even the creative inventory. If I'm right, making sure that the input is not a splash potion won't remove it from the registry.

Edited by BlockyPenguin

Today (22/10/20) I reached 100 posts!

I'm probably more excited than I should be for something so realistically minor...

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.