Class AdvancementReward

java.lang.Object
com.ryankshah.questapi.api.quest.reward.impl.AdvancementReward
All Implemented Interfaces:
QuestReward

public final class AdvancementReward extends Object implements QuestReward
Grants a specific vanilla or datapack advancement to the player, by awarding every one of its criteria - a single PlayerAdvancements.award(AdvancementHolder, String) call only satisfies one criterion, so an advancement with several needs all of them awarded to actually complete.
  • Field Details

    • TYPE_ID

      public static final net.minecraft.resources.Identifier TYPE_ID
    • CODEC

      public static final com.mojang.serialization.MapCodec<AdvancementReward> CODEC
    • TYPE

      public static final RewardType<AdvancementReward> TYPE
  • Constructor Details

    • AdvancementReward

      public AdvancementReward(net.minecraft.resources.Identifier advancementId)
  • Method Details

    • typeId

      public net.minecraft.resources.Identifier typeId()
      Specified by:
      typeId in interface QuestReward
    • describe

      public net.minecraft.network.chat.Component describe()
      Description copied from interface: QuestReward
      Human-readable description shown in the rewards panel, e.g. "5x Iron Ingot".
      Specified by:
      describe in interface QuestReward
    • icon

      public net.minecraft.world.item.ItemStack icon()
      Description copied from interface: QuestReward
      Icon rendered next to this reward in the default GUI.
      Specified by:
      icon in interface QuestReward
    • grant

      public void grant(QuestContext context)
      Description copied from interface: QuestReward
      Grants this reward to the player. Always called server-side, and always exactly once per quest completion thanks to the rewardClaimed guard in QuestManager.
      Specified by:
      grant in interface QuestReward
    • advancementId

      public net.minecraft.resources.Identifier advancementId()