Home Commands Examples Getting Started With Scripts Global Keywords
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

Cauldron

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.misc.Cauldron;

Description

Lets you add new Cauldron interactions.

Members

addEmptyInteraction(item as Item, interaction as CTCauldronInteraction)
Adds an interaction that will fire when an empty Cauldron is interacted with the given item.
script.zs
// CTCauldron.addEmptyInteraction(item as Item, 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);
});

Parameters:

item Type: ItemDefinition - The item to interact with.
interaction Type: CTCauldronInteraction - What happens when the item interacts with the cauldron.
addInteraction(cauldronBlock as Block, item as Item, interaction as CTCauldronInteraction)
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
// CTCauldron.addInteraction(cauldronBlock as Block, item as Item, 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);
});

Parameters:

cauldronBlock Type: Block - The cauldron block to add an interaction to.
item Type: ItemDefinition - The item to interact with.
interaction Type: CTCauldronInteraction - What happens when the item interacts with the cauldron.
addLavaInteraction(item as Item, interaction as CTCauldronInteraction)
Adds an interaction that will fire when a Cauldron with lava inside is interacted with the given item.
script.zs
// CTCauldron.addLavaInteraction(item as Item, 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);
});

Parameters:

item Type: ItemDefinition - The item to interact with.
interaction Type: CTCauldronInteraction - What happens when the item interacts with the cauldron.
addPowderSnowInteraction(item as Item, interaction as CTCauldronInteraction)
Adds an interaction that will fire when a Cauldron with powdered snow inside is interacted with the given item.
script.zs
// CTCauldron.addPowderSnowInteraction(item as Item, 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);
});

Parameters:

item Type: ItemDefinition - The item to interact with.
interaction Type: CTCauldronInteraction - What happens when the item interacts with the cauldron.
addWaterInteraction(item as Item, interaction as CTCauldronInteraction)
Adds an interaction that will fire when a Cauldron with water inside is interacted with the given item.
script.zs
// CTCauldron.addWaterInteraction(item as Item, 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);
});

Parameters:

item Type: ItemDefinition - The item to interact with.
interaction Type: CTCauldronInteraction - What happens when the item interacts with the cauldron.
Getter
Gets an interaction that fills a Cauldron with lava.
script.zs
// CTCauldron.fillLavaInteraction as CTCauldronInteraction
cauldron.fillLavaInteraction

Return Type: CTCauldronInteraction

fillLavaInteraction() as CTCauldronInteraction
Gets an interaction that fills a Cauldron with lava.

Returns: An interaction that fills a Cauldron with lava.

script.zs
// CTCauldron.fillLavaInteraction() as CTCauldronInteraction;
cauldron.fillLavaInteraction();

Return Type: CTCauldronInteraction

Getter
Gets an interaction that fills a Cauldron with lava.
script.zs
// CTCauldron.fillPowderSnowInteraction as CTCauldronInteraction
cauldron.fillPowderSnowInteraction

Return Type: CTCauldronInteraction

fillPowderSnowInteraction() as CTCauldronInteraction
Gets an interaction that fills a Cauldron with lava.

Returns: An interaction that fills a Cauldron with lava.

script.zs
// CTCauldron.fillPowderSnowInteraction() as CTCauldronInteraction;
cauldron.fillPowderSnowInteraction();

Return Type: CTCauldronInteraction

Getter
Gets an interaction that fills a cauldron with water.
script.zs
// CTCauldron.fillWaterInteraction as CTCauldronInteraction
cauldron.fillWaterInteraction

Return Type: CTCauldronInteraction

fillWaterInteraction() as CTCauldronInteraction
Gets an interaction that fills a cauldron with water.

Returns: An interaction that fills a cauldron with water.

script.zs
// CTCauldron.fillWaterInteraction() as CTCauldronInteraction;
cauldron.fillWaterInteraction();

Return Type: CTCauldronInteraction

removeEmptyInteraction(item as Item)
Removes the interaction for the given item from an empty Cauldron.
script.zs
// CTCauldron.removeEmptyInteraction(item as Item);
cauldron.removeEmptyInteraction(myItem);

Parameters:

item Type: ItemDefinition - The item to remove the interaction for.
removeInteraction(cauldronBlock as Block, item as Item)
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
// CTCauldron.removeInteraction(cauldronBlock as Block, item as Item);
cauldron.removeInteraction(<block:minecraft:lava_cauldron>, <item:minecraft:dirt>);

Parameters:

cauldronBlock Type: Block - The cauldron block to add an interaction to.
item Type: ItemDefinition - The item to interact with.
removeLavaInteraction(item as Item)
Removes the interaction for the given item from a lava filled Cauldron.
script.zs
// CTCauldron.removeLavaInteraction(item as Item);
cauldron.removeLavaInteraction(myItem);

Parameters:

item Type: ItemDefinition - The item to remove the interaction for.
removePowderSnowInteraction(item as Item)
Removes the interaction for the given item from a powdered snow filled Cauldron.
script.zs
// CTCauldron.removePowderSnowInteraction(item as Item);
cauldron.removePowderSnowInteraction(myItem);

Parameters:

item Type: ItemDefinition - The item to remove the interaction for.
removeWaterInteraction(item as Item)
Removes the interaction for the given item from a water filled Cauldron.
script.zs
// CTCauldron.removeWaterInteraction(item as Item);
cauldron.removeWaterInteraction(myItem);

Parameters:

item Type: ItemDefinition - The item to remove the interaction for.