minecraft:liquid_detection

The definitions for how a block behaves when detecting liquid. Only one rule definition is allowed per liquid type - if multiple are specified, the first will be used and the rest will be ignored.

Properties

PropertyTypeDefaultWhat it does
detection_rules requiredList of object1 to 1 entries—
liquid_typeTextwater"water"The type of liquid this detection rule is for. Currently, `water` is the only supported liquid type. If this field is omitted, `water` will be the liquid type by default.
can_contain_liquidBooleanfalseWhether this block can contain the liquid. For example, if the liquid type is `water`, this means the block can be waterlogged.
on_liquid_touchesTextbroken, popped, blocking, no_reaction"blocking"How the block reacts to flowing water. Must be one of the following options: "blocking" - The default value for this field. The block stops the liquid from flowing. "broken" - The block is destroyed completely. "popped" - The block is destroyed and its item is spawned. "no_reaction" - The block is unaffected; visually, the liquid will flow through the block.
stops_liquid_flowing_from_directionList of text[]When a block contains a liquid, controls the directions in which the liquid can't flow out from the block. Also controls the directions in which a block can stop liquid flowing into it if `no_reaction` is set for the `on_liquid_touches` field. Can be a list of the following directions: "up", "down", "north", "south", "east", "west". The default is an empty list; this means that liquid can flow out of all directions by default.
use_liquid_clippingBooleanfalseWhether this block uses the encompassing collider to visually clip the liquid. The encompassing collider is the smallest single AABB that contains all of the block's colliders. A liquid's base visual shape is ALWAYS a quad, they do not have more subdivisions. When use_liquid_clipping is TRUE, the game will attempt to reduce the visible volume of water if the collision shape allows it. Eg. a wall will turn the water base shape into a rectangle on the side of the incoming water. When use_liquid_clipping is FALSE, the game will preserve the water base shape as a full square, no matter what the collision shape of the block they share space with is.

Example from the game files

This is how vanilla black_concrete_slab uses it in Minecraft Bedrock 1.26.60.5:

{
  "minecraft:liquid_detection": {
    "detection_rules": [
      {
        "liquid_type": "water",
        "can_contain_liquid": true,
        "on_liquid_touches": "blocking"
      }
    ]
  }
}

Used by 66

Vanilla blocks with minecraft:liquid_detection in their definition:

black_concrete_slabblack_concrete_stairsblack_wool_slabblack_wool_stairsblue_concrete_slabblue_concrete_stairsblue_wool_slabblue_wool_stairsbrown_concrete_slabbrown_concrete_stairsbrown_wool_slabbrown_wool_stairscyan_concrete_slabcyan_concrete_stairscyan_wool_slabcyan_wool_stairsgray_concrete_slabgray_concrete_stairsgray_wool_slabgray_wool_stairsgreen_concrete_slabgreen_concrete_stairsgreen_wool_slabgreen_wool_stairslight_blue_concrete_slablight_blue_concrete_stairslight_blue_wool_slablight_blue_wool_stairslight_gray_concrete_slablight_gray_concrete_stairslight_gray_wool_slablight_gray_wool_stairslime_concrete_slablime_concrete_stairslime_wool_slablime_wool_stairsmagenta_concrete_slabmagenta_concrete_stairsmagenta_wool_slabmagenta_wool_stairsorange_concrete_slaborange_concrete_stairsorange_wool_slaborange_wool_stairspink_concrete_slabpink_concrete_stairspink_wool_slabpink_wool_stairspurple_concrete_slabpurple_concrete_stairspurple_wool_slabpurple_wool_stairsred_concrete_slabred_concrete_stairsred_shrubred_wool_slabred_wool_stairsshelf_mushroomwhite_concrete_slabwhite_concrete_stairswhite_wool_slabwhite_wool_stairsyellow_concrete_slabyellow_concrete_stairsyellow_wool_slabyellow_wool_stairs

Related components