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.
import crafttweaker.api.misc.Cauldron;
Description
Lets you add new Cauldron interactions.Members
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:
interaction: CTCauldronInteraction
Type: CTCauldronInteraction
- What happens when the item interacts with the cauldron. This method is mainly provided to add support for non-vanilla cauldrons, thus the provided block needs to be a AbstractCauldronBlock
.
// CTCauldron.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);});
Parameters:
interaction: CTCauldronInteraction
Type: CTCauldronInteraction
- What happens when the item interacts with the cauldron. 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:
interaction: CTCauldronInteraction
Type: CTCauldronInteraction
- What happens when the item interacts with the cauldron. // CTCauldron.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);});
Parameters:
interaction: CTCauldronInteraction
Type: CTCauldronInteraction
- What happens when the item interacts with the cauldron. 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:
interaction: CTCauldronInteraction
Type: CTCauldronInteraction
- What happens when the item interacts with the cauldron. // CTCauldron.fillLavaInteraction as CTCauldronInteractioncauldron.fillLavaInteraction
Return Type:
CTCauldronInteraction
Returns: An interaction that fills a Cauldron with lava.
cauldron.fillLavaInteraction();
Return Type:
CTCauldronInteraction
// CTCauldron.fillPowderSnowInteraction as CTCauldronInteractioncauldron.fillPowderSnowInteraction
Return Type:
CTCauldronInteraction
Returns: An interaction that fills a Cauldron with lava.
cauldron.fillPowderSnowInteraction();
Return Type:
CTCauldronInteraction
// CTCauldron.fillWaterInteraction as CTCauldronInteractioncauldron.fillWaterInteraction
Return Type:
CTCauldronInteraction
Returns: An interaction that fills a cauldron with water.
cauldron.fillWaterInteraction();
Return Type:
CTCauldronInteraction
cauldron.removeEmptyInteraction(myItem);
Parameters:
This method is mainly provided to add support for non-vanilla cauldrons, thus the provided block needs to be a AbstractCauldronBlock
.
cauldron.removeInteraction(<block:minecraft:lava_cauldron>, <item:minecraft:dirt>);
Parameters:
cauldron.removeLavaInteraction(myItem);
Parameters:
cauldron.removePowderSnowInteraction(myItem);
Parameters:
cauldron.removeWaterInteraction(myItem);
Parameters: