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.

Mappings:
Namespace Name
named net/minecraft/block/cauldron/CauldronBehavior
intermediary net/minecraft/class_5620
official kn
  • Field Details

    • BEHAVIOR_MAPS

      static final Map<String,CauldronBehavior.CauldronBehaviorMap> BEHAVIOR_MAPS
      Mappings:
      Namespace Name Mixin selector
      named BEHAVIOR_MAPS Lnet/minecraft/block/cauldron/CauldronBehavior;BEHAVIOR_MAPS:Ljava/util/Map;
      intermediary field_46589 Lnet/minecraft/class_5620;field_46589:Ljava/util/Map;
      official a Lkn;a:Ljava/util/Map;
    • CODEC

      static final com.mojang.serialization.Codec<CauldronBehavior.CauldronBehaviorMap> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/block/cauldron/CauldronBehavior;CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_46590 Lnet/minecraft/class_5620;field_46590:Lcom/mojang/serialization/Codec;
      official b Lkn;b:Lcom/mojang/serialization/Codec;
    • EMPTY_CAULDRON_BEHAVIOR

      static final CauldronBehavior.CauldronBehaviorMap EMPTY_CAULDRON_BEHAVIOR
      The cauldron behaviors for empty cauldrons.
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named EMPTY_CAULDRON_BEHAVIOR Lnet/minecraft/block/cauldron/CauldronBehavior;EMPTY_CAULDRON_BEHAVIOR:Lnet/minecraft/block/cauldron/CauldronBehavior$CauldronBehaviorMap;
      intermediary field_27775 Lnet/minecraft/class_5620;field_27775:Lnet/minecraft/class_5620$class_8821;
      official c Lkn;c:Lkn$a;
    • WATER_CAULDRON_BEHAVIOR

      static final CauldronBehavior.CauldronBehaviorMap WATER_CAULDRON_BEHAVIOR
      The cauldron behaviors for water cauldrons.
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named WATER_CAULDRON_BEHAVIOR Lnet/minecraft/block/cauldron/CauldronBehavior;WATER_CAULDRON_BEHAVIOR:Lnet/minecraft/block/cauldron/CauldronBehavior$CauldronBehaviorMap;
      intermediary field_27776 Lnet/minecraft/class_5620;field_27776:Lnet/minecraft/class_5620$class_8821;
      official d Lkn;d:Lkn$a;
    • LAVA_CAULDRON_BEHAVIOR

      static final CauldronBehavior.CauldronBehaviorMap LAVA_CAULDRON_BEHAVIOR
      The cauldron behaviors for lava cauldrons.
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named LAVA_CAULDRON_BEHAVIOR Lnet/minecraft/block/cauldron/CauldronBehavior;LAVA_CAULDRON_BEHAVIOR:Lnet/minecraft/block/cauldron/CauldronBehavior$CauldronBehaviorMap;
      intermediary field_27777 Lnet/minecraft/class_5620;field_27777:Lnet/minecraft/class_5620$class_8821;
      official e Lkn;e:Lkn$a;
    • POWDER_SNOW_CAULDRON_BEHAVIOR

      static final CauldronBehavior.CauldronBehaviorMap POWDER_SNOW_CAULDRON_BEHAVIOR
      The cauldron behaviors for powder snow cauldrons.
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named POWDER_SNOW_CAULDRON_BEHAVIOR Lnet/minecraft/block/cauldron/CauldronBehavior;POWDER_SNOW_CAULDRON_BEHAVIOR:Lnet/minecraft/block/cauldron/CauldronBehavior$CauldronBehaviorMap;
      intermediary field_28011 Lnet/minecraft/class_5620;field_28011:Lnet/minecraft/class_5620$class_8821;
      official f Lkn;f:Lkn$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_ACTION for all items.

      Returns:
      the created map
      Mappings:
      Namespace Name Mixin selector
      named createMap Lnet/minecraft/block/cauldron/CauldronBehavior;createMap(Ljava/lang/String;)Lnet/minecraft/block/cauldron/CauldronBehavior$CauldronBehaviorMap;
      intermediary method_32206 Lnet/minecraft/class_5620;method_32206(Ljava/lang/String;)Lnet/minecraft/class_5620$class_8821;
      official a Lkn;a(Ljava/lang/String;)Lkn$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 state
      world - the world where the cauldron is located
      pos - the cauldron's position
      player - the interacting player
      hand - the hand interacting with the cauldron
      stack - the stack in the player's hand
      Returns:
      a successful action result if this behavior succeeds, ActionResult.PASS_TO_DEFAULT_BLOCK_ACTION otherwise
      Mappings:
      Namespace Name Mixin selector
      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;
      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;
      official interact Lkn;interact(Ldxu;Ldhh;Ljh;Lcpw;Lbth;Lcxo;)Lbti;
    • registerBehavior

      static void registerBehavior()
      Registers the vanilla cauldron behaviors.
      Mappings:
      Namespace Name Mixin selector
      named registerBehavior Lnet/minecraft/block/cauldron/CauldronBehavior;registerBehavior()V
      intermediary method_32212 Lnet/minecraft/class_5620;method_32212()V
      official a Lkn;a()V
    • registerBucketBehavior

      static void registerBucketBehavior(Map<Item,CauldronBehavior> behavior)
      Registers the behavior for filled buckets in the specified behavior map.
      Mappings:
      Namespace Name Mixin selector
      named registerBucketBehavior Lnet/minecraft/block/cauldron/CauldronBehavior;registerBucketBehavior(Ljava/util/Map;)V
      intermediary method_34850 Lnet/minecraft/class_5620;method_34850(Ljava/util/Map;)V
      official a Lkn;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 state
      world - the world where the cauldron is located
      pos - the cauldron's position
      player - the interacting player
      hand - the hand interacting with the cauldron
      stack - the stack in the player's hand
      output - the item stack that replaces the interaction stack when the cauldron is emptied
      fullPredicate - a predicate used to check if the cauldron can be emptied into the output stack
      soundEvent - the sound produced by emptying
      Returns:
      a successful action result if emptied, ActionResult.PASS_TO_DEFAULT_BLOCK_ACTION otherwise
      Mappings:
      Namespace Name Mixin selector
      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;
      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;
      official a Lkn;a(Ldxu;Ldhh;Ljh;Lcpw;Lbth;Lcxo;Lcxo;Ljava/util/function/Predicate;Laxe;)Lbti;
    • 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 located
      pos - the cauldron's position
      player - the interacting player
      hand - the hand interacting with the cauldron
      stack - the filled bucket stack in the player's hand
      state - the filled cauldron state
      soundEvent - the sound produced by filling
      Returns:
      a successful action result
      Mappings:
      Namespace Name Mixin selector
      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;
      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;
      official a Lkn;a(Ldhh;Ljh;Lcpw;Lbth;Lcxo;Ldxu;Laxe;)Lbti;
    • tryFillWithWater

      private static ActionResult tryFillWithWater(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named tryFillWithWater Lnet/minecraft/block/cauldron/CauldronBehavior;tryFillWithWater(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_62706 Lnet/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 a Lkn;a(Ldxu;Ldhh;Ljh;Lcpw;Lbth;Lcxo;)Lbti;
    • tryFillWithLava

      private static ActionResult tryFillWithLava(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named tryFillWithLava Lnet/minecraft/block/cauldron/CauldronBehavior;tryFillWithLava(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_62707 Lnet/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 b Lkn;b(Ldxu;Ldhh;Ljh;Lcpw;Lbth;Lcxo;)Lbti;
    • tryFillWithPowderSnow

      private static ActionResult tryFillWithPowderSnow(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named tryFillWithPowderSnow Lnet/minecraft/block/cauldron/CauldronBehavior;tryFillWithPowderSnow(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_62708 Lnet/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 c Lkn;c(Ldxu;Ldhh;Ljh;Lcpw;Lbth;Lcxo;)Lbti;
    • cleanShulkerBox

      private static ActionResult cleanShulkerBox(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named cleanShulkerBox Lnet/minecraft/block/cauldron/CauldronBehavior;cleanShulkerBox(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_62709 Lnet/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 d Lkn;d(Ldxu;Ldhh;Ljh;Lcpw;Lbth;Lcxo;)Lbti;
    • cleanBanner

      private static ActionResult cleanBanner(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named cleanBanner Lnet/minecraft/block/cauldron/CauldronBehavior;cleanBanner(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_62710 Lnet/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 e Lkn;e(Ldxu;Ldhh;Ljh;Lcpw;Lbth;Lcxo;)Lbti;
    • cleanArmor

      private static ActionResult cleanArmor(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      named cleanArmor Lnet/minecraft/block/cauldron/CauldronBehavior;cleanArmor(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_62711 Lnet/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 f Lkn;f(Ldxu;Ldhh;Ljh;Lcpw;Lbth;Lcxo;)Lbti;
    • isUnderwater

      private static boolean isUnderwater(World world, BlockPos pos)
      Mappings:
      Namespace Name Mixin selector
      named isUnderwater Lnet/minecraft/block/cauldron/CauldronBehavior;isUnderwater(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)Z
      intermediary method_62705 Lnet/minecraft/class_5620;method_62705(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;)Z
      official a Lkn;a(Ldhh;Ljh;)Z