Class CustomLootTableReward
java.lang.Object
com.github.darksoulq.abyssallib.world.advancement.reward.CustomLootTableReward
- All Implemented Interfaces:
AdvancementReward
An advancement reward that generates and distributes items using a custom
LootTable defined in AbyssalLib's registry or inline.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<CustomLootTableReward> The hybrid fallback codec handling both explicit map definitions and simple string references.static final RewardType<CustomLootTableReward> The registered type definition for the custom loot table reward. -
Constructor Summary
ConstructorsConstructorDescriptionCustomLootTableReward(String id, LootTable table) Constructs a new CustomLootTableReward. -
Method Summary
Modifier and TypeMethodDescriptionRewardType<?> getType()Retrieves the reward type definition associated with this instance.voidgrant(org.bukkit.entity.Player player) Generates loot using the configured table and grants it to the player.
-
Field Details
-
CODEC
The hybrid fallback codec handling both explicit map definitions and simple string references. -
TYPE
The registered type definition for the custom loot table reward.
-
-
Constructor Details
-
CustomLootTableReward
-
-
Method Details
-
getType
Description copied from interface:AdvancementRewardRetrieves the reward type definition associated with this instance. This is used to identify the logic and handle polymorphic serialization.- Specified by:
getTypein interfaceAdvancementReward- Returns:
- The
RewardTypecharacterizing this specific reward.
-
grant
public void grant(org.bukkit.entity.Player player) Generates loot using the configured table and grants it to the player.- Specified by:
grantin interfaceAdvancementReward- Parameters:
player- The player receiving the reward.
-