Conditions and Actions Registry
Conditions
Conditions are needed to control when a quest appears. You don't want to write a winter-themed quest and then have it given out by a desert dweller, do you? That's why conditions were created; you can combine them by adding them to an array in the quest.
And I think this list will grow over time.
thequestforge:entity_is
For example:
"requirement": ["thequestforge:entity_is:minecraft:zombie"]
If the NPC is a zombie, then allow this quest to be generated.
thequestforge:entity_is_not
For example:
"requirement": ["thequestforge:entity_is_not:minecraft:zombie"]
If the NPC is NOT a zombie, then allow this quest to generate.
thequestforge:entity_tag_is
For example:
"requirement": ["thequestforge:entity_tag_is:minecraft:skeletons"]
If the NPC has the skeletons tag, then allow this quest to generate.
thequestforge:entity_tag_is_not
For example:
"requirement": ["thequestforge:entity_tag_is_not:minecraft:skeletons"]
If the NPC does not have the skeletons tag, then allow this quest to be generated.
thequestforge:is_baby
For example:
"requirement": ["thequestforge:is_baby:true"]
If the NPC is a child, then allow this quest to be generated.
You can set a true/false value here (true if the NPC is a child, false if it is not a child).
thequestforge:biome_is
For example:
"requirement": ["thequestforge:biome_is:minecraft:plains"]
If the NPC is currently in a plains biome, then allow this quest to generate.
thequestforge:biome_is_not
For example:
"requirement": ["thequestforge:biome_is_not:minecraft:plains"]
If the NPC is NOT currently in a plains biome, then allow this quest to generate.
thequestforge:biome_tag_is
For example:
"requirement": ["thequestforge:biome_tag_is:minecraft:is_desert"]
If the NPC is currently in a biome that has the is_desert tag, then allow this quest to generate.
thequestforge:biome_tag_is_not
For example:
"requirement": ["thequestforge:biome_tag_is_not:minecraft:is_desert"]
If the NPC is currently in a biome that DOES NOT have the is_desert tag, then allow this quest to generate.
thequestforge:is_biome_nearby
For example:
"requirement": ["thequestforge:is_biome_nearby:minecraft:desert-200"]
"requirement": ["thequestforge:is_biome_nearby:#minecraft:is_forest-200"]
This condition checks whether the desired biome (or biome tag followed by #) is within the specified radius. The search start point is the NPC coordinates; the radius is set manually (in the example, it's 200 blocks).
thequestforge:is_structure_nearby
For example:
"requirement": ["thequestforge:is_structure_nearby:minecraft:desert_pyramid-2000"]
"requirement": ["thequestforge:is_structure_nearby:#minecraft:village-2000"]
This condition checks whether the desired structure (or structure tag separated by #) exists within the specified radius. The search start point is the NPC coordinates; the radius is set manually (in the example, it's 2000 blocks).
thequestforge:dimension_is
For example:
"requirement": ["thequestforge:dimension_is:twilightforest:twilight_fores"]
If the NPC is currently in the twilightforest:twilight_fores dimension, then allow this quest to be generated.
thequestforge:dimension_is_not
For example:
"requirement": ["thequestforge:dimension_is_not:twilightforest:twilight_fores"]
If the NPC is NOT currently in the twilightforest:twilight_fores dimension, then allow this quest to be generated.
Placeholders
Placeholders are used to dynamically replace string elements to increase immersion. They can be inserted into all string elements that will be rendered.
%player%
Changes to the player's name (your nickname only, not other players')
%npc_name%
This placeholder supports one string modifier: `%npc_name-no_hide%
- With
no_hide, it will change to the custom entity name; if there isn't one, it will simply return the entity name. - Withoutno_hide, it will change to a custom entity name. If there isn't one, it will return "" (meaning nothing).
%target-№%
Changes to the number and name of the object needed for the quest.
For proper use, you need to consider the maximum number of tasks your quest can issue. For example, a quest can issue between 2 and 4 tasks. To get the following text:
I need 3 sand, 4 apples, 13 sticks, can you get them?, the source code should look like this:I need %target-1%%target-2%%target-3%%target-4%, can you get them?%There are 4 placeholders, just like the maximum number of tasks in a quest. The extra ones will be removed automatically, and everything will look beautiful.
%reward-№%
Changes to the amount and name of the reward, works similarly to %target-№%
%direction%
Changes to the cardinal directions to indicate the location of a specific object, used in quests that search for a biome or structure
This placeholder can only be used in quests that use thequestforge:is_structure_nearby, thequestforge:is_biome_nearby. Otherwise, it will return Direction not found.
%time%
Changes to the time given to complete the quest.
Actions
Actions are scripts that perform a specific action, such as accepting a quest, turning it in, etc.
Close
"actions": ["thequestforge:close"]
This action closes the GUI dialog.
This action is executed with priority and overrides other actions, the only exception being "save".
Save
"actions": ["thequestforge:save"]
This action will save the dialogue stage for the player so that the next time they interact with an NPC, they will begin from the saved stage, rather than from start.
Accept
"actions": ["thequestforge:accept"]
This action will add the quest to the player's active quests.
Complete
"actions": ["thequestforge:complete"]
This action completes the quest if it is completed. Also, if the quest is not completed and the button has an "alt_to_go" field, it will be followed.
Next_quest
"actions": ["thequestforge:next_quest"]
This action switches the quest to the next one.
Commands
The mod contains commands that can help with debugging quests or creating a database.
Commands start with /questforge
reset
Resets the player's quests, or if it's an entity, theirs.
registry export
Creates a file in the game's root folder with all:
- Item IDs
- Entity IDs
- Entity tags
- Enchantment IDs
- Biome IDs
- Biome tags
- Structure IDs
- Structure tags
- Quest IDs
- Action IDs
- Condition IDs
spawn
Allows you to summon an NPC from the list of added NPCs for a specific quest, ignoring the conditions.