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>;
ZengetterWhat does it do戻り値
Zengetter
name
What does it do
Returns the potion's internal name
戻り値
string
Zengetter
badEffect
What does it do
Returns if the potion effect is bad
戻り値
bool
Zengetter
liquidColor
What does it do
Returns the potion's color
戻り値
int
Zengetter
liquidColour
What does it do
Returns the potion's colour
戻り値
int
Zengetter
curativeItems
What does it do
Returns a list of all curative Items for the potion
戻り値
List<IItemStack>
Zengetter
hasStatusIcon
What does it do
Returns whether the potion has a status icon
戻り値
bool
Zengetter
isBeneficial
What does it do
Returns whether the potion is beneficial
戻り値
bool
Zengetter
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);