Interface CustomAdvancementRewards.Builder

Enclosing interface:
CustomAdvancementRewards

public static interface CustomAdvancementRewards.Builder
Builder for constructing instances of CustomAdvancementRewards.
  • Method Details

    • experience

      CustomAdvancementRewards.Builder experience(int experience)
      Sets the amount of experience granted upon completion of the advancement.
      Parameters:
      experience - the amount of experience points
      Returns:
      this builder instance for chaining
    • addRecipe

      CustomAdvancementRewards.Builder addRecipe(org.bukkit.NamespacedKey key)
      Adds a recipe reward to the advancement.
      Parameters:
      key - the NamespacedKey of the recipe
      Returns:
      this builder instance for chaining
    • addRecipe

      default <R extends org.bukkit.inventory.Recipe & org.bukkit.Keyed> CustomAdvancementRewards.Builder addRecipe(@NotNull R recipe)
      Adds a recipe reward to the advancement using a Recipe object.
      Type Parameters:
      R - the type of the recipe, which implements Recipe and Keyed
      Parameters:
      recipe - the recipe to add as a reward
      Returns:
      this builder instance for chaining
    • addRecipe

      default CustomAdvancementRewards.Builder addRecipe(@KeyPattern String key)
      Adds a recipe reward using a String key.

      The string is converted into a NamespacedKey. If the key is invalid, an exception is thrown.

      Parameters:
      key - the string representation of the recipe key
      Returns:
      this builder instance for chaining
      Throws:
      NullPointerException - if the key is invalid
    • addLootTable

      CustomAdvancementRewards.Builder addLootTable(org.bukkit.NamespacedKey key)
      Adds a loot table reward to the advancement.
      Parameters:
      key - the NamespacedKey of the loot table
      Returns:
      this builder instance for chaining
    • addLootTable

      default CustomAdvancementRewards.Builder addLootTable(org.bukkit.loot.LootTable lootTable)
      Adds a loot table reward using a LootTable object.
      Parameters:
      lootTable - the loot table to add as a reward
      Returns:
      this builder instance for chaining
    • addLootTable

      default CustomAdvancementRewards.Builder addLootTable(@KeyPattern String key)
      Adds a loot table reward using a String key.

      The string is converted into a NamespacedKey. If the key is invalid, an exception is thrown.

      Parameters:
      key - the string representation of the loot table key
      Returns:
      this builder instance for chaining
      Throws:
      NullPointerException - if the key is invalid
    • build

      Builds and returns the configured CustomAdvancementRewards.
      Returns:
      the built rewards object