Package net.minecraft.block.cauldron
Interface CauldronBehavior
public interface CauldronBehavior
Cauldron behaviors control what happens when a player interacts with
cauldrons using a specific item.
To register new cauldron behaviors, you can add them to the corresponding maps based on the cauldron type.
| Type | Block | Behavior map |
|---|---|---|
| Empty | minecraft:cauldron |
EMPTY_CAULDRON_BEHAVIOR |
| Water | minecraft:water_cauldron |
WATER_CAULDRON_BEHAVIOR |
| Lava | minecraft:lava_cauldron |
LAVA_CAULDRON_BEHAVIOR |
| Powder snow | minecraft:powder_snow_cauldron |
POWDER_SNOW_CAULDRON_BEHAVIOR |
- Mappings:
Namespace Name named net/minecraft/block/cauldron/CauldronBehaviorintermediary net/minecraft/class_5620official kk
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Map<String, CauldronBehavior.CauldronBehaviorMap> static final com.mojang.serialization.Codec<CauldronBehavior.CauldronBehaviorMap> static final CauldronBehavior.CauldronBehaviorMapThe cauldron behaviors for empty cauldrons.static final CauldronBehavior.CauldronBehaviorMapThe cauldron behaviors for lava cauldrons.static final CauldronBehavior.CauldronBehaviorMapThe cauldron behaviors for powder snow cauldrons.static final CauldronBehavior.CauldronBehaviorMapThe cauldron behaviors for water cauldrons. -
Method Summary
Modifier and TypeMethodDescriptionCreates a mutable map from items to their corresponding cauldron behaviors.static ActionResultemptyCauldron(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack, ItemStack output, Predicate<BlockState> fullPredicate, SoundEvent soundEvent) Empties a cauldron if it's full.static ActionResultfillCauldron(World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack, BlockState state, SoundEvent soundEvent) Fills a cauldron from a bucket stack.interact(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack) Called when a player interacts with a cauldron.private static booleanmethod_62705(World world, BlockPos blockPos) private static ActionResultmethod_62706(BlockState blockState, World world, BlockPos blockPos, PlayerEntity playerEntity, Hand hand, ItemStack itemStack) private static ActionResultmethod_62707(BlockState blockState, World world, BlockPos blockPos, PlayerEntity playerEntity, Hand hand, ItemStack itemStack) private static ActionResultmethod_62708(BlockState blockState, World world, BlockPos blockPos, PlayerEntity playerEntity, Hand hand, ItemStack itemStack) private static ActionResultmethod_62709(BlockState blockState, World world, BlockPos blockPos, PlayerEntity playerEntity, Hand hand, ItemStack itemStack) private static ActionResultmethod_62710(BlockState blockState, World world, BlockPos blockPos, PlayerEntity playerEntity, Hand hand, ItemStack itemStack) private static ActionResultmethod_62711(BlockState blockState, World world, BlockPos blockPos, PlayerEntity playerEntity, Hand hand, ItemStack itemStack) static voidRegisters the vanilla cauldron behaviors.static voidregisterBucketBehavior(Map<Item, CauldronBehavior> behavior) Registers the behavior for filled buckets in the specified behavior map.
-
Field Details
-
BEHAVIOR_MAPS
- Mappings:
Namespace Name Mixin selector named BEHAVIOR_MAPSLnet/minecraft/block/cauldron/CauldronBehavior;BEHAVIOR_MAPS:Ljava/util/Map;intermediary field_46589Lnet/minecraft/class_5620;field_46589:Ljava/util/Map;official aLkk;a:Ljava/util/Map;
-
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/block/cauldron/CauldronBehavior;CODEC:Lcom/mojang/serialization/Codec;intermediary field_46590Lnet/minecraft/class_5620;field_46590:Lcom/mojang/serialization/Codec;official bLkk;b:Lcom/mojang/serialization/Codec;
-
EMPTY_CAULDRON_BEHAVIOR
The cauldron behaviors for empty cauldrons.- See Also:
- Mappings:
Namespace Name Mixin selector named EMPTY_CAULDRON_BEHAVIORLnet/minecraft/block/cauldron/CauldronBehavior;EMPTY_CAULDRON_BEHAVIOR:Lnet/minecraft/block/cauldron/CauldronBehavior$CauldronBehaviorMap;intermediary field_27775Lnet/minecraft/class_5620;field_27775:Lnet/minecraft/class_5620$class_8821;official cLkk;c:Lkk$a;
-
WATER_CAULDRON_BEHAVIOR
The cauldron behaviors for water cauldrons.- See Also:
- Mappings:
Namespace Name Mixin selector named WATER_CAULDRON_BEHAVIORLnet/minecraft/block/cauldron/CauldronBehavior;WATER_CAULDRON_BEHAVIOR:Lnet/minecraft/block/cauldron/CauldronBehavior$CauldronBehaviorMap;intermediary field_27776Lnet/minecraft/class_5620;field_27776:Lnet/minecraft/class_5620$class_8821;official dLkk;d:Lkk$a;
-
LAVA_CAULDRON_BEHAVIOR
The cauldron behaviors for lava cauldrons.- See Also:
- Mappings:
Namespace Name Mixin selector named LAVA_CAULDRON_BEHAVIORLnet/minecraft/block/cauldron/CauldronBehavior;LAVA_CAULDRON_BEHAVIOR:Lnet/minecraft/block/cauldron/CauldronBehavior$CauldronBehaviorMap;intermediary field_27777Lnet/minecraft/class_5620;field_27777:Lnet/minecraft/class_5620$class_8821;official eLkk;e:Lkk$a;
-
POWDER_SNOW_CAULDRON_BEHAVIOR
The cauldron behaviors for powder snow cauldrons.- See Also:
- Mappings:
Namespace Name Mixin selector named POWDER_SNOW_CAULDRON_BEHAVIORLnet/minecraft/block/cauldron/CauldronBehavior;POWDER_SNOW_CAULDRON_BEHAVIOR:Lnet/minecraft/block/cauldron/CauldronBehavior$CauldronBehaviorMap;intermediary field_28011Lnet/minecraft/class_5620;field_28011:Lnet/minecraft/class_5620$class_8821;official fLkk;f:Lkk$a;
-
-
Method Details
-
createMap
Creates a mutable map from items to their corresponding cauldron behaviors.The default return value in the map is a cauldron behavior that returns
ActionResult.PASS_TO_DEFAULT_BLOCK_ACTIONfor all items.- Returns:
- the created map
- Mappings:
Namespace Name Mixin selector named createMapLnet/minecraft/block/cauldron/CauldronBehavior;createMap(Ljava/lang/String;)Lnet/minecraft/block/cauldron/CauldronBehavior$CauldronBehaviorMap;intermediary method_32206Lnet/minecraft/class_5620;method_32206(Ljava/lang/String;)Lnet/minecraft/class_5620$class_8821;official aLkk;a(Ljava/lang/String;)Lkk$a;
-
interact
ActionResult interact(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack) Called when a player interacts with a cauldron.- Parameters:
state- the current cauldron block stateworld- the world where the cauldron is locatedpos- the cauldron's positionplayer- the interacting playerhand- the hand interacting with the cauldronstack- the stack in the player's hand- Returns:
- a successful action result if this behavior succeeds,
ActionResult.PASS_TO_DEFAULT_BLOCK_ACTIONotherwise - Mappings:
Namespace Name Mixin selector named interactLnet/minecraft/block/cauldron/CauldronBehavior;interact(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;Lnet/minecraft/item/ItemStack;)Lnet/minecraft/util/ActionResult;intermediary interactLnet/minecraft/class_5620;interact(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;Lnet/minecraft/class_1799;)Lnet/minecraft/class_1269;official interactLkk;interact(Ldua;Ldds;Lje;Lcnp;Lbrj;Lcvl;)Lbrk;
-
registerBehavior
static void registerBehavior()Registers the vanilla cauldron behaviors.- Mappings:
Namespace Name Mixin selector named registerBehaviorLnet/minecraft/block/cauldron/CauldronBehavior;registerBehavior()Vintermediary method_32212Lnet/minecraft/class_5620;method_32212()Vofficial aLkk;a()V
-
registerBucketBehavior
Registers the behavior for filled buckets in the specified behavior map.- Mappings:
Namespace Name Mixin selector named registerBucketBehaviorLnet/minecraft/block/cauldron/CauldronBehavior;registerBucketBehavior(Ljava/util/Map;)Vintermediary method_34850Lnet/minecraft/class_5620;method_34850(Ljava/util/Map;)Vofficial aLkk;a(Ljava/util/Map;)V
-
emptyCauldron
static ActionResult emptyCauldron(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack, ItemStack output, Predicate<BlockState> fullPredicate, SoundEvent soundEvent) Empties a cauldron if it's full.- Parameters:
state- the cauldron block stateworld- the world where the cauldron is locatedpos- the cauldron's positionplayer- the interacting playerhand- the hand interacting with the cauldronstack- the stack in the player's handoutput- the item stack that replaces the interaction stack when the cauldron is emptiedfullPredicate- a predicate used to check if the cauldron can be emptied into the output stacksoundEvent- the sound produced by emptying- Returns:
- a successful action result if emptied,
ActionResult.PASS_TO_DEFAULT_BLOCK_ACTIONotherwise - Mappings:
Namespace Name Mixin selector named emptyCauldronLnet/minecraft/block/cauldron/CauldronBehavior;emptyCauldron(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ItemStack;Ljava/util/function/Predicate;Lnet/minecraft/sound/SoundEvent;)Lnet/minecraft/util/ActionResult;intermediary method_32210Lnet/minecraft/class_5620;method_32210(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;Lnet/minecraft/class_1799;Lnet/minecraft/class_1799;Ljava/util/function/Predicate;Lnet/minecraft/class_3414;)Lnet/minecraft/class_1269;official aLkk;a(Ldua;Ldds;Lje;Lcnp;Lbrj;Lcvl;Lcvl;Ljava/util/function/Predicate;Lawc;)Lbrk;
-
fillCauldron
static ActionResult fillCauldron(World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack, BlockState state, SoundEvent soundEvent) Fills a cauldron from a bucket stack.The filled bucket stack will be replaced by an empty bucket in the player's inventory.
- Parameters:
world- the world where the cauldron is locatedpos- the cauldron's positionplayer- the interacting playerhand- the hand interacting with the cauldronstack- the filled bucket stack in the player's handstate- the filled cauldron statesoundEvent- the sound produced by filling- Returns:
- a successful action result
- Mappings:
Namespace Name Mixin selector named fillCauldronLnet/minecraft/block/cauldron/CauldronBehavior;fillCauldron(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;Lnet/minecraft/item/ItemStack;Lnet/minecraft/block/BlockState;Lnet/minecraft/sound/SoundEvent;)Lnet/minecraft/util/ActionResult;intermediary method_32207Lnet/minecraft/class_5620;method_32207(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;Lnet/minecraft/class_1799;Lnet/minecraft/class_2680;Lnet/minecraft/class_3414;)Lnet/minecraft/class_1269;official aLkk;a(Ldds;Lje;Lcnp;Lbrj;Lcvl;Ldua;Lawc;)Lbrk;
-
method_62706
private static ActionResult method_62706(BlockState blockState, World world, BlockPos blockPos, PlayerEntity playerEntity, Hand hand, ItemStack itemStack) - Mappings:
Namespace Name Mixin selector named method_62706Lnet/minecraft/block/cauldron/CauldronBehavior;method_62706(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;Lnet/minecraft/item/ItemStack;)Lnet/minecraft/util/ActionResult;intermediary method_62706Lnet/minecraft/class_5620;method_62706(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;Lnet/minecraft/class_1799;)Lnet/minecraft/class_1269;official aLkk;a(Ldua;Ldds;Lje;Lcnp;Lbrj;Lcvl;)Lbrk;
-
method_62707
private static ActionResult method_62707(BlockState blockState, World world, BlockPos blockPos, PlayerEntity playerEntity, Hand hand, ItemStack itemStack) - Mappings:
Namespace Name Mixin selector named method_62707Lnet/minecraft/block/cauldron/CauldronBehavior;method_62707(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;Lnet/minecraft/item/ItemStack;)Lnet/minecraft/util/ActionResult;intermediary method_62707Lnet/minecraft/class_5620;method_62707(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;Lnet/minecraft/class_1799;)Lnet/minecraft/class_1269;official bLkk;b(Ldua;Ldds;Lje;Lcnp;Lbrj;Lcvl;)Lbrk;
-
method_62708
private static ActionResult method_62708(BlockState blockState, World world, BlockPos blockPos, PlayerEntity playerEntity, Hand hand, ItemStack itemStack) - Mappings:
Namespace Name Mixin selector named method_62708Lnet/minecraft/block/cauldron/CauldronBehavior;method_62708(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;Lnet/minecraft/item/ItemStack;)Lnet/minecraft/util/ActionResult;intermediary method_62708Lnet/minecraft/class_5620;method_62708(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;Lnet/minecraft/class_1799;)Lnet/minecraft/class_1269;official cLkk;c(Ldua;Ldds;Lje;Lcnp;Lbrj;Lcvl;)Lbrk;
-
method_62709
private static ActionResult method_62709(BlockState blockState, World world, BlockPos blockPos, PlayerEntity playerEntity, Hand hand, ItemStack itemStack) - Mappings:
Namespace Name Mixin selector named method_62709Lnet/minecraft/block/cauldron/CauldronBehavior;method_62709(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;Lnet/minecraft/item/ItemStack;)Lnet/minecraft/util/ActionResult;intermediary method_62709Lnet/minecraft/class_5620;method_62709(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;Lnet/minecraft/class_1799;)Lnet/minecraft/class_1269;official dLkk;d(Ldua;Ldds;Lje;Lcnp;Lbrj;Lcvl;)Lbrk;
-
method_62710
private static ActionResult method_62710(BlockState blockState, World world, BlockPos blockPos, PlayerEntity playerEntity, Hand hand, ItemStack itemStack) - Mappings:
Namespace Name Mixin selector named method_62710Lnet/minecraft/block/cauldron/CauldronBehavior;method_62710(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;Lnet/minecraft/item/ItemStack;)Lnet/minecraft/util/ActionResult;intermediary method_62710Lnet/minecraft/class_5620;method_62710(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;Lnet/minecraft/class_1799;)Lnet/minecraft/class_1269;official eLkk;e(Ldua;Ldds;Lje;Lcnp;Lbrj;Lcvl;)Lbrk;
-
method_62711
private static ActionResult method_62711(BlockState blockState, World world, BlockPos blockPos, PlayerEntity playerEntity, Hand hand, ItemStack itemStack) - Mappings:
Namespace Name Mixin selector named method_62711Lnet/minecraft/block/cauldron/CauldronBehavior;method_62711(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;Lnet/minecraft/item/ItemStack;)Lnet/minecraft/util/ActionResult;intermediary method_62711Lnet/minecraft/class_5620;method_62711(Lnet/minecraft/class_2680;Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Lnet/minecraft/class_1657;Lnet/minecraft/class_1268;Lnet/minecraft/class_1799;)Lnet/minecraft/class_1269;official fLkk;f(Ldua;Ldds;Lje;Lcnp;Lbrj;Lcvl;)Lbrk;
-
method_62705
- Mappings:
Namespace Name Mixin selector named method_62705Lnet/minecraft/block/cauldron/CauldronBehavior;method_62705(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Zintermediary method_62705Lnet/minecraft/class_5620;method_62705(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Zofficial aLkk;a(Ldds;Lje;)Z
-