An IPotion object refers a potion in the game.

Импорт пакета

Link to импорт-пакета

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import.
import crafttweaker.potions.IPotion;

Getting an IPotion object

Link to getting-an-ipotion-object

You can get such an object through the use of the Potion Bracket handler

ZenScript
Copy
<potion:minecraft:strength>;
ГеттерWhat does it doВозвращаемый тип
Геттер
name
What does it do
Returns the potion's internal name
Возвращаемый тип
string
Геттер
badEffect
What does it do
Returns if the potion effect is bad
Возвращаемый тип
bool
Геттер
liquidColor
What does it do
Returns the potion's color
Возвращаемый тип
int
Геттер
liquidColour
What does it do
Returns the potion's colour
Возвращаемый тип
int
Геттер
curativeItems
What does it do
Returns a list of all curative Items for the potion
Возвращаемый тип
List<IItemStack>
Геттер
hasStatusIcon
What does it do
Returns whether the potion has a status icon
Возвращаемый тип
bool
Геттер
isBeneficial
What does it do
Returns whether the potion is beneficial
Возвращаемый тип
bool
Геттер
isInstant
What does it do
Returns whether the potion is instant
Возвращаемый тип
bool

Make PotionEffect

Link to make-potioneffect

An IPotionEffect is a Potion that has a duration and amplifier. You can use these two methods to get one from an IPotion:
As one might guess, both return an IPotionEffect object.

ZenScript
Copy
pot.makePotionEffect(int duration, int amplifier);
pot.makePotionEffect(int duration, int amplifier, boolean ambientEffect, boolean particlesShown);