Package com.minecolonies.api.quests
Interface IQuestInstance
- All Superinterfaces:
net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
- All Known Implementing Classes:
QuestInstance
public interface IQuestInstance
extends net.neoforged.neoforge.common.util.INBTSerializable<net.minecraft.nbt.CompoundTag>
Quest instance
-
Method Summary
Modifier and TypeMethodDescriptionvoidadvanceObjective(net.minecraft.world.entity.player.Player player) Simple advance objective by one.advanceObjective(net.minecraft.world.entity.player.Player player, int nextObjective) Advance the quest objective to this id.Get the player UUID that accepted the quest.Get the colony matching the quest.@Nullable IObjectiveInstanceGet the objective data of the current objective.net.minecraft.resources.ResourceLocationgetId()Get the quest id of the quest.intGet the current objective index.getParticipant(int target) Get one of the other participants by index.Get the full list of quest participants.Get the id of the quest giver.intId of questgiver.intGet the id of the current task holder in the quest.booleanCheck if the expiration date relative to the colony day count was reached.voidOn question completion call.voidOn deletion of the quest.voidTriggered when the quest is acceptedvoidOn world load trigger.Methods inherited from interface net.neoforged.neoforge.common.util.INBTSerializable
deserializeNBT, serializeNBT
-
Method Details
-
onStart
Triggered when the quest is accepted- Parameters:
player- player accepting
-
getQuestGiver
IQuestGiver getQuestGiver()Get the id of the quest giver. Server only!- Returns:
- the id of the quest giver.
-
getQuestGiverId
int getQuestGiverId()Id of questgiver.- Returns:
- the id.
-
isValid
Check if the expiration date relative to the colony day count was reached.- Parameters:
colony- the colony to check the validity for.- Returns:
- true if so.
-
getId
net.minecraft.resources.ResourceLocation getId()Get the quest id of the quest.- Returns:
- the id.
-
onDeletion
void onDeletion()On deletion of the quest. -
advanceObjective
IObjectiveInstance advanceObjective(net.minecraft.world.entity.player.Player player, int nextObjective) Advance the quest objective to this id.- Parameters:
player- the player advancing this objective.nextObjective- the id to advance it to.- Returns:
- the next objective instance.
-
onCompletion
void onCompletion()On question completion call. -
getObjectiveIndex
int getObjectiveIndex()Get the current objective index.- Returns:
- the index number.
-
getParticipant
Get one of the other participants by index.- Parameters:
target- the target participant id.- Returns:
- the quest participant.
-
getParticipants
Get the full list of quest participants.- Returns:
- the list of participants.
-
getQuestTarget
int getQuestTarget()Get the id of the current task holder in the quest.- Returns:
- the quest participant.
-
getCurrentObjectiveInstance
Get the objective data of the current objective.- Returns:
- the data.
-
getColony
IColony getColony()Get the colony matching the quest.- Returns:
- the colony.
-
getAssignedPlayer
UUID getAssignedPlayer()Get the player UUID that accepted the quest.- Returns:
- the player uuid.
-
advanceObjective
void advanceObjective(net.minecraft.world.entity.player.Player player) Simple advance objective by one.- Parameters:
player- the player involved.
-
onWorldLoad
void onWorldLoad()On world load trigger.
-