Interface PosRuleTest

All Superinterfaces:
Wrapper
All Known Subinterfaces:
AxisAlignedLinearPosTest, LinearPosTest, PosAlwaysTrueTest

@NullMarked @AsOf("3.4.0") public interface PosRuleTest extends Wrapper
Wraps Minecraft's PosRuleTest: a test on where a block sits within a template, used by a processor rule to vary its chance of applying with distance from the template's origin.
Since:
3.4.0
See Also:
  • Method Details

    • alwaysTrue

      @AsOf("3.4.0") static PosAlwaysTrueTest alwaysTrue()
      Passes for every position. A rule without a position test uses this.
      Returns:
      the always-true test
      Since:
      3.4.0
    • linearPos

      @AsOf("3.4.0") static LinearPosTest linearPos(float minChance, float maxChance, int minDist, int maxDist)
      Passes with a chance that moves from minChance to maxChance as the block's distance from the template's origin moves from minDist to maxDist.
      Parameters:
      minChance - the chance at the minimum distance
      maxChance - the chance at the maximum distance
      minDist - the distance the minimum chance applies at
      maxDist - the distance the maximum chance applies at
      Returns:
      a linear position test
      Since:
      3.4.0
    • axisAlignedLinearPos

      @AsOf("3.4.0") static AxisAlignedLinearPosTest axisAlignedLinearPos(float minChance, float maxChance, int minDist, int maxDist, Axis axis)
      As linearPos(float, float, int, int), measuring distance along one axis only.
      Parameters:
      minChance - the chance at the minimum distance
      maxChance - the chance at the maximum distance
      minDist - the distance the minimum chance applies at
      maxDist - the distance the maximum chance applies at
      axis - the axis distance is measured along
      Returns:
      an axis-aligned linear position test
      Since:
      3.4.0
    • decode

      @AsOf("3.4.0") static PosRuleTest decode(Object minecraftTest)
      Reads a Minecraft position rule test.
      Parameters:
      minecraftTest - the test to read
      Returns:
      the decoded test
      Since:
      3.4.0