Lets you add new Cauldron interactions.

Импорт класса

Link to импорт-класса

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

Link to addEmptyInteraction

Name: addEmptyInteraction

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

ZenScript
Copy
// 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);
 });
ПараметрТипОписание
Параметр
item
Тип
ItemDefinition
Описание
The item to interact with.
Параметр
interaction
Тип
CTCauldronInteraction
Описание
What happens when the item interacts with the cauldron.

Name: addInteraction

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.

ZenScript
Copy
// 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);
 });
ПараметрТипОписание
Параметр
cauldronBlock
Тип
Block
Описание
The cauldron block to add an interaction to.
Параметр
item
Тип
ItemDefinition
Описание
The item to interact with.
Параметр
interaction
Тип
CTCauldronInteraction
Описание
What happens when the item interacts with the cauldron.

Link to addLavaInteraction

Name: addLavaInteraction

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

ZenScript
Copy
// 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);
 });
ПараметрТипОписание
Параметр
item
Тип
ItemDefinition
Описание
The item to interact with.
Параметр
interaction
Тип
CTCauldronInteraction
Описание
What happens when the item interacts with the cauldron.

Link to addPowderSnowInteraction

Name: addPowderSnowInteraction

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

ZenScript
Copy
// 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);
 });
ПараметрТипОписание
Параметр
item
Тип
ItemDefinition
Описание
The item to interact with.
Параметр
interaction
Тип
CTCauldronInteraction
Описание
What happens when the item interacts with the cauldron.

Link to addWaterInteraction

Name: addWaterInteraction

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

ZenScript
Copy
// 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);
 });
ПараметрТипОписание
Параметр
item
Тип
ItemDefinition
Описание
The item to interact with.
Параметр
interaction
Тип
CTCauldronInteraction
Описание
What happens when the item interacts with the cauldron.

Link to getFillLavaInteraction

Name: getFillLavaInteraction

Gets an interaction that fills a Cauldron with lava.

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

ZenScript
Copy
// Cauldron.getFillLavaInteraction() as CTCauldronInteraction

cauldron.getFillLavaInteraction();

Link to getFillPowderSnowInteraction

Name: getFillPowderSnowInteraction

Gets an interaction that fills a Cauldron with lava.

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

ZenScript
Copy
// Cauldron.getFillPowderSnowInteraction() as CTCauldronInteraction

cauldron.getFillPowderSnowInteraction();

Link to getFillWaterInteraction

Name: getFillWaterInteraction

Gets an interaction that fills a cauldron with water.

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

ZenScript
Copy
// Cauldron.getFillWaterInteraction() as CTCauldronInteraction

cauldron.getFillWaterInteraction();

Link to removeEmptyInteraction

Name: removeEmptyInteraction

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

ZenScript
Copy
Cauldron.removeEmptyInteraction(item as ItemDefinition)
ПараметрТипОписание
Параметр
item
Тип
ItemDefinition
Описание
The item to remove the interaction for.

Link to removeInteraction

Name: removeInteraction

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.

ZenScript
Copy
// Cauldron.removeInteraction(cauldronBlock as Block, item as ItemDefinition)

cauldron.removeInteraction(<block:minecraft:lava_cauldron>, <item:minecraft:dirt>);
ПараметрТипОписание
Параметр
cauldronBlock
Тип
Block
Описание
The cauldron block to add an interaction to.
Параметр
item
Тип
ItemDefinition
Описание
The item to interact with.

Link to removeLavaInteraction

Name: removeLavaInteraction

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

ZenScript
Copy
Cauldron.removeLavaInteraction(item as ItemDefinition)
ПараметрТипОписание
Параметр
item
Тип
ItemDefinition
Описание
The item to remove the interaction for.

Link to removePowderSnowInteraction

Name: removePowderSnowInteraction

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

ZenScript
Copy
Cauldron.removePowderSnowInteraction(item as ItemDefinition)
ПараметрТипОписание
Параметр
item
Тип
ItemDefinition
Описание
The item to remove the interaction for.

Link to removeWaterInteraction

Name: removeWaterInteraction

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

ZenScript
Copy
Cauldron.removeWaterInteraction(item as ItemDefinition)
ПараметрТипОписание
Параметр
item
Тип
ItemDefinition
Описание
The item to remove the interaction for.

Свойства

Link to свойства

НазваниеТипИмеет GetterИмеет SetterОписание
Название
fillLavaInteraction
Тип
CTCauldronInteraction
Имеет Getter
true
Имеет Setter
false
Описание
Gets an interaction that fills a Cauldron with lava.
Название
fillPowderSnowInteraction
Тип
CTCauldronInteraction
Имеет Getter
true
Имеет Setter
false
Описание
Gets an interaction that fills a Cauldron with lava.
Название
fillWaterInteraction
Тип
CTCauldronInteraction
Имеет Getter
true
Имеет Setter
false
Описание
Gets an interaction that fills a cauldron with water.