Interface RuleTest

All Superinterfaces:
Wrapper
All Known Subinterfaces:
AlwaysTrueTest, BlockMatchTest, BlockStateMatchTest, RandomBlockMatchTest, RandomBlockStateMatchTest, TagMatchTest

@NullMarked @AsOf("2.3.0") public interface RuleTest extends Wrapper
Rule tests are used to test if a block matches specific conditions.
Since:
2.3.0
See Also:
  • Method Details

    • alwaysTrue

      @AsOf("2.3.0") static AlwaysTrueTest alwaysTrue()
      Matches any block.
      Returns:
      the always true test
      Since:
      2.3.0
    • blockMatch

      @AsOf("2.3.0") static BlockMatchTest blockMatch(Material block)
      Tests the block is the specified block.
      Parameters:
      block - the block to match
      Returns:
      the block match test
      Since:
      2.3.0
    • blockStateMatch

      @AsOf("2.3.0") static BlockStateMatchTest blockStateMatch(BlockData blockState)
      Tests is the block for the specified BlockData.
      Parameters:
      blockState - the block blockState to match
      Returns:
      the block blockState match test
      Since:
      2.3.0
    • blockStateMatch

      @AsOf("3.0.0") static BlockStateMatchTest blockStateMatch(Material material)
      Tests is the block for the specified Material.
      Parameters:
      material - the material to match
      Returns:
      the block material match test
      Since:
      3.0.0
    • tagMatch

      @AsOf("3.0.0") static TagMatchTest tagMatch(ResourceKey tag)
      Tests if the block is in the specified block tag.
      Parameters:
      tag - the tag to match
      Returns:
      the tag match test
      Since:
      3.0.0
    • tagMatch

      @AsOf("2.3.0") static TagMatchTest tagMatch(Tag<Material> tag)
      Tests if the block is in the specified block tag.
      Parameters:
      tag - the tag to match
      Returns:
      the tag match test
      Since:
      2.3.0
    • randomBlockMatch

      @AsOf("2.3.0") static RandomBlockMatchTest randomBlockMatch(Material block, float probability)
      Tests the block is the specified block. Then only matches with a given probability.
      Parameters:
      block - the block to match
      probability - the probability of matching
      Returns:
      the random block match test
      Since:
      2.3.0
    • randomBlockStateMatch

      @AsOf("2.3.0") static RandomBlockStateMatchTest randomBlockStateMatch(BlockData state, float probability)
      Tests is the block for the specified BlockData. Then only matches with a given probability.
      Parameters:
      state - the block blockState to match
      probability - the probability of matching
      Returns:
      the random block blockState match test
      Since:
      2.3.0
    • randomBlockStateMatch

      @AsOf("3.0.0") static RandomBlockStateMatchTest randomBlockStateMatch(Material material, float probability)
      Tests is the block for the specified Material. Then only matches with a given probability.
      Parameters:
      material - the material to match
      probability - the probability of matching
      Returns:
      the random block material match test
      Since:
      3.0.0
    • decode

      @AsOf("3.3.0") static RuleTest decode(Object minecraftRuleTest)
      Reads a Minecraft rule test into a Wyck rule test.
      Parameters:
      minecraftRuleTest - the Minecraft rule test
      Returns:
      the decoded rule test
      Since:
      3.3.0