Skip to content

Points

Points are useful when the progress of a quest can be counted. Instead of creating a separate tag for every small step, you store the current amount in one point category and check that amount with a point condition.

In this tutorial, we will create a small mining quest. A miner asks the player to mine five stone blocks. Every mined stone adds one point to the player's progress. When the player has five points, the miner can complete the quest.

Requirements

It is helpful to be familiar with the basics of actions, objectives, and conditions before using this tutorial.

1. Creating the folder structure for the example quest🔗

Add a new structure for the example quest in the QuestPackage folder. The name could be "pointTracking" for example.

The file structure should look like this:

  • pointTracking
    • package.yml
    • actions.yml
    • objectives.yml
    • conditions.yml
    • conversations
      • miner.yml
Download the files for this tutorial

Instead of manually creating / filling the files, just download them using the command below:

/bq download BetonQuest/Quest-Tutorials refs/tags/v3.1.0 QuestPackages /Features/Tracking-Quest-Progress/Points/1-ExampleQuest /pointTracking overwrite
You can now find all files needed for this tutorial in this location: "YOUR-SERVER-LOCATION/plugins/BetonQuest/QuestPackages/pointTracking"

First, we create a simple conversation and connect it to one NPC.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
conversations:
  Miner:
    quester: "Miner"
    first: "startQuest"
    NPC_options:
      startQuest:
        text: "Hey %player%, could you mine five stone blocks for me?"
        pointers: "acceptQuest"
      questStarted:
        text: "Great! Bring me five stone blocks and I will reward you with 3 diamonds."
    player_options:
      acceptQuest:
        text: "Sure, I will do that."
        pointers: "questStarted"
1
2
3
4
5
npcs:
  'Miner': "citizens 21"

npc_conversations:
  Miner: "Miner"

This conversation does not start any quest logic yet. The player can only accept the task in the dialogue.

2. Store the progress with points🔗

Now we add an objective that reacts to every mined stone block. The objective adds one point to the stoneMined points each time it is completed.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
conversations:
  Miner:
    quester: "Miner"
    first: "startQuest"
    NPC_options:
      startQuest:
        text: "Hey %player%, could you mine five stone blocks for me?"
        pointers: "acceptQuest"
      questStarted:
        text: "Great! Bring me five stone blocks and I will reward you with 3 diamonds."
    player_options:
      acceptQuest:
        text: "Sure, I will do that."
        pointers: "questStarted"
        actions: "startMiningQuest"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
actions:
  startMiningQuest: "folder addMiningQuestStarted,resetMiningProgress,addMineStoneObjective"
  addMiningQuestStarted: "tag add miningQuestStarted"
  resetMiningProgress: "point stoneMined 0 action:set"
  addMineStoneObjective: "objective add mineStone"
  addMiningProgress: "folder addMiningPoint,sendMiningProgress,sendMiningComplete,removeMineStoneObjectiveOnComplete"
  addMiningPoint: "point stoneMined 1 action:add"
  sendMiningProgress: "notify &a%point.stoneMined.amount%&8/&25 &7stone mined. io:chat conditions:!hasMinedEnoughStone"
  sendMiningComplete: "notify &aYou mined enough stone. Return to the Miner! io:chat conditions:hasMinedEnoughStone"
  removeMineStoneObjectiveOnComplete: "objective remove mineStone conditions:hasMinedEnoughStone"
1
2
objectives:
  mineStone: "block stone -1 persistent actions:addMiningProgress"
1
2
3
conditions:
  miningQuestStarted: "tag miningQuestStarted"
  hasMinedEnoughStone: "point stoneMined 5"

The important part is the stoneMined point category. The startMiningQuest action sets it to 0, then starts the objective. Because the objective is persistent, it starts again after every mined stone block. Each completion runs addMiningProgress, which adds one point and sends the player a chat message with the current progress. Once the player reaches five points, removeMineStoneObjectiveOnComplete removes the objective so the completion message is not sent again when the player mines more stone.

The hasMinedEnoughStone condition checks whether the player has at least five points in the stoneMined category. That means the point category stores the player's quest progress.

Is the example not working?

Get the correct configs by running the following command.
âš  This will overwrite any changes (including NPC ID's and locations) you have made to the example.
Linking NPCs to conversations is explained in the basics tutorial.

/bq download BetonQuest/Quest-Tutorials refs/tags/v3.1.0 QuestPackages /Features/Tracking-Quest-Progress/Points/2-FullExample /pointTracking overwrite

3. Use the saved progress in the conversation🔗

We can now use the point condition in the conversation. The miner should finish the quest when the player has mined enough stone. If the player comes back too early, the miner can still read the current progress from the point placeholder. We also add an items.yml file for the reward.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
conversations:
  Miner:
    quester: "Miner"
    first: "finishQuest,checkProgress,completedQuest,startQuest"
    NPC_options:
      startQuest:
        text: "Hey %player%, could you mine five stone blocks for me?"
        pointers: "acceptQuest"
        conditions: "!miningQuestStarted,!miningQuestDone"
      questStarted:
        text: "Great! Bring me five stone blocks and I will reward you with 3 diamonds."
      checkProgress:
        text: "You have mined %point.stoneMined.amount% of 5 stone blocks. Keep going!"
        conditions: "miningQuestStarted,!hasMinedEnoughStone"
      finishQuest:
        text: "Perfect, that is enough stone. Here are your 3 diamonds!"
        conditions: "miningQuestStarted,hasMinedEnoughStone"
        actions: "finishMiningQuest"
      completedQuest:
        text: "Thanks again for helping me with the stone."
        conditions: "miningQuestDone"
    player_options:
      acceptQuest:
        text: "Sure, I will do that."
        pointers: "questStarted"
        actions: "startMiningQuest"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
actions:
  startMiningQuest: "folder addMiningQuestStarted,resetMiningProgress,addMineStoneObjective"
  addMiningQuestStarted: "tag add miningQuestStarted"
  resetMiningProgress: "point stoneMined 0 action:set"
  addMineStoneObjective: "objective add mineStone"
  addMiningProgress: "folder addMiningPoint,sendMiningProgress,sendMiningComplete,removeMineStoneObjectiveOnComplete"
  addMiningPoint: "point stoneMined 1 action:add"
  sendMiningProgress: "notify &a%point.stoneMined.amount%&8/&25 &7stone mined. io:chat conditions:!hasMinedEnoughStone"
  sendMiningComplete: "notify &aYou mined enough stone. Return to the Miner! io:chat conditions:hasMinedEnoughStone"
  removeMineStoneObjectiveOnComplete: "objective remove mineStone conditions:hasMinedEnoughStone"
  finishMiningQuest: "folder addMiningQuestDone,deleteMiningQuestStarted,rewardPlayer,notifyReward,deleteMiningProgress"
  addMiningQuestDone: "tag add miningQuestDone"
  deleteMiningQuestStarted: "tag delete miningQuestStarted"
  rewardPlayer: "give reward:3"
  notifyReward: "notify &aYou received 3 diamonds for helping the Miner! io:chat"
  deleteMiningProgress: "deletepoint stoneMined"
1
2
items:
  reward: "simple diamond"
1
2
3
4
conditions:
  miningQuestStarted: "tag miningQuestStarted"
  hasMinedEnoughStone: "point stoneMined 5"
  miningQuestDone: "tag miningQuestDone"

The order in first is important. BetonQuest checks finishQuest first, so the quest can complete as soon as the player has enough points. If the player has started the quest but has fewer than five points, checkProgress is used instead. The point placeholder %point.stoneMined.amount% shows the stored amount. The sendMiningProgress action uses the same placeholder to show the player their progress in chat, while sendMiningComplete tells them when they are done. The objective is removed at the same moment, so mining more stone will not send the completion message again.

When the quest is completed at the NPC, finishMiningQuest removes the active quest tag, gives the reward, sends a short reward message, and deletes the temporary point category. This keeps the player's data clean after the progress is no longer needed.

Download this part of the tutorial

Enter this command in the chat to download this part of the tutorial:

/bq download BetonQuest/Quest-Tutorials refs/tags/v3.1.0 QuestPackages /Features/Tracking-Quest-Progress/Points/2-FullExample /pointTracking overwrite

You have now tracked quest progress with points. Use this approach whenever the player can make measurable progress, for example mining blocks, collecting items, catching fish, gaining reputation, or contributing to a repeated task.