Interface PlacementModifier

All Superinterfaces:
Wrapper
All Known Implementing Classes:
PlacementModifier.BiomeFilter, PlacementModifier.BlockPredicateFilter, PlacementModifier.CountPlacement, PlacementModifier.EnvironmentScanPlacement, PlacementModifier.FixedPlacement, PlacementModifier.HeightmapPlacement, PlacementModifier.HeightRangePlacement, PlacementModifier.InSquarePlacement, PlacementModifier.NoiseBasedCountPlacement, PlacementModifier.NoiseThresholdCountPlacement, PlacementModifier.RandomOffsetPlacement, PlacementModifier.RarityFilter, PlacementModifier.SurfaceRelativeThresholdFilter, PlacementModifier.SurfaceWaterDepthFilter

  • Field Details

  • Method Details

    • biomeFilter

      @AsOf("2.3.0") static PlacementModifier biomeFilter()
      Creates a placement modifier that filters positions based on the biome.
      Returns:
      a biome filter placement modifier
      Since:
      2.3.0
    • inSquare

      @AsOf("2.3.0") static PlacementModifier inSquare()
      Creates a placement modifier that ensures placement occurs within a square grid.
      Returns:
      a placement modifier configured for square-based placement
      Since:
      2.3.0
    • rarityFilter

      @AsOf("2.3.0") static PlacementModifier rarityFilter(int chance)
      Filters a position based on a specified chance value, allowing positions to be kept with a probability of 1/chance.
      Parameters:
      chance - the probability denominator which determines how likely a position is to be kept and must be greater than 0
      Returns:
      a placement modifier that applies the rarity filter
      Since:
      2.3.0
    • surfaceWaterDepth

      @AsOf("2.3.0") static PlacementModifier surfaceWaterDepth(int maxWaterDepth)
      Creates a placement modifier that filters positions based on their surface water depth.
      Parameters:
      maxWaterDepth - the maximum depth of water allowed on the surface for a position to pass the filter
      Returns:
      a surface water depth placement modifier
      Since:
      2.3.0
    • noiseBasedCount

      @AsOf("2.3.0") static PlacementModifier noiseBasedCount(int noiseToCountRatio, double noiseFactor, double noiseOffset)
      Creates a placement modifier that selects positions based on noise settings.
      Parameters:
      noiseToCountRatio - the ratio between noise value and count, influencing placement density
      noiseFactor - the multiplier applied to the noise value for scaling
      noiseOffset - the constant offset added to the noise value for adjustment
      Returns:
      a placement modifier that applies noise-based distribution logic
      Since:
      2.3.0
    • noiseThresholdCount

      @AsOf("2.3.0") static PlacementModifier noiseThresholdCount(double noiseLevel, int belowNoise, int aboveNoise)
      Creates a placement modifier that adjusts placement based on a noise threshold. Positions are selected based on whether the noise value at a position is above or below the specified threshold, determining the count of positions to retain.
      Parameters:
      noiseLevel - the noise level threshold used to decide placement
      belowNoise - the number of placements to retain when the noise level is below the threshold
      aboveNoise - the number of placements to retain when the noise level is above the threshold
      Returns:
      a placement modifier configured for noise-based threshold placement
      Since:
      2.3.0
    • heightmap

      @AsOf("2.3.0") static PlacementModifier heightmap(HeightmapType heightmap)
      Creates a placement modifier that filters positions based on a specified heightmap type.
      Parameters:
      heightmap - the type of heightmap to use for filtering positions
      Returns:
      a placement modifier configured to use the specified heightmap type
      Since:
      2.3.0
    • surfaceRelativeThreshold

      @AsOf("2.3.0") static PlacementModifier surfaceRelativeThreshold(HeightmapType heightmap, int minInclusive, int maxInclusive)
      Creates a placement modifier that filters positions based on their relative surface height using the specified heightmap type and a range of inclusive minimum and maximum height thresholds. Positions are retained if they fall within the given range on the specified heightmap.
      Parameters:
      heightmap - the type of heightmap to use for filtering positions
      minInclusive - the inclusive minimum height threshold for filtering
      maxInclusive - the inclusive maximum height threshold for filtering
      Returns:
      a placement modifier that applies the surface-relative height threshold filter
      Since:
      2.3.0
    • heightRange

      @AsOf("2.3.0") static PlacementModifier heightRange(HeightProvider height)
      Creates a placement modifier that defines a range of vertical heights where placement is allowed.
      Parameters:
      height - the height provider that specifies the inclusive minimum and maximum vertical bounds
      Returns:
      a placement modifier configured for height-based placement within the specified range
      Since:
      2.3.0
    • heightRangeUniform

      @AsOf("2.3.0") static PlacementModifier heightRangeUniform(VerticalAnchor minInclusive, VerticalAnchor maxInclusive)
      Creates a PlacementModifier that defines a uniform height range for placement between the specified minimum and maximum vertical anchors, inclusive.
      Parameters:
      minInclusive - the minimum vertical anchor for the placement range, inclusive
      maxInclusive - the maximum vertical anchor for the placement range, inclusive
      Returns:
      a PlacementModifier that applies a uniform height placement between the given bounds
      Since:
      2.3.0
    • heightRangeTriangle

      @AsOf("2.3.0") static PlacementModifier heightRangeTriangle(VerticalAnchor minInclusive, VerticalAnchor maxInclusive)
      Creates a height range placement modifier using a triangular distribution between the specified minimum and maximum vertical anchors. The distribution will favor heights closer to midpoints within the range.
      Parameters:
      minInclusive - the minimum vertical anchor, inclusive
      maxInclusive - the maximum vertical anchor, inclusive
      Returns:
      a PlacementModifier that represents a triangular height range placement
      Since:
      2.3.0
    • fixedPlacement

      @AsOf("2.3.0") static PlacementModifier fixedPlacement(BlockVector... positions)
      Creates a fixed placement modifier that defines positions where blocks or features will be placed.
      Parameters:
      positions - an array of BlockVector objects representing the fixed positions for placement
      Returns:
      a PlacementModifier that applies the fixed placement defined by the specified positions
      Since:
      2.3.0
    • count

      @AsOf("2.3.0") static PlacementModifier count(IntProvider count)
      Repeats placement a number of times sampled from the count provider.
      Parameters:
      count - the count provider
      Returns:
      a count placement modifier
      Since:
      2.3.0
    • count

      @AsOf("2.3.0") static PlacementModifier count(int count)
      Repeats placement a fixed number of times.
      Parameters:
      count - the fixed count
      Returns:
      a count placement modifier
      Since:
      2.3.0
    • randomOffset

      @AsOf("2.3.0") static PlacementModifier randomOffset(IntProvider xzSpread, IntProvider ySpread)
      Randomly offsets the position by the given spreads.
      Parameters:
      xzSpread - the horizontal spread provider
      ySpread - the vertical spread provider
      Returns:
      a random offset placement modifier
      Since:
      2.3.0
    • randomOffsetVertical

      @AsOf("2.3.0") static PlacementModifier randomOffsetVertical(IntProvider ySpread)
      Randomly offsets the position vertically only.
      Parameters:
      ySpread - the vertical spread provider
      Returns:
      a random offset placement modifier
      Since:
      2.3.0
    • randomOffsetHorizontal

      @AsOf("2.3.0") static PlacementModifier randomOffsetHorizontal(IntProvider xzSpread)
      Randomly offsets the position horizontally only.
      Parameters:
      xzSpread - the horizontal spread provider
      Returns:
      a random offset placement modifier
      Since:
      2.3.0
    • randomOffsetTriangle

      @AsOf("2.3.0") static PlacementModifier randomOffsetTriangle(int xzRange, int yRange)
      Randomly offsets the position using triangular spreads over the given ranges.
      Parameters:
      xzRange - the horizontal range
      yRange - the vertical range
      Returns:
      a random offset placement modifier
      Since:
      2.3.0
    • blockPredicateFilter

      @AsOf("2.3.0") static PlacementModifier blockPredicateFilter(BlockPredicate predicate)
      Keeps positions that satisfy the given block predicate.
      Parameters:
      predicate - the predicate to test
      Returns:
      a block predicate filter modifier
      Since:
      2.3.0
    • environmentScan

      @AsOf("2.3.0") static PlacementModifier environmentScan(BlockFace directionOfSearch, BlockPredicate targetCondition, int maxSteps)
      Scans vertically for a target condition, allowing the default search condition.
      Parameters:
      directionOfSearch - the vertical search direction (UP or DOWN)
      targetCondition - the condition the scan is looking for
      maxSteps - the maximum number of steps, in [1, 32]
      Returns:
      an environment scan placement modifier
      Since:
      2.3.0
    • environmentScan

      @AsOf("2.3.0") static PlacementModifier environmentScan(BlockFace directionOfSearch, BlockPredicate targetCondition, BlockPredicate allowedSearchCondition, int maxSteps)
      Scans vertically for a target condition while an allowed search condition holds.
      Parameters:
      directionOfSearch - the vertical search direction (UP or DOWN)
      targetCondition - the condition the scan is looking for
      allowedSearchCondition - the condition that must hold to keep scanning
      maxSteps - the maximum number of steps, in [1, 32]
      Returns:
      an environment scan placement modifier
      Since:
      2.3.0
    • toMinecraft

      @AsOf("2.3.0") default Object toMinecraft()
      Description copied from interface: Wrapper
      Convert this handle to the real Minecraft object.
      Specified by:
      toMinecraft in interface Wrapper
      Returns:
      the real Minecraft object