Interface CustomAdvancementRewards


@NullMarked public interface CustomAdvancementRewards
Represents the rewards granted upon completing a custom advancement.

Custom advancements can reward players with experience, recipes, items or loot tables. This interface provides methods to access and configure these rewards.

  • Method Details

    • rewards

      Creates a new builder for configuring and constructing CustomAdvancementRewards.
      Returns:
      a new builder instance
    • empty

      static CustomAdvancementRewards empty()
      Returns an empty instance of CustomAdvancementRewards with no rewards.
      Returns:
      an empty rewards object
    • experience

      int experience()
      Gets the amount of experience granted upon completion of the advancement.
      Returns:
      the amount of experience points
    • recipeKeys

      @Unmodifiable List<org.bukkit.NamespacedKey> recipeKeys()
      Gets a List of NamespacedKeys for recipes granted as rewards.
      Returns:
      an unmodifiable List of recipe keys
    • recipes

      default @Unmodifiable List<org.bukkit.inventory.Recipe> recipes()
      Gets a List of recipes granted as rewards.

      This method resolves recipe keys into actual Recipe objects available on the server. If a recipe key is invalid or unresolved, an exception will be thrown.

      Returns:
      an unmodifiable List of Recipe objects
      Throws:
      NullPointerException - if resolving any of the recipe keys fails
    • lootTableKeys

      @Unmodifiable List<org.bukkit.NamespacedKey> lootTableKeys()
      Gets a List of NamespacedKeys for loot tables granted as rewards.
      Returns:
      an unmodifiable List of loot table keys.
    • lootTables

      default @Unmodifiable List<org.bukkit.loot.LootTable> lootTables()
      Gets a List of loot tables granted as rewards.

      This method resolves loot table keys into actual LootTable objects available on the server. If a loot table key is invalid or unresolved, an exception will be thrown.

      Returns:
      an unmodifiable List of LootTable objects
      Throws:
      NullPointerException - if resolving any of the loot table keys fails