HyperScript
Docs

← All of the Docs More

Quests

structurequest "<name>":since 1.7.63

At the left margin: makes a quest. Under it comes goal:, and name: and reward: if you want them

quest "lumberjack":
    goal: break 20 oak log
    reward:
        give 10 bread to player
Try it
expressiongoal: break <n> <block>since 1.7.63

Counted when the player breaks that block. Also place <n> <block> and kill <n> <creature>. any in place of the block or creature counts whichever it is

quest "builder":
    goal: place 100 stone
    reward:
        send "&aA hundred stones placed."
Try it
expressiongoal: craft <n> <item>since 1.7.64

Counted when the player crafts that item

quest "breadmaker":
    goal: craft 8 bread
    reward:
        send "&aEight loaves baked."
Try it
expressiongoal: fish <n>since 1.7.64

Counted for each catch

quest "fisher":
    goal: fish 5
    reward:
        give 1 diamond to player
Try it
expressiongoal: walk <n> blockssince 1.7.64

Counted for each block they walk into

quest "walker":
    goal: walk 500 blocks
    reward:
        send "&aHalf a kilometre on foot."
Try it
expressiongoal: reach <n> {<variable>}since 1.7.64

Done when a saved variable of the player's, such as {coins}, gets to that number; how far they are is what the variable is. Looked at every two seconds

quest "rich":
    goal: reach 1000 {coins}
    reward:
        broadcast "&6%player.name% has a thousand coins!"
Try it
expressionrepeat: dailysince 1.7.64

The quest may be done again: daily on each new day, weekly in each new week, or a length of time after it was done (repeat: 12 hours). Until then it stays "done"; after that it is "none" again and can be started

quest "daily miner":
    goal: break 20 stone
    repeat: daily
    reward:
        add 50 to {%player%.coins}
Try it
expressiontime limit: <duration>since 1.7.64

How long the player has. When the time is up the quest is "none" again, as if it had been stopped

quest "sprint":
    goal: walk 200 blocks
    time limit: 1 minute
    reward:
        send "&aFast enough!"
Try it
expressiongoal: do <n>since 1.7.63

A quest a script counts itself, with advance quest: for talking to somebody, winning a game, anything the server cannot see by itself

quest "helper":
    goal: do 3
    reward:
        send "&aYou helped three times."

command /helped <target:player>:
    permission: "staff.helped"
    trigger:
        advance quest "helper" for arg.1
Try it
structurereward:since 1.7.63

The lines under it run as the player when they reach the goal

quest "hunter":
    goal: kill 5 zombie
    reward:
        give 1 iron sword to player
        send "&aFive zombies down."
Try it
expressionstart quest <name>since 1.7.63

The player has the quest, from the beginning; for <who> for somebody else. Starting it again starts it over

quest "digger":
    goal: break 10 stone

command /dig:
    trigger:
        start quest "digger"
        send "&eBreak ten stone."
Try it
effectstop quest <name>since 1.7.63

They no longer have it, and what was counted is gone

quest "runner":
    goal: do 5

command /giveup:
    trigger:
        stop quest "runner"
        send "&7Quest dropped."
Try it
expressionadvance quest <name>since 1.7.63

Counts one towards it; by <n> counts more. Nothing happens for a player who does not have the quest

quest "talker":
    goal: do 2

command /talk:
    trigger:
        advance quest "talker"
Try it
expressionquest progress <name>since 1.7.63

How far the player is, as a number; of <who> for somebody else

quest "stonecutter":
    goal: break 30 stone

command /progress:
    trigger:
        set {_done} to quest progress "stonecutter"
        send "&7%{_done}% of 30"
Try it
expressionquest goal <name>since 1.7.63

How many the quest asks for

quest "baker":
    goal: do 12

command /bakergoal:
    trigger:
        set {_loaves} to quest goal "baker"
        send "&7Bake %{_loaves}% loaves."
Try it
expressionquest state <name>since 1.7.63

"none", "active" or "done"; of <who> for somebody else

quest "guard":
    goal: kill 3 zombie

command /guardquest:
    trigger:
        if quest state "guard" is "none":
            start quest "guard"
Try it
expressionall questssince 1.7.63

The names of every quest scripts have made

command /quests:
    trigger:
        send "&7Quests: &f%all quests%"
Try it
expressionactive questssince 1.7.64

The names of the quests the player has and has not finished; of <who> for somebody else

command /myquests:
    trigger:
        set {_mine} to active quests
        send "&7Your quests: &f%{_mine}%"
Try it
structureon quest progress "<name>":since 1.7.64

Runs each time a player gets further with a quest. {_quest} is its name, {_progress} how far they are and {_goal} how far they have to get. Without a name it runs for every quest

quest "collector":
    goal: break 10 stone

on quest progress "collector":
    send action bar "&7Stone: &f%{_progress}% &7of %{_goal}%" to player
Try it
structureon quest complete "<name>":since 1.7.63

Runs when a player reaches the goal, after the reward. player is who did it and {_quest} the quest's name. Without a name it runs for every quest

quest "finisher":
    goal: do 1

on quest complete "finisher":
    broadcast "&6%player.name% finished a quest!"
Try it
Guide and examples

A quest is something to do a number of times, counted for each player. HyperScript does the counting, keeps it with the player's saved variables, and runs the reward when it is done.

quest "miner":
    name: "&6Miner"
    goal: break 50 stone
    reward:
        give 5 diamond to player
        send "&aQuest done: 50 stone mined."

command /quest:
    trigger:
        if quest state "miner" is "none":
            start quest "miner"
            send "&eNew quest: mine 50 stone."
        else if quest state "miner" is "active":
            set {_mined} to quest progress "miner"
            set {_goal} to quest goal "miner"
            send "&7Stone mined: &f%{_mined}% &7of %{_goal}%"
        else:
            send "&aYou have done that quest."

on quest complete "miner":
    broadcast "&6%player.name% finished the Miner quest!"
SyntaxEffect
quest "<name>":At the left margin: makes a quest. Under it comes goal:, and name: and reward: if you want them
goal: break <n> <block>Counted when the player breaks that block. Also place <n> <block> and kill <n> <creature>. any in place of the block or creature counts whichever it is
goal: craft <n> <item>Counted when the player crafts that item
goal: fish <n>Counted for each catch
goal: walk <n> blocksCounted for each block they walk into
goal: reach <n> {<variable>}Done when a saved variable of the player's, such as {coins}, gets to that number; how far they are is what the variable is. Looked at every two seconds
repeat: dailyThe quest may be done again: daily on each new day, weekly in each new week, or a length of time after it was done (repeat: 12 hours). Until then it stays "done"; after that it is "none" again and can be started
time limit: <duration>How long the player has. When the time is up the quest is "none" again, as if it had been stopped
goal: do <n>A quest a script counts itself, with advance quest: for talking to somebody, winning a game, anything the server cannot see by itself
reward:The lines under it run as the player when they reach the goal
start quest <name>The player has the quest, from the beginning; for <who> for somebody else. Starting it again starts it over
stop quest <name>They no longer have it, and what was counted is gone
advance quest <name>Counts one towards it; by <n> counts more. Nothing happens for a player who does not have the quest
quest progress <name>How far the player is, as a number; of <who> for somebody else
quest goal <name>How many the quest asks for
quest state <name>"none", "active" or "done"; of <who> for somebody else
all questsThe names of every quest scripts have made
active questsThe names of the quests the player has and has not finished; of <who> for somebody else
on quest progress "<name>":Runs each time a player gets further with a quest. {_quest} is its name, {_progress} how far they are and {_goal} how far they have to get. Without a name it runs for every quest
on quest complete "<name>":Runs when a player reaches the goal, after the reward. player is who did it and {_quest} the quest's name. Without a name it runs for every quest
  • Only what a player does while the quest is "active" is counted. A quest that is done stays done until it is started again.
  • What is counted is the block or creature by the game's name for it, in plain words: break 20 oak log, kill 5 zombie.
  • Progress is kept across relogs and restarts.
  • A ready-made /quests menu that lists every quest with how far the player is comes as the script Quests.hs on the website.