Home Commands Examples Getting Started With Scripts Global Keywords 1.21 Migration Guide
Equipable IItemStack ItemCooldowns ItemDefinition ItemStack UseOnContext
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

Potion

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.alchemy.Potion;

Implements

Undocumented Interfaces

FeatureElement

Members

Getter
Gets the command string of the potion.
script.zs
// Potion.commandString as string
myPotion.commandString

Return Type: string

Getter
Gets the effects of the potion.
script.zs
// Potion.effects as List<MobEffectInstance>
myPotion.effects

Return Type: List<MobEffectInstance>

effects() as List<MobEffectInstance>
Gets the effects of the potion.

Returns: The effects.

script.zs
// Potion.effects() as List<MobEffectInstance>;
myPotion.effects();

Return Type: List<MobEffectInstance>

static getName(prefix as string, potion as Potion = null) as string
Gets the name of the potion.

Returns: The name.

script.zs
// Potion.getName(prefix as string, potion as Potion = null) as string;
Potion.getName(myString, myPotion);

Parameters:

prefix Type: string - The prefix.
potion (optional) Type: Potion - The potion.

Default Value: null

Return Type: string

Getter
Checks if the potion has instant effects.
script.zs
// Potion.hasInstantEffects as bool
myPotion.hasInstantEffects

Return Type: bool

hasInstantEffects() as bool
Checks if the potion has instant effects.

Returns: True if the potion has instant effects, false otherwise.

script.zs
// Potion.hasInstantEffects() as bool;
myPotion.hasInstantEffects();

Return Type: bool

Getter
Gets the registry name of the potion.
script.zs
// Potion.registryName as ResourceLocation
myPotion.registryName

Return Type: ResourceLocation

registryName() as ResourceLocation
Gets the registry name of the potion.

Returns: The registry name.

script.zs
// Potion.registryName() as ResourceLocation;
myPotion.registryName();

Return Type: ResourceLocation