Class ExperienceReward
java.lang.Object
com.github.darksoulq.abyssallib.world.advancement.reward.ExperienceReward
- All Implemented Interfaces:
AdvancementReward
An advancement reward that grants a fixed amount of experience points to the player.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<ExperienceReward> The codec used for serializing and deserializing the experience reward.static final RewardType<ExperienceReward> The registered type definition for the experience reward. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRewardType<?> getType()Retrieves the reward type definition associated with this instance.voidgrant(org.bukkit.entity.Player player) Adds the experience amount directly to the player.
-
Field Details
-
CODEC
The codec used for serializing and deserializing the experience reward. -
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
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) Adds the experience amount directly to the player.- Specified by:
grantin interfaceAdvancementReward- Parameters:
player- The player receiving the reward.
-