JSON-driven Minecraft Paper plugin for creating quests
This plugin is a Minecraft game developer's toolbox, greatly expanding and simplifies what you can do with minecraft commands.
The idea is to be able to create complex mechanisms without having to write any plugin code. With ScriptedQuests, you can build things like quest interactions between players and NPCs (and much more) by creating configuration files with the provided web editor.
Highlighted features:
/randomnumber
, /giveloottable
, /schedule function
, /set velocity
, /getdate field
This plugin was developed for use with Monumenta, a Minecraft Complete-The-Monument MMORPG server. It has proven to be perhaps the most generally valuable & reusable tool we have built over several years, and we hope others will find it useful too.
ScriptedQuests works on Paper 1.18.2 or higher. It also requires CommandAPI version 6.x. Other CommandAPI versions may also work, worth giving it a shot. It'll be immediately obvious as if the version is incompatible, the plugin won't load or no commands will work.
You can download ScriptedQuests from GitHub Packages. This is automatically updated every time new changes are made. Click on the com.scriptedquests... link, and download the .jar file from the "Assets" category on the right side of the page.
Here is an example of interacting with a villager named Aimee:
Quests are made up of two-way dialog - the NPC can "talk" to the player, and the player can reply by clicking one of the available options in chat. At each stage in the process arbitrary actions can occur, such as setting scoreboard values, running commands/functions, sending more dialog, etc.
The quest compass is just a simple mapping between scoreboard values and locations. For example, if you have score Quest01 = 1, left clicking with an ordinary compass will make it point to some coordinates. For example:
Additonally, the compass will point to locations where you have died since the server last restarted, and tells you how long ago those deaths were.
You can also create quests that involve the player dying in-game. These "death" quest elements can trigger actions when the player dies if they meet specific pre-requisites. This can involve keeping the player's inventory, respawning at a different location than normal, etc.
This plugin requires Paper 1.18.2+.
plugins/ScriptedQuests/
/summon minecraft:villager ~ ~ ~ {CustomName:"Aimee"}
/scoreboard objectives add Quest01 dummy
samples/sample-quest.json
-> plugins/ScriptedQuests/npc/sample-quest.json
samples/sample-compass.json
-> plugins/ScriptedQuests/compass/sample-compass.json
/reloadquests
/give @s minecraft:dye 1 11 {display:{Lore:["QuestItem"]}}
Creating these by hand is a pain - use the web editor! The web editor not only helps you structure things correctly but is also the primary documentation for the various quest options
Each quest file has the following info:
Quest components contain optional pre-requisites and actions. If the pre-requisites are met, the actions are run. Every time a player interacts with an NPC, quest components are run in-order (more than one may be executed).
/clickable <label>
scriptedquests.clickable
/interactNpc <npcName> [EntityType]
/interactNpc <npc>
scriptedquests.interactnpc
execute as @p[r = 5] run interactnpc Aimee VILLAGER
/leaderboard <@a> <objective> <descending> <page>
scriptedquests.leaderboard
scriptedquests.leaderboard.others
(show other players a leaderboard)descending
specifies order of results, page specifies which page to show.
For players to be able to use the << >> arrows, they need to have this permission.
This of course also lets them generate leaderboards for any scoreboard on the server./monumenta music play <now or next> <players> <music path> <duration in seconds> [<is loop, default false>] [<music category, default record>] [<volume>] [<pitch>]
/monumenta music cancel <now or next> <players>
scriptedquests.music.play
scriptedquests.music.play.others
(play music to other players)scriptedquests.music.cancel
scriptedquests.music.cancel.others
(cancel music for other players)/questTrigger
scriptedquests.questtrigger
/race leaderboard <players> <raceLabel> <page>
scriptedquests.race
scriptedquests.race.leaderboard.others
/line <from> <to> <block>
scriptedquests.line
/generatecode <@a> "<seed>"
scriptedquests.generatecode
/code
. This is useful for building
cross-map functionality/execute store result score <scoreboardplayer> <objective> run getdate <field>
scriptedquests.getdate
/giveloottable <@a> "<namespace:path/to/table>" [count]
scriptedquests.giveloottable
count
times/haspermission <@a> <permission.node>
scriptedquests.haspermission
/execute store result score <scoreboardplayer> <objective> run randomnumber <min> <max>
scriptedquests.randomnumber
min
and max
are inclusive./random sample <entities> <objective> <min> <max>
scriptedquests.random.sample
min
to max
without replacements.
Fails if there aren't enough unique numbers for the number of entities.
min
and max
are both inclusive./race start <players> <raceLabel>
scriptedquests.race
/race stop <players>
scriptedquests.race
/race win <players>
scriptedquests.race
/reloadQuests
scriptedquests.reloadquests
/clock ~ ~ ~ always <period> [repeater]
/clock ~ ~ ~ player <period> [repeater]
/clock ~ ~ ~ range <range> <period> [repeater]
scriptedquests.clock
<period>
ticks.repeater
option, checked every <period>
ticks.always
, when a non-spectating player is in range
(blocks) on the same world,
or when there is a player
online on any world on the server./schedule function <namespace:path/to/function> <ticks>
scriptedquests.schedulefunction
/setvelocity <@e> <x> <y> <z>
scriptedquests.setvelocity
/testzone <x> <y> <z> <namespaceName> [propertyName]
scriptedquests.testzone
!
. If namespaceName or
propertyName have spaces, quotes, or other characters that may cause issues,
put them in quotes similar to json.
/debugzones <player>
/debugzones <position>
scriptedquests.debugzones
/showzones hide
/showzones show <namespaceName> [propertyName]
scriptedquests.showzones
/timerdebug <enabledOnly>
scriptedquests.timerdebug
enabledOnly
is true, will only
show timers that are currently active due to players matching the range criteria
prerequisites:
By default, prerequisites are and'ed together - all must be true.
actions:
<repository>
<id>monumenta</id>
<name>Monumenta Maven Repo</name>
<url>https://maven.playmonumenta.com/releases</url>
</repository>
<dependencies>
<dependency>
<groupId>com.playmonumenta</groupId>
<artifactId>scripted-quests</artifactId>
<version>7.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
Gradle (kotlin):
maven {
name = "monumenta"
url = uri("https://maven.playmonumenta.com/releases")
}
dependencies {
compileOnly("com.playmonumenta:scripted-quests:7.0")
}
Gradle (groovy):
maven {
name "monumenta"
url "https://maven.playmonumenta.com/releases"
}
dependencies {
compileOnly "com.playmonumenta:scripted-quests:7.0"
}