Interface EnvironmentScanPlacement

All Superinterfaces:
PlacementModifier, Wrapper

@NullMarked @AsOf("3.0.0") public interface EnvironmentScanPlacement extends PlacementModifier
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:
  • Method Details

    • directionOfSearch

      @AsOf("3.0.0") BlockFace directionOfSearch()
      One of up or down.
      Returns:
      the direction of search
      Since:
      3.0.0
    • targetCondition

      @AsOf("3.0.0") BlockPredicate targetCondition()
      The block predicate that is searched for.
      Returns:
      the target condition
      Since:
      3.0.0
    • allowedSearchCondition

      @AsOf("3.0.0") BlockPredicate 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

      @AsOf("3.0.0") int maxSteps()
      Maximum number of steps to search between 1 and 32.
      Returns:
      the maximum number of steps
      Since:
      3.0.0
    • toBuilder

      @AsOf("3.0.0") default EnvironmentScanPlacement.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 EnvironmentScanPlacement of(BlockFace directionOfSearch, BlockPredicate targetCondition, BlockPredicate allowedSearchCondition, int maxSteps)
      Creates a new environment scan placement.
      Parameters:
      directionOfSearch - one of up or down
      targetCondition - the block predicate that is searched for
      allowedSearchCondition - each step must match this block predicate to continue the scan
      maxSteps - maximum number of steps to search between 1 and 32
      Returns:
      a new environment scan placement
      Since:
      3.0.0
    • builder

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