Interface WaterConditionSource
- All Superinterfaces:
ConditionSource, SurfaceRule, Wrapper
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:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleanIf true, adds the distance to the surface to the offset, effectively checking whether the surface block above this one is above water.static WaterConditionSource.Builderbuilder()Creates a new builder.static WaterConditionSourceof(int offset, int surfaceDepthMultiplier, boolean addStoneDepth) Creates a new water condition source.intoffset()The value added to the water depth before the comparison.intHow much the check is affected by the surface depth, between-20and20.default WaterConditionSource.BuilderConverts this object back to a builder.Methods inherited from interface ConditionSource
not, thenMethods inherited from interface Wrapper
asHandle, toMinecraft, unwrap
-
Method Details
-
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
How much the check is affected by the surface depth, between-20and20.- Returns:
- the surface depth multiplier
- Since:
- 3.0.0
-
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
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 comparisonsurfaceDepthMultiplier- how much the check is affected by the surface depthaddStoneDepth- whether the distance to the surface is added to the offset- Returns:
- the water condition source
- Since:
- 3.0.0
-
builder
Creates a new builder.- Returns:
- a new builder
- Since:
- 3.0.0
-