-
Notifications
You must be signed in to change notification settings - Fork 11
Server settings
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:
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). |
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 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.
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:
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
The states editor on the left allows you to edit server (global) and player states. Here is how it looks like:
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's key.
- Upon clicking changes state's value type between number and string.
- State's value.
- 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.
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).