Package cz.jeme.advancium
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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceBuilder for constructing instances ofCustomAdvancementRewards. -
Method Summary
Modifier and TypeMethodDescriptionstatic CustomAdvancementRewardsempty()Returns an empty instance ofCustomAdvancementRewardswith no rewards.intGets the amount of experience granted upon completion of the advancement.@Unmodifiable List<org.bukkit.NamespacedKey> Gets aListofNamespacedKeys for loot tables granted as rewards.default @Unmodifiable List<org.bukkit.loot.LootTable> Gets aListof loot tables granted as rewards.@Unmodifiable List<org.bukkit.NamespacedKey> Gets aListofNamespacedKeys for recipes granted as rewards.default @Unmodifiable List<org.bukkit.inventory.Recipe> recipes()Gets aListof recipes granted as rewards.rewards()Creates a new builder for configuring and constructingCustomAdvancementRewards.
-
Method Details
-
rewards
Creates a new builder for configuring and constructingCustomAdvancementRewards.- Returns:
- a new builder instance
-
empty
Returns an empty instance ofCustomAdvancementRewardswith 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 aListofNamespacedKeys for recipes granted as rewards.- Returns:
- an unmodifiable
Listof recipe keys
-
recipes
Gets aListof recipes granted as rewards.This method resolves recipe keys into actual
Recipeobjects available on the server. If a recipe key is invalid or unresolved, an exception will be thrown.- Returns:
- an unmodifiable
ListofRecipeobjects - Throws:
NullPointerException- if resolving any of the recipe keys fails
-
lootTableKeys
@Unmodifiable List<org.bukkit.NamespacedKey> lootTableKeys()Gets aListofNamespacedKeys for loot tables granted as rewards.- Returns:
- an unmodifiable
Listof loot table keys.
-
lootTables
Gets aListof loot tables granted as rewards.This method resolves loot table keys into actual
LootTableobjects available on the server. If a loot table key is invalid or unresolved, an exception will be thrown.- Returns:
- an unmodifiable
ListofLootTableobjects - Throws:
NullPointerException- if resolving any of the loot table keys fails
-