Class AdvancementReward
java.lang.Object
com.ryankshah.questapi.api.quest.reward.impl.AdvancementReward
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<AdvancementReward> static final RewardType<AdvancementReward> static final net.minecraft.resources.Identifier -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.resources.Identifiernet.minecraft.network.chat.Componentdescribe()Human-readable description shown in the rewards panel, e.g.voidgrant(QuestContext context) Grants this reward to the player.net.minecraft.world.item.ItemStackicon()Icon rendered next to this reward in the default GUI.net.minecraft.resources.IdentifiertypeId()
-
Field Details
-
TYPE_ID
public static final net.minecraft.resources.Identifier TYPE_ID -
CODEC
-
TYPE
-
-
Constructor Details
-
AdvancementReward
public AdvancementReward(net.minecraft.resources.Identifier advancementId)
-
-
Method Details
-
typeId
public net.minecraft.resources.Identifier typeId()- Specified by:
typeIdin interfaceQuestReward
-
describe
public net.minecraft.network.chat.Component describe()Description copied from interface:QuestRewardHuman-readable description shown in the rewards panel, e.g. "5x Iron Ingot".- Specified by:
describein interfaceQuestReward
-
icon
public net.minecraft.world.item.ItemStack icon()Description copied from interface:QuestRewardIcon rendered next to this reward in the default GUI.- Specified by:
iconin interfaceQuestReward
-
grant
Description copied from interface:QuestRewardGrants this reward to the player. Always called server-side, and always exactly once per quest completion thanks to therewardClaimedguard inQuestManager.- Specified by:
grantin interfaceQuestReward
-
advancementId
public net.minecraft.resources.Identifier advancementId()
-