diff --git a/Advanced-Scripts.md b/Advanced-Scripts.md index 41e1422..e0410e9 100644 --- a/Advanced-Scripts.md +++ b/Advanced-Scripts.md @@ -70,4 +70,21 @@ function getMotd() { getMotd(); ``` -Produces: ![server-info-example-picture](https://i.imgur.com/6yxjpsV.png) when the server's MOTD is "A Minecraft Server". \ No newline at end of file +Produces: ![server-info-example-picture](https://i.imgur.com/6yxjpsV.png) when the server's MOTD is "A Minecraft Server". + +## Storing Data + +Storing data from within the placeholder script is quite easy. When a placeholder script is called, a `Data` object is passed to it. Whenever the script modifies the object, it is modified in Javascript-Expansion as well, and then saved to a data file. + +Here is an example script that... + +**Valid Methods**: +- `Data.getData()` returns a `Map` of the entire placeholder script's data. +- `Data.clear()` removes all data. +- `Data.exists(key)` returns true if a key exists; else false. +- `Data.get(key)` returns the value stored under `key`. +- `Data.remove(key)` removes a key from the data. +- `Data.set(key, value)` stores a `value` under `key`. +- `Data.isEmpty()` returns true if the data is empty; else false. + +// IN PROGRESS \ No newline at end of file