Topic category: User side tutorials
This is a very easy one and takes less than a couple of minutes to do. There's technically only one step you need to do. So, if you want to set the duration of your potion (which I assume you would because you clicked on this topic) simply edit the code of your potion and search for the line "public static class PotionTypeCustom extends PotionType". Under that line you'll see these lines:
public PotionTypeCustom() {
super(new PotionEffect[]{new PotionEffect(potion, 3600)});
setRegistryName("<YourCustomPotionsName>");
What you need to edit is "3600" that's how long your potion lasts in mc ticks. 20 mc ticks = 1 second, so 1 minute = 1200, 2 minutes = 2400 and so on. And there we go you have your custom duration. Remember to lock your elements code so it won't get overwritten!
Yah, but you can just create a food that gives the effect
no cause then you won't get a splash potion, tipped arrow and more...
well at least you can have the normal one...