Interface WaterConditionSource

All Superinterfaces:
ConditionSource, SurfaceRule, Wrapper

@NullMarked @AsOf("3.0.0") public interface WaterConditionSource extends ConditionSource
Checks if the current position is above water, based on terrain depth. If there is no water above this block, the condition always passes regardless of the field values.
Since:
3.0.0
See Also:
  • Method Details

    • offset

      @AsOf("3.0.0") int offset()
      The value added to the water depth before the comparison. May be negative to match blocks at a specific depth relative to the water surface.
      Returns:
      the offset
      Since:
      3.0.0
    • surfaceDepthMultiplier

      @AsOf("3.0.0") int surfaceDepthMultiplier()
      How much the check is affected by the surface depth, between -20 and 20.
      Returns:
      the surface depth multiplier
      Since:
      3.0.0
    • addStoneDepth

      @AsOf("3.0.0") boolean addStoneDepth()
      If true, adds the distance to the surface to the offset, effectively checking whether the surface block above this one is above water.
      Returns:
      whether the stone depth is added
      Since:
      3.0.0
    • toBuilder

      @AsOf("3.0.0") default WaterConditionSource.Builder toBuilder()
      Converts this object back to a builder.
      Returns:
      a builder with the same values as this object
      Since:
      3.0.0
    • of

      @AsOf("3.0.0") static WaterConditionSource of(int offset, int surfaceDepthMultiplier, boolean addStoneDepth)
      Creates a new water condition source.
      Parameters:
      offset - the value added to the water depth before the comparison
      surfaceDepthMultiplier - how much the check is affected by the surface depth
      addStoneDepth - whether the distance to the surface is added to the offset
      Returns:
      the water condition source
      Since:
      3.0.0
    • builder

      @AsOf("3.0.0") static WaterConditionSource.Builder builder()
      Creates a new builder.
      Returns:
      a new builder
      Since:
      3.0.0