Importing the class

Link to importing-the-class

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 at the very top of the file.

ZenScript
Copy
import crafttweaker.api.item.component.PotionContents;

Extending Record

Link to extending-record

PotionContents extends Record. That means all methods available in Record are also available in PotionContents

Name: of

Return Type: PotionContents

ZenScript
Copy
PotionContents.of(potion as Potion) as PotionContents
ParameterType
Parameter
potion
Type
Potion

Name: of

Return Type: PotionContents

ZenScript
Copy
PotionContents.of(potion as Potion, customColour as int, customEffects as stdlib.List<MobEffectInstance>) as PotionContents
ParameterType
Parameter
potion
Type
Potion
Parameter
customColour
Type
int
Parameter
customEffects
Type
stdlib.List<MobEffectInstance>

Name: withEffectAdded

Return Type: PotionContents

ZenScript
Copy
PotionContents.withEffectAdded(effectInstance as MobEffectInstance) as PotionContents
ParameterType
Parameter
effectInstance
Type
MobEffectInstance
NameTypeHas GetterHas Setter
Name
color
Type
int
Has Getter
true
Has Setter
false
Name
customEffects
Type
stdlib.List<MobEffectInstance>
Has Getter
true
Has Setter
false
Name
hasEffects
Type
boolean
Has Getter
true
Has Setter
false