Interface EnvironmentScanPlacement
- All Superinterfaces:
PlacementModifier, Wrapper
Scans blocks either up or down, until the target condition is met.
Returns the block position for which the target condition matches.
If no target can be found within the maximum number of steps, returns empty.
- Since:
- 3.0.0
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionEach step must match this block predicate to continue the scan.builder()Creates a new builder.One ofupordown.intmaxSteps()Maximum number of steps to search between 1 and 32.static EnvironmentScanPlacementof(BlockFace directionOfSearch, BlockPredicate targetCondition, BlockPredicate allowedSearchCondition, int maxSteps) Creates a new environment scan placement.The block predicate that is searched for.default EnvironmentScanPlacement.BuilderConverts this object back to a builder.Methods inherited from interface Wrapper
asHandle, toMinecraft, unwrap
-
Method Details
-
directionOfSearch
-
targetCondition
The block predicate that is searched for.- Returns:
- the target condition
- Since:
- 3.0.0
-
allowedSearchCondition
Each step must match this block predicate to continue the scan. If a block that doesn't match it is met, but no target block is found, this returns empty.- Returns:
- the allowed search condition
- Since:
- 3.0.0
-
maxSteps
Maximum number of steps to search between 1 and 32.- Returns:
- the maximum number of steps
- 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 EnvironmentScanPlacement of(BlockFace directionOfSearch, BlockPredicate targetCondition, BlockPredicate allowedSearchCondition, int maxSteps) Creates a new environment scan placement.- Parameters:
directionOfSearch- one ofupordowntargetCondition- the block predicate that is searched forallowedSearchCondition- each step must match this block predicate to continue the scanmaxSteps- maximum number of steps to search between 1 and 32- Returns:
- a new environment scan placement
- Since:
- 3.0.0
-
builder
Creates a new builder.- Returns:
- a new builder
- Since:
- 3.0.0
-