Interface RarityFilter

All Superinterfaces:
PlacementFilter, PlacementModifier, Wrapper

@NullMarked @AsOf("3.0.0") public interface RarityFilter extends PlacementFilter
Either returns the current position or empty. The chance of returning the position is 1 / chance.
Since:
3.0.0
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    The average chance denominator; the position is kept once on average every this many attempts.
    of(int chance)
    Creates a new rarity filter.

    Methods inherited from interface Wrapper

    asHandle, toMinecraft, unwrap
  • Method Details

    • chance

      @AsOf("3.0.0") int chance()
      The average chance denominator; the position is kept once on average every this many attempts.
      Returns:
      the chance, a positive integer
      Since:
      3.0.0
    • of

      @AsOf("3.0.0") static RarityFilter of(int chance)
      Creates a new rarity filter.
      Parameters:
      chance - the average chance denominator, a positive integer
      Returns:
      a new rarity filter
      Since:
      3.0.0