Home Commands Examples Getting Started With Scripts Global Keywords

Cauldron

Lets you add new Cauldron interactions.

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.

script.zs
import crafttweaker.api.misc.Cauldron;

Methods

Adds an interaction that will fire when an empty Cauldron is interacted with the given item.

script.zs
// Cauldron.addEmptyInteraction(item as ItemDefinition, interaction as CTCauldronInteraction)
cauldron.addEmptyInteraction(<item:minecraft:dirt>, (blockState, level, pos, player, hand, stack) => {
if !level.isClientSide {
player.give(<item:minecraft:diamond>);
}
return crafttweaker.api.world.InteractionResult.sidedSuccess(level.isClientSide);
});
ParameterTypeDescription
Parameter
item
Type
ItemDefinition
Description
The item to interact with.
Parameter
interaction
Type
CTCauldronInteraction
Description
What happens when the item interacts with the cauldron.

Adds an interaction that will fire when the provided cauldron block is interacted with the given item.

This method is mainly provided to add support for non-vanilla cauldrons, thus the provided block needs to be a AbstractCauldronBlock.

script.zs
// Cauldron.addInteraction(cauldronBlock as Block, item as ItemDefinition, interaction as CTCauldronInteraction)
cauldron.addInteraction(<block:minecraft:lava_cauldron>, <item:minecraft:dirt>, (blockState, level, pos, player, hand, stack) => {
if !level.isClientSide {
player.give(<item:minecraft:diamond>);
}
return crafttweaker.api.world.InteractionResult.sidedSuccess(level.isClientSide);
});
ParameterTypeDescription
Parameter
cauldronBlock
Type
Block
Description
The cauldron block to add an interaction to.
Parameter
item
Type
ItemDefinition
Description
The item to interact with.
Parameter
interaction
Type
CTCauldronInteraction
Description
What happens when the item interacts with the cauldron.

Adds an interaction that will fire when a Cauldron with lava inside is interacted with the given item.

script.zs
// Cauldron.addLavaInteraction(item as ItemDefinition, interaction as CTCauldronInteraction)
cauldron.addLavaInteraction(<item:minecraft:dirt>, (blockState, level, pos, player, hand, stack) => {
if !level.isClientSide {
player.give(<item:minecraft:diamond>);
}
return crafttweaker.api.world.InteractionResult.sidedSuccess(level.isClientSide);
});
ParameterTypeDescription
Parameter
item
Type
ItemDefinition
Description
The item to interact with.
Parameter
interaction
Type
CTCauldronInteraction
Description
What happens when the item interacts with the cauldron.

Adds an interaction that will fire when a Cauldron with powdered snow inside is interacted with the given item.

script.zs
// Cauldron.addPowderSnowInteraction(item as ItemDefinition, interaction as CTCauldronInteraction)
cauldron.addPowderSnowInteraction(<item:minecraft:dirt>, (blockState, level, pos, player, hand, stack) => {
if !level.isClientSide {
player.give(<item:minecraft:diamond>);
}
return crafttweaker.api.world.InteractionResult.sidedSuccess(level.isClientSide);
});
ParameterTypeDescription
Parameter
item
Type
ItemDefinition
Description
The item to interact with.
Parameter
interaction
Type
CTCauldronInteraction
Description
What happens when the item interacts with the cauldron.

Adds an interaction that will fire when a Cauldron with water inside is interacted with the given item.

script.zs
// Cauldron.addWaterInteraction(item as ItemDefinition, interaction as CTCauldronInteraction)
cauldron.addWaterInteraction(<item:minecraft:dirt>, (blockState, level, pos, player, hand, stack) => {
if !level.isClientSide {
player.give(<item:minecraft:diamond>);
}
return crafttweaker.api.world.InteractionResult.sidedSuccess(level.isClientSide);
});
ParameterTypeDescription
Parameter
item
Type
ItemDefinition
Description
The item to interact with.
Parameter
interaction
Type
CTCauldronInteraction
Description
What happens when the item interacts with the cauldron.

Gets an interaction that fills a Cauldron with lava.

Returns: An interaction that fills a Cauldron with lava.
Return Type: CTCauldronInteraction

script.zs
// Cauldron.getFillLavaInteraction() as CTCauldronInteraction
cauldron.getFillLavaInteraction();

Gets an interaction that fills a Cauldron with lava.

Returns: An interaction that fills a Cauldron with lava.
Return Type: CTCauldronInteraction

script.zs
// Cauldron.getFillPowderSnowInteraction() as CTCauldronInteraction
cauldron.getFillPowderSnowInteraction();

Gets an interaction that fills a cauldron with water.

Returns: An interaction that fills a cauldron with water.
Return Type: CTCauldronInteraction

script.zs
// Cauldron.getFillWaterInteraction() as CTCauldronInteraction
cauldron.getFillWaterInteraction();

Removes the interaction for the given item from an empty Cauldron.

script.zs
Cauldron.removeEmptyInteraction(item as ItemDefinition)
ParameterTypeDescription
Parameter
item
Type
ItemDefinition
Description
The item to remove the interaction for.

Removes the interaction that will fire when the provided cauldron block is interacted with the given item.

This method is mainly provided to add support for non-vanilla cauldrons, thus the provided block needs to be a AbstractCauldronBlock.

script.zs
// Cauldron.removeInteraction(cauldronBlock as Block, item as ItemDefinition)
cauldron.removeInteraction(<block:minecraft:lava_cauldron>, <item:minecraft:dirt>);
ParameterTypeDescription
Parameter
cauldronBlock
Type
Block
Description
The cauldron block to add an interaction to.
Parameter
item
Type
ItemDefinition
Description
The item to interact with.

Removes the interaction for the given item from a lava filled Cauldron.

script.zs
Cauldron.removeLavaInteraction(item as ItemDefinition)
ParameterTypeDescription
Parameter
item
Type
ItemDefinition
Description
The item to remove the interaction for.

Removes the interaction for the given item from a powdered snow filled Cauldron.

script.zs
Cauldron.removePowderSnowInteraction(item as ItemDefinition)
ParameterTypeDescription
Parameter
item
Type
ItemDefinition
Description
The item to remove the interaction for.

Removes the interaction for the given item from a water filled Cauldron.

script.zs
Cauldron.removeWaterInteraction(item as ItemDefinition)
ParameterTypeDescription
Parameter
item
Type
ItemDefinition
Description
The item to remove the interaction for.

Properties

NameTypeHas GetterHas SetterDescription
Name
fillLavaInteraction
Type
CTCauldronInteraction
Has Getter
true
Has Setter
false
Description
Gets an interaction that fills a Cauldron with lava.
Name
fillPowderSnowInteraction
Type
CTCauldronInteraction
Has Getter
true
Has Setter
false
Description
Gets an interaction that fills a Cauldron with lava.
Name
fillWaterInteraction
Type
CTCauldronInteraction
Has Getter
true
Has Setter
false
Description
Gets an interaction that fills a cauldron with water.