Class ExperienceReward

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

public class ExperienceReward extends Object implements AdvancementReward
An advancement reward that grants a fixed amount of experience points to the player.
  • Field Summary

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

    Constructors
    Constructor
    Description
    ExperienceReward(int amount)
    Constructs a new ExperienceReward.
  • Method Summary

    Modifier and Type
    Method
    Description
    Retrieves the reward type definition associated with this instance.
    void
    grant(org.bukkit.entity.Player player)
    Adds the experience amount directly to the player.

    Methods inherited from class Object

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

    • CODEC

      public static final Codec<ExperienceReward> CODEC
      The codec used for serializing and deserializing the experience reward.
    • TYPE

      public static final RewardType<ExperienceReward> TYPE
      The registered type definition for the experience reward.
  • Constructor Details

    • ExperienceReward

      public ExperienceReward(int amount)
      Constructs a new ExperienceReward.
      Parameters:
      amount - The integer amount of experience points to grant.
  • 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)
      Adds the experience amount directly to the player.
      Specified by:
      grant in interface AdvancementReward
      Parameters:
      player - The player receiving the reward.