AtherysScript is a plugin for the SpongeAPI, developed for use on the A'therys Horizons minecraft server.
It is designed with extensibility in mind, with the ability to both add extensions to the API implementation present in the plugin by default, and provide own implementations in the form of other languages.
The primary purpose of a script on a server is to provide simple functionality, which can be modified easily thanks to the more accessible language it is written in.
The default implementation of AtherysScript is JavaScript, using the Nashorn script engine.
AtherysScript is NOT meant to be a replacement or alternative to Sponge plugins. If you want to create highly complex functionality in your server, please learn how to make a Sponge plugin. For more information, see here: Creating a Plugin.
When you add this plugin to your mods folder, on first start up it will look for a folder in the root directory of your minecraft server ( on the same level as your minecraft server jar ).
The exact name of this folder is configurable and can be found in the plugin config. If the plugin does not find this folder, it will create it. Once it is created, the ScriptService will automatically look through it and load all files present in the scripts folder as a script file. Please ensure there are only script files in the folder, else you may get unexpected errors in the console.
Upon discovering a script file, the ScriptService will register it as a script, and run it.
An example script looks a little something like this:
var i = 0;
onScriptStart(function(event) {
info("Script Started Event");
var task = taskOf("started-script-task");
setTaskDelay(task, 3000);
setTaskInterval(task, 3000);
setTaskExecutable(function(task) {
info("Task running!");
if ( i == 10 ) {
task.cancel();
}
i++;
});
startTask(task);
});
onScriptStop(function(event) {
info("Script Stopped Event");
});
We recommend the use of Visual Studio Code with the AtherysCode ( Source ) extention for purposes of script development.
Documentation can be found here.
Just AtherysCore.
Stop by the A'therys Horizons discord server! https://discord.gg/TYWvzME
You can read about the modules in the documentation.