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 official ia
intermediary net/minecraft/class_5620
named net/minecraft/block/cauldron/CauldronBehavior
-
Field Summary
Modifier and TypeFieldDescriptionstatic final CauldronBehavior
A behavior that cleans banners with patterns.static final CauldronBehavior
A behavior that cleans dyeable items.static final CauldronBehavior
A behavior that cleans dyed shulker boxes.static final Map<Item,
CauldronBehavior> The cauldron behaviors for empty cauldrons.static final CauldronBehavior
A behavior that fills cauldrons with lava.static final CauldronBehavior
A behavior that fills cauldrons with powder snow.static final CauldronBehavior
A behavior that fills cauldrons with water.static final Map<Item,
CauldronBehavior> The cauldron behaviors for lava cauldrons.static final Map<Item,
CauldronBehavior> The cauldron behaviors for powder snow cauldrons.static final Map<Item,
CauldronBehavior> The cauldron behaviors for water cauldrons. -
Method Summary
Modifier and TypeMethodDescriptionCreates a mutable map from items to their corresponding cauldron behaviors.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.static ActionResult
fillCauldron
(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.static void
Registers the vanilla cauldron behaviors.static void
registerBucketBehavior
(Map<Item, CauldronBehavior> behavior) Registers the behavior for filled buckets in the specified behavior map.
-
Field Details
-
EMPTY_CAULDRON_BEHAVIOR
The cauldron behaviors for empty cauldrons.- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lia;a:Ljava/util/Map;
intermediary field_27775
Lnet/minecraft/class_5620;field_27775:Ljava/util/Map;
named EMPTY_CAULDRON_BEHAVIOR
Lnet/minecraft/block/cauldron/CauldronBehavior;EMPTY_CAULDRON_BEHAVIOR:Ljava/util/Map;
-
WATER_CAULDRON_BEHAVIOR
The cauldron behaviors for water cauldrons.- See Also:
- Mappings:
Namespace Name Mixin selector official b
Lia;b:Ljava/util/Map;
intermediary field_27776
Lnet/minecraft/class_5620;field_27776:Ljava/util/Map;
named WATER_CAULDRON_BEHAVIOR
Lnet/minecraft/block/cauldron/CauldronBehavior;WATER_CAULDRON_BEHAVIOR:Ljava/util/Map;
-
LAVA_CAULDRON_BEHAVIOR
The cauldron behaviors for lava cauldrons.- See Also:
- Mappings:
Namespace Name Mixin selector official c
Lia;c:Ljava/util/Map;
intermediary field_27777
Lnet/minecraft/class_5620;field_27777:Ljava/util/Map;
named LAVA_CAULDRON_BEHAVIOR
Lnet/minecraft/block/cauldron/CauldronBehavior;LAVA_CAULDRON_BEHAVIOR:Ljava/util/Map;
-
POWDER_SNOW_CAULDRON_BEHAVIOR
The cauldron behaviors for powder snow cauldrons.- See Also:
- Mappings:
Namespace Name Mixin selector official d
Lia;d:Ljava/util/Map;
intermediary field_28011
Lnet/minecraft/class_5620;field_28011:Ljava/util/Map;
named POWDER_SNOW_CAULDRON_BEHAVIOR
Lnet/minecraft/block/cauldron/CauldronBehavior;POWDER_SNOW_CAULDRON_BEHAVIOR:Ljava/util/Map;
-
FILL_WITH_WATER
A behavior that fills cauldrons with water.- See Also:
- Mappings:
Namespace Name Mixin selector official e
Lia;e:Lia;
intermediary field_27778
Lnet/minecraft/class_5620;field_27778:Lnet/minecraft/class_5620;
named FILL_WITH_WATER
Lnet/minecraft/block/cauldron/CauldronBehavior;FILL_WITH_WATER:Lnet/minecraft/block/cauldron/CauldronBehavior;
-
FILL_WITH_LAVA
A behavior that fills cauldrons with lava.- See Also:
- Mappings:
Namespace Name Mixin selector official f
Lia;f:Lia;
intermediary field_27779
Lnet/minecraft/class_5620;field_27779:Lnet/minecraft/class_5620;
named FILL_WITH_LAVA
Lnet/minecraft/block/cauldron/CauldronBehavior;FILL_WITH_LAVA:Lnet/minecraft/block/cauldron/CauldronBehavior;
-
FILL_WITH_POWDER_SNOW
A behavior that fills cauldrons with powder snow.- See Also:
- Mappings:
Namespace Name Mixin selector official g
Lia;g:Lia;
intermediary field_28012
Lnet/minecraft/class_5620;field_28012:Lnet/minecraft/class_5620;
named FILL_WITH_POWDER_SNOW
Lnet/minecraft/block/cauldron/CauldronBehavior;FILL_WITH_POWDER_SNOW:Lnet/minecraft/block/cauldron/CauldronBehavior;
-
CLEAN_SHULKER_BOX
A behavior that cleans dyed shulker boxes.- Mappings:
Namespace Name Mixin selector official h
Lia;h:Lia;
intermediary field_27780
Lnet/minecraft/class_5620;field_27780:Lnet/minecraft/class_5620;
named CLEAN_SHULKER_BOX
Lnet/minecraft/block/cauldron/CauldronBehavior;CLEAN_SHULKER_BOX:Lnet/minecraft/block/cauldron/CauldronBehavior;
-
CLEAN_BANNER
A behavior that cleans banners with patterns.- Mappings:
Namespace Name Mixin selector official i
Lia;i:Lia;
intermediary field_27781
Lnet/minecraft/class_5620;field_27781:Lnet/minecraft/class_5620;
named CLEAN_BANNER
Lnet/minecraft/block/cauldron/CauldronBehavior;CLEAN_BANNER:Lnet/minecraft/block/cauldron/CauldronBehavior;
-
CLEAN_DYEABLE_ITEM
A behavior that cleans dyeable items.- Mappings:
Namespace Name Mixin selector official j
Lia;j:Lia;
intermediary field_27782
Lnet/minecraft/class_5620;field_27782:Lnet/minecraft/class_5620;
named CLEAN_DYEABLE_ITEM
Lnet/minecraft/block/cauldron/CauldronBehavior;CLEAN_DYEABLE_ITEM:Lnet/minecraft/block/cauldron/CauldronBehavior;
-
-
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
for all items.- Returns:
- the created map
- Mappings:
Namespace Name Mixin selector official a
Lia;a()Lit/unimi/dsi/fastutil/objects/Object2ObjectOpenHashMap;
intermediary method_32206
Lnet/minecraft/class_5620;method_32206()Lit/unimi/dsi/fastutil/objects/Object2ObjectOpenHashMap;
named createMap
Lnet/minecraft/block/cauldron/CauldronBehavior;createMap()Lit/unimi/dsi/fastutil/objects/Object2ObjectOpenHashMap;
-
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
otherwise - Mappings:
Namespace Name Mixin selector official interact
Lia;interact(Ldfj;Lcpv;Lgw;Lcbu;Lbgx;Lcjf;)Lbgy;
intermediary interact
Lnet/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;
named interact
Lnet/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;
-
registerBehavior
static void registerBehavior()Registers the vanilla cauldron behaviors.- Mappings:
Namespace Name Mixin selector official b
Lia;b()V
intermediary method_32212
Lnet/minecraft/class_5620;method_32212()V
named registerBehavior
Lnet/minecraft/block/cauldron/CauldronBehavior;registerBehavior()V
-
registerBucketBehavior
Registers the behavior for filled buckets in the specified behavior map.- Mappings:
Namespace Name Mixin selector official a
Lia;a(Ljava/util/Map;)V
intermediary method_34850
Lnet/minecraft/class_5620;method_34850(Ljava/util/Map;)V
named registerBucketBehavior
Lnet/minecraft/block/cauldron/CauldronBehavior;registerBucketBehavior(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
otherwise - Mappings:
Namespace Name Mixin selector official a
Lia;a(Ldfj;Lcpv;Lgw;Lcbu;Lbgx;Lcjf;Lcjf;Ljava/util/function/Predicate;Lapc;)Lbgy;
intermediary method_32210
Lnet/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;
named emptyCauldron
Lnet/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;
-
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 official a
Lia;a(Lcpv;Lgw;Lcbu;Lbgx;Lcjf;Ldfj;Lapc;)Lbgy;
intermediary method_32207
Lnet/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;
named fillCauldron
Lnet/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;
-