General
PlayerModelNpcs Integration
The PlayerModelNpcs mod lets server staff place NPCs in game and give them a look and a dialogue in its editor. With the framework installed next to it, those NPCs can also give quests, accept and complete quests from their dialogue and write to the quest journal. You set all of this up in game; no entity files are needed.
💡 See also: Quest Givers (per-NPC config, appearance commands) - Dialogues (trigger reference) - Quest Journal
What you get
Nothing to enable: when both mods are loaded, the framework adds two behaviors to the PlayerModelNpcs NPC entity (playermodelnpcs:playermodelnpc):
questgiver: the NPC can have a quest list. The framework does not make these NPCs invulnerable; damage stays as PlayerModelNpcs sets it.alegacyvsquest:dialoguequests: the NPC's dialogue can run quest triggers.
The PlayerModelNpcs editor gets:
| Where | What |
|---|---|
| NPC editor, NPC tab | Quests… button: the NPC's quest list. Copy look button: copies the NPC's appearance |
| Dialogue component editor, trigger list | alegacyquest-accept, alegacyquest-complete, alegacyquest-action, alegacyquest-journal, openquests, with input fields for their data |
Both buttons need the controlserver privilege. If a PlayerModelNpcs update changes its editor, the framework writes a warning to the server log and leaves the editor as it is. The triggers still work when typed into the dialogue JSON, and the quest list can be set with a command.
Give an NPC quests
- Place the NPC and open its editor.
- On the NPC tab press Quests….
- Fill in the quest ids and save. The window refuses ids that do not exist.
| Field | Meaning |
|---|---|
| Quests | Quests this NPC offers (rotating pool, see Quest Givers) |
| Always quests | Quests that are always offered |
| One quest at a time | The player can hold only one quest from this NPC |
| Max available quests | How many pool quests are offered at once |
| Reputation NPC | Reputation id for quests that need reputation with this NPC |
You must be within 64 blocks of the NPC. The same settings are stored on each NPC on its own, so two PlayerModelNpcs NPCs can offer different quests.
Without the editor, look at the NPC and use the command:
/avq entities npcquests quests mypack:firewood, mypack:wolves
/avq entities npcquests always mypack:intro
/avq entities npcquests showAll modes are listed under Per-NPC configuration.
How players open the quest window
- NPC without a dialogue: a plain right-click opens the quest window.
- NPC with a dialogue: add a player option whose trigger is
openquests. The optional trigger data is the start tab (0quests,2reputation,3shop).
Quests from the dialogue
Instead of the quest window you can run a quest entirely from dialogue lines. Pick the trigger in the dialogue component editor, or write it in the dialogue JSON:
| Trigger | Data | What it does |
|---|---|---|
alegacyquest-accept | quest | Gives the player the quest. Does not check requirements: hide the option with conditions yourself. An already active quest is ignored |
alegacyquest-complete | quest, force | Hands in the active quest. Without force its objectives must be done |
alegacyquest-action | action, quest | Runs an action string, for example giveitem game:bread 2 |
alegacyquest-journal | title, text, entry, quest | Writes to the Quest Journal |
About the journal trigger:
textis required.- With
quest, the entry goes under that quest. Without it, it becomes a note grouped under the NPC's name. titledefaults to the NPC's name;entrydefaults to the title.- The same line is added only once, so talking to the NPC again does not duplicate it.
Showing the right options
When a dialogue starts, the framework sets these variables for the player (replace <id> with the quest id):
| Variable | Value |
|---|---|
player.questactive_<id> | 1 while the quest is active |
player.questcompleted_<id> | 1 after it was completed |
player.queststage_<id> | Current stage, starting at 1 |
player.questcompletable_<id> | 1 when the quest (or its current stage) can be handed in |
Use them in the conditions of dialogue options: offer "accept" only when the quest is neither active nor completed, and "hand in" only when questcompletable is 1.
Example
A guard who gives one quest and takes it back:
{
"components": [
{
"code": "offer",
"owner": "player",
"type": "talk",
"text": [
{
"value": "I can help with the wolves.",
"jumpTo": "accept",
"conditions": [
{ "variable": "player.questactive_mypack:wolves", "isNotValue": "1" },
{ "variable": "player.questcompleted_mypack:wolves", "isNotValue": "1" }
]
},
{
"value": "The wolves are dead.",
"jumpTo": "handin",
"conditions": [ { "variable": "player.questcompletable_mypack:wolves", "isValue": "1" } ]
},
{ "value": "Goodbye.", "jumpTo": "close" }
]
},
{
"code": "accept",
"owner": "npc",
"type": "talk",
"trigger": "alegacyquest-accept",
"triggerdata": { "quest": "mypack:wolves" },
"text": [ { "value": "Five of them. Be careful." } ]
},
{
"code": "handin",
"owner": "npc",
"type": "talk",
"trigger": "alegacyquest-complete",
"triggerdata": { "quest": "mypack:wolves" },
"text": [ { "value": "Thank you. Here is your pay." } ]
}
]
}The quest itself (mypack:wolves) is an ordinary quest file in your pack, see Quest Structure. The rewards are given when it is completed, as with any quest giver.
Copying a look to a pack NPC
A PlayerModelNpcs NPC is a good place to try out a look. To move it to an NPC defined in your quest pack:
- In the NPC editor press Copy look (or look at the NPC and run
/avq entities npcappearance copy). - Look at the pack NPC and run
/avq entities npcappearance paste. The pack NPC needs thealegacyvsquest:npcplayermodelbehavior. - To put the look into the pack files, run
/avq entities npcappearance export guard. The file appears inModData/alegacyvsquest/appearances/guard.json; copy its fields into the NPC's behavior block.
Model, skin, voice, clothes and held items are copied. Details: Copying looks in game.
Troubleshooting
| Problem | Check |
|---|---|
| No Quests… button | You need controlserver. If the server log says the editor layout changed, use /avq entities npcquests |
| Right-click opens the dialogue, not the quests | The NPC has a dialogue: add an openquests option |
| "Accept" does nothing | The quest id must exist (/avq validatepack), and the player must not have it active already |
| "Hand in" does nothing | Objectives are not done yet. Show the option only when questcompletable is 1, or set force |