Skip to content

Server settings

McHorse edited this page Jul 28, 2021 · 7 revisions

Server settings is a panel in Mappet's dashboard that allows to configure global per-world Mappet options. At the moment, you can edit trigger hotkeys, global triggers and global and player states. The panel looks like this:

Server settings panel

Global triggers

Global triggers allow to attach triggers to a specific action that will happen in the world, which was added by Mappet. Some global triggers may pass additional data to events, dialogues or scripts. At the moment, Mappet provides following global triggers:

Trigger name Cancelable Data Description
On chat message Yes message is the message that player sent When a player sends a chat message (but not commands). When canceled: no message will be sent to players.
On block break Yes block is the block ID that was broken, like minecraft:stone. meta is block meta value 0-15. x is integer X coordinate where block was broken. y is integer Y coordinate where block was broken. z is integer Z coordinate where block was broken When a player breaks a block. When canceled: blocks won't be destroyed.
On block place Yes block is the block ID that was placed, like minecraft:stone. meta is block meta value 0-15. x is integer X coordinate where block was placed. y is integer Y coordinate where block was placed. z is integer Z coordinate where block was placed When a player places a block. When canceled: blocks won't be placed.
On entity hit Yes damage is health points that player inflicted upon an entity. When player inflicts damage either by hitting it directly, or shooting from a bow (indirectly). When canceled: the damage won't be inflicted.
On server load No N/A When server gets loaded.
On server tick No N/A When server updates one tick. Be careful: with this trigger, it runs every tick so it might be CPU intensive, use trigger delays to minimize amount of trigger calls.
On player log in No N/A When logs in on the server.
On player left click No N/A When player left clicks in the air (left clicking on entities or blocks won't work).
On player right click No N/A When player right clicks in the air (right clicking on entities or blocks won't work).

Cancelable triggers

As you could see, some of these triggers can be canceled. To cancel an event, you need to either add a Cancel node to the event, and that node must be executed, or call IScriptEvent.cancel() from a script:

function main(e)
{
    e.cancel();
}

Trigger hotkeys

Trigger hotkeys are kind like global triggers, but they are designed to triggered when player presses a key. For example, if you want to make spells, you can create a couple of scripts/events and bind them to Y, U, I, and O keys.

Editing hotkeys

To edit hotkeys, simply press Edit trigger hotkeys... button and the Event hotkey editor will show up. To add a trigger hotkey, right click on the left part of the screen and Add trigger hotkey. An editor like this will show up:

Trigger hotkey editor

Everything there should be straight forward:

  • Click under Keybind label (on None label), and you'd be able to set a single key that will trigger the triggers
  • Edit triggers... allows you to setup trigger blocks that will be executed when a player will press a key
  • Checker under Enabled label allows you to setup an expression or condition under which triggers will be triggered

States editor

The states editor on the left allows you to edit server (global) and player states. Here is how it looks like:

States editor

Here is a break down of GUI elements that are shown above. 🔎 icon allows to open an overlay that will let you choose whose states can be edited. ~ is server's states, and separate player usernames are, obviously, player states. Once you pick whose states you'll be editing, you can add new states using ➕ icon button.

After a new row will be added, there will be 4 different fields:

State row

  1. State's key.
  2. Upon clicking changes state's value type between number and string.
  3. State's value.
  4. Upon clicking removes this state from states.

When editing state's key, make sure you don't leave it empty or have a same name as another state. It will turn red if the state's key you inputted is invalid.

Clone this wiki locally