-
Notifications
You must be signed in to change notification settings - Fork 9
Commands
Mappet provides a lot of commands to work with its features. This page lists all commands that are available in the mod. /mp
is the main command that provides many subcommands to work with specific features.
/mp state
command provides subcommands that allows to modify states. <target>
can be either a target selector that points out to a unique player or an NPC (it could also be a player username or entity UUID), or ~
, which stands for server's global states.
Adds some numerical value to <id>
state.
Removes the <id>
state from <target>
's states. If [id]
was omitted (not provided) then all states will be removed.
[id]
supports *
wildcard masks which allow to remove multiple entries. For example you have following global (~
) states:
quests.main=1
quests.secondary=2
mchorse.a=10
mchorse.b=20
mchorse.c=30
minecraft.a=10
minecraft.b=20
If you want to remove all states starting with mchorse.
, you'll need to execute /mp state clear ~ mchorse.*
command.
Checks whether <id>
state is equal to <expression>
, if it's not then command will error, otherwise nothing will happen.
Outputs into the chat all the states that <target>
has. The type of every state will also be printed:
-
(n)
is for number -
(s)
is for string.
Sets the exact <value>
to <id>
state. It can be either numerical, or a string (including consequent spaces).
Subtracts some numerical value from <id>
state.
/mp dialogue
command provides subcommand to work with dialogues.
Opens a dialogue by given <id>
for player(s) found by <target>
selector. [data]
allows pass extra data to dialogue's context which can be used in
${...}
parsed expressions.
/mp crafting
command provides subcommands to work with crafting tables:
Opens a crafting table by given <id>
to player(s) by <target>
selector.
Drops an item in the world at [index]
from crafting table by <id>
at given XYZ, relative offset ~
is supported. If [index]
omitted or inputted as @r
will drop a random item. [mx]
, [my]
and [mz]
can be used to set initial item(s)' velocity.
/mp event
command provides a subcommand to work with events:
Triggers an event by <id>
with additional context in form of player(s) found using <target>
selector. Additional NBT [data]
can be sent to the event execution.
/mp quest
command provides subcommands to work with quests:
Makes player(s) by <target>
selector take quest by <id>
.
Makes player(s) by <target>
selector decline quest by <id>
.
Makes player(s) by <target>
selector complete quest by <id>
regardless of whether goals were finished.
/mp npc
command provides subcommands to work with NPCs:
Spawns an NPC with given [state]
(if omitted it's default
), and optional position (if XYZ position is omitted command sender's current position will be used).
Changes state of NPC entities found by <target>
selector, with [state]
. [state]
can contain special notation in form of <state_name>:[properties...]
which should allow to overwrite only specific properties of the NPC.
Changes specific <property>
of NPC entities found by <target>
selector, with [data...]
. The format of [data...]
is completely depends upon the given <property>
.
This command despawns (instantly kills without death animation) all NPCs which were found by <target>
selector.
/mp faction
command provides subcommands to work with factions:
Sets the score of faction by <id>
for player(s) found by <target>
selector with <score>
.
Adds <score>
to faction by <id>
for player(s) found by <target>
selector.
Removes faction(s) score from player(s) found by <target>
selector. If [id]
is provided, then only that faction will be cleared, if [id]
is omitted then all factions score will be cleaned.
/mp data
is a utility command that allows to load and save player states for debugging purposes.
Resets all data of the entire playthrough. Global states will be fully reset, and every player's (even those who are offline) states, quests and optionally inventory (depending on [inventory]
) will be reset as well. By default, inventories are not cleared unless you execute /mp data clear true
.
Saves current state and current player's inventory and quests.
Loads saved state and applies saved quests and inventory on given [player]
(if [player]
is omitted then the command will use the player that executed the command). [global]
option allows to specify whether server states should be also updated from the saved state, by default it's enabled.
Re-encodes all the data files within world's mappet/
folder from charset <from>
to <to>
charset.
This isn't an essential command, but was added due to character encoding issues with the first map by Creman, where the map had text display issues that appeared as gibberish because of Creman's system used Windows-1251 encoding, while other people used other than Windows-1251 encoding system-wide.
/mp script
command provides a subcommand to work with scripts:
Executes script's [function]
(if not provided it will be assumed to be main
) by <id>
with additional context in form of player(s) found using <player>
selector. Additional NBT [data]
can be sent to the event execution and accessed using IScriptEvent#getValues().
Evaluates given JS <code...>
. c
variable is available which is a IScriptEvent
which contains either a player as a subject, or just server (depending on who executed that command).
IMPORTANT: the command should be available only for OP players, and to non-player mechanisms that can execute commands (like command blocks, trigger, events, etc.) however it's not 100% certain that this command is safe, so make frequent backups.
/mp hud
command provides a subcommand to work with HUD scenes:
Adds an HUD scene by <id>
which will display to all players found by <target>
selector. If scene by given <id>
was already added earlier, and didn't expire, then it will be started over again.
Closes an HUD scene by [id]
of all players found by <target>
selector. If player(s) didn't have such HUD scene by [id]
nothing will happen. If [id]
was omitted, then all HUD scenes will be removed from players by <target>
selector.
Changes the morph in player's scene by <id>
for all players matching <target>
selector at given <index>
in the scene with a morph constructed from <nbt>
. If the player won't have the scene, or a HUD morph at given <index>
, nothing will happen.
If parts of the wiki don't make sense with Mappet's latest version, or you weren't able to recreate examples (i.e. outdated information), feel free to report the page and section that is out of date on community's Discord server (make sure to mention which Mappet’s version did you use).