Class LootTableReward

java.lang.Object
com.github.darksoulq.abyssallib.world.advancement.reward.LootTableReward
All Implemented Interfaces:
AdvancementReward

public class LootTableReward extends Object implements AdvancementReward
An advancement reward that hooks into vanilla Minecraft's default loot tables.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Codec<LootTableReward>
    The codec used for serializing and deserializing the vanilla loot table reward.
    The registered type definition for the vanilla loot table reward.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LootTableReward(org.bukkit.loot.LootTable table)
    Constructs a new LootTableReward.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the reward type definition associated with this instance.
    void
    grant(org.bukkit.entity.Player player)
    Generates loot using the vanilla table and grants it to the player.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CODEC

      public static final Codec<LootTableReward> CODEC
      The codec used for serializing and deserializing the vanilla loot table reward.
    • TYPE

      public static final RewardType<LootTableReward> 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

      public RewardType<?> getType()
      Description copied from interface: AdvancementReward
      Retrieves the reward type definition associated with this instance. This is used to identify the logic and handle polymorphic serialization.
      Specified by:
      getType in interface AdvancementReward
      Returns:
      The RewardType characterizing 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:
      grant in interface AdvancementReward
      Parameters:
      player - The player receiving the reward.