Class LootTableReward
java.lang.Object
com.github.darksoulq.abyssallib.world.advancement.reward.LootTableReward
- All Implemented Interfaces:
AdvancementReward
An advancement reward that hooks into vanilla Minecraft's default loot tables.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<LootTableReward> The codec used for serializing and deserializing the vanilla loot table reward.static final RewardType<LootTableReward> The registered type definition for the vanilla loot table reward. -
Constructor Summary
ConstructorsConstructorDescriptionLootTableReward(org.bukkit.loot.LootTable table) Constructs a new LootTableReward. -
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 vanilla table and grants it to the player.
-
Field Details
-
CODEC
The codec used for serializing and deserializing the vanilla loot table reward. -
TYPE
The registered type definition for the vanilla loot table reward.
-
-
Constructor Details
-
LootTableReward
public LootTableReward(org.bukkit.loot.LootTable table) Constructs a new LootTableReward.- Parameters:
table- The vanilla loot table to evaluate.
-
-
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 vanilla table and grants it to the player.- Specified by:
grantin interfaceAdvancementReward- Parameters:
player- The player receiving the reward.
-