PotionContents

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.item.component.PotionContents;

Members

Getter
script.zs
// PotionContents.color as int
myPotionContents.color

Return Type: int

Getter
script.zs
// PotionContents.customEffects as List<MobEffectInstance>
myPotionContents.customEffects

Return Type: List<MobEffectInstance>

Getter
script.zs
// PotionContents.hasEffects as bool
myPotionContents.hasEffects

Return Type: bool

static of(potion as Potion, customColour as int, customEffects as List<MobEffectInstance>) as PotionContents
script.zs
// PotionContents.of(potion as Potion, customColour as int, customEffects as List<MobEffectInstance>) as PotionContents;
PotionContents.of(myPotion, myInt, myList);

Parameters:

potion Type: Potion
customColour Type: int
customEffects Type: List<MobEffectInstance>

Return Type: PotionContents

static of(potion as Potion) as PotionContents
script.zs
// PotionContents.of(potion as Potion) as PotionContents;
PotionContents.of(myPotion);

Parameters:

potion Type: Potion

Return Type: PotionContents

withEffectAdded(effectInstance as MobEffectInstance) as PotionContents
script.zs
// PotionContents.withEffectAdded(effectInstance as MobEffectInstance) as PotionContents;
myPotionContents.withEffectAdded(myMobEffectInstance);

Parameters:

effectInstance Type: MobEffectInstance

Return Type: PotionContents