Releases: astorks/ScriptableMC-Engine
Release V1.19.0 - Preview 1
This is a preview release, please report any bugs.
Some features have been temporarily disabled or completely broken such as,
- CommonJS support is currently broken
- Built-in JS libraries have been removed. Java classes can be accessed via the global variable
Packages
For example:Packages.org.bukkit.Bukkit.getServer()
What's New
Minecraft 1.19 support
- Now targeting Minecraft 1.19.3
- Now targeting Java 17
JavaScript Engine
- Updated the JavaScript engine to the latest GraalJS v22.3
Release V1.17.0 - Preview 1
What's New
Minecraft 1.17 support
- Now targeting Minecraft 1.17
- We have dropped support for pervious previous Minecraft versions.
- Please use plugin v1.3.x for Minecraft v1.13-1.16 (This version may still get updates).
- Now targeting Java 11, will update to Java 16 once github build tools are available.
(Shouldn't be an issue since Minecraft 1.17 targets Java 16)
JavaScript Engine
- Updated the JavaScript engine to the latest GeaalJS v21.1
TypeScript Tools Plugin
This feature is a WIP and may crash your server when you try to export libraries.
- Added a new TypeScript tools plugin
ScriptableMC-Tools-TS.jar
to generate typescript libraries from a running server.- This will allow you to generate typescript libraries for other installed java plugins.
TypeScript Tools Standalone Jar
This feature is a VERY EARLY WIP and is mostly still all hard coded.
- Added a new TypeScript tools program
ScriptableMC-Tools-TS-Standalone.jar
to generate typescript libraries from jar files.- This will allow you to generate typescript libraries for other java plugins you have an api jar file for.
- This jar files contains all the the bukkit/spigot, graalvm, and all of the helper libraries needed to generate the base typescript libraries.
Release V1.3.0
What's New
Minecraft 1.16 support
Now targeting minecraft 1.16.1, the plugin should work with any version 1.13-1.16
Typescript exporter now supports the spigot api
- The TypeScript exporter now supports the spigot api allowing access to spigot features like the action bar api.
TypeScript Example:
import ChatMessageType from '../lib/net/md_5/bungee/api/ChatMessageType.js'; import ComponentBuilder from '../lib/net/md_5/bungee/api/chat/ComponentBuilder.js'; import SpigotChatColor from '../lib/net/md_5/bungee/api/ChatColor.js'; ... let componentBuilder = new ComponentBuilder("Hello World!!").color(SpigotChatColor.AQUA); player.spigot().sendMessage(ChatMessageType.ACTION_BAR, componentBuilder.getParts()); ...
JavaScript Engine
- Updated the JavaScript engine to the latest GeaalJS v20.1
Python Engine
- Currently disabled the python engine, will be re-enabled later on.
Release V1.3.0 - Preview 1
What's New
Minecraft 1.16 support
Now targeting minecraft 1.16.1, the plugin should work with any version 1.13-1.16
Typescript exporter now supports the spigot api
- The TypeScript exporter now supports the spigot api allowing access to spigot features like the action bar api.
TypeScript Example:
import ChatMessageType from '../lib/net/md_5/bungee/api/ChatMessageType.js'; import ComponentBuilder from '../lib/net/md_5/bungee/api/chat/ComponentBuilder.js'; import SpigotChatColor from '../lib/net/md_5/bungee/api/ChatColor.js'; ... let componentBuilder = new ComponentBuilder("Hello World!!").color(SpigotChatColor.AQUA); player.spigot().sendMessage(ChatMessageType.ACTION_BAR, componentBuilder.getParts()); ...
JavaScript Engine
- Updated the JavaScript engine to the latest GeaalJS v20.1
Python Engine
- Currently disabled the python engine, will be re-enabled later on.
Release V1.2.2 - Preview 1
What's New
Typescript exporter now supports the spigot api
- The TypeScript exporter now supports the spigot api allowing access to spigot features like the action bar api.
TypeScript Example:
import ChatMessageType from '../lib/net/md_5/bungee/api/ChatMessageType.js'; import ComponentBuilder from '../lib/net/md_5/bungee/api/chat/ComponentBuilder.js'; import SpigotChatColor from '../lib/net/md_5/bungee/api/ChatColor.js'; ... let componentBuilder = new ComponentBuilder("Hello World!!").color(SpigotChatColor.AQUA); player.spigot().sendMessage(ChatMessageType.ACTION_BAR, componentBuilder.getParts()); ...
JavaScript Engine
- Updated the JavaScript engine to the latest GeaalJS v20.1
Python Engine
- Currently disabled the python engine, will be re-enabled later on.
Release v1.2.1
What's New
Better exception handling on startup
The script engine will continue loading additional main script files if an exception is encountered and after loading all main scripts, will print warnings in the console and chat if you used the chat command to reload.
Config.yml placeholders
Added placeholders to read other config values inside a config value.
${config_val_name}
You can even create your own config values and reference them in any existing config value.
Don't create a circular reference the following example will cause your server to crash.var_1: '${var_2}' var_2: '${var_1}'
Multiple main script files
You can now change the default script entrypoint and set multiple main script files to be executed one after another via the
config.yml
.# Main script files # The main entry point javascript files # Default: ${root_scripts_folder}/main.js main_script_files: - '${root_scripts_folder}/main.js' - '${root_scripts_folder}/main-testing.js'
Execute command template
Execute command script template can now be customized via the
config.yml
# Execute command template # This is the code that will be executed with /pyex and /smc python execute # If a class is returned it will be instantiated and continued on as an object # If object is returned and has a method execute script engine will call # returnedObject.execute(sender: CommandSender, server: BukkitServer, servicesManager) # as well as set returnedObject.sender, returnedObject.server, and returnedObject.servicesManager # you can also add additional methods, vars to the template source below # Otherwise the script engine will return last execute code # %SOURCE% will be replaced with with the command source. execute_command_template: "import * as lib from './lib/global.js'; new (class EvalCommandSenderContext { execute(sender, server, servicesManager) { %SOURCE% } })()"
JavaScript Engine
- Added CommonJS config options to enable/disabled CommonJS support, change the default CommonJS modules folder, and change the default CommonJS globals file.
common_js: # Enable CommonJS `require()` support # Allows the use of CommonJS NPM modules # Default: true enabled: true # CommonJS modules path # The default path to load CommonJS modules from. # Default: ${root_scripts_folder}/node_modules modules_path: '${root_scripts_folder}/node_modules' # CommonJS globals file name # The CommonJS globals file used to define global CommonJS values # Relative to the `common_js.modules_path` folder # Default: globals.js globals_file: 'globals.js'
JavaScript Engine config.yml
Python Engine config.yml
Release v1.2.0
What's New
Additional Libraries
- Added
org.apache.commons.io.FileUtils
Fixed version check
- Fixed the plugin version check
- Converted
com.smc.version
to kotlin
Chrome debugger
- Added chrome debugger support.
- Add breakpoints and step through your code execution.
- Config option to wait for attach before executing any script code.
- Debugger is disabled by default
- Settings can be configured via the script engine config.yml
debugger:
enabled: false
address: 127.0.0.1:9229
wait_attached: true
Moved bundled script engines into a seperate plugin
If you're using OpenJDK or Standard JDK you should download and install the ScriptableMC-Engine-*-Bundled.jar
plugin that comes pre-packaged with the correct script engine.
If you're using GraalVM java runtime and have the correct script engine already installed you can download and install the base plugin ScriptableMC-Engine-*.jar
ScriptableMC-Engine-JS-Bundled.jar
Pre-bundled JavaScript plugin and engine. (This will run on any JDK)
ScriptableMC-Engine-JS.jar
Base JavaScript plugin. (This will only run on GraalVM v20.0.0)
ScriptableMC-Engine-PY-Bundled.jar
Pre-bundled Python plugin and engine. (This will run on any JDK)
ScriptableMC-Engine-PY.jar
Base Python plugin. (This will only run on GraalVM v20.0.0 with python installed)
JavaScript Engine
- JavaScript Engine:
ScriptableMC-Engine-JS.jar
andScriptableMC-Engine-JS-Bundled.jar
- Updated to GraalJS 20.0.0
- Added support for
require()
that can load CommonJS modules and NodeJS modules from thenode_modules
folder inside the root scripts folder. - Added support for
__global__.js
inside the root scripts folder that can define globals for all CommonJS modules. - Additional CommonJS examples coming soon...
Python Engine
- Added a new Python script engine.
- The Python script engine is in a preview state. Expect breaking changes in future updates.
- Python Script Engine:
ScriptableMC-Engine-PY.jar
andScriptableMC-Engine-PY-Bundled.jar
- Updated to GraalPython 20.0.0
- Known Issues: Import and local module loader not working.
- Python examples coming soon...
Release v1.1.10
- Added http utility to the com.smc utils namespace.
- Added a new command
/smc js stash
to allow executing multi line code via a command. - Added version update check on script engine load that can be disabled in the config.
This version check will make an https request to the github api and can be disabled completely via the config. - Added a new command
/scriptablemc version
to run a version check any time. - The js engine plugin name was renamed to
ScriptableMC-Engine-JS
this is for later plans to add a python script engine as well. - Seperated the typescript tools from the js engine plugin and cleaned up unneeded implementations.
Release v1.1.9
Library update required
- Moved JsPlugin.ts to the typescript libraries
- /smc menu should now work on minecraft version 1.8+.
- Cleaned up /smc menu and made the menu smaller.
- Fixed command breaking after script engine reload on MC v1.12 and lower.
- Moved utilities to com.smc.utils namespace.
- Added MinecraftVersions library to the com.smc.version namespace.
- Moved smart inventory to com.smc.smartinvs namespace.
- Removed a few methods from ScriptablePluginContext and general cleanup of unused methods now that the class loader is fixed.
Relese v1.1.8
Fixed v1.12.2 'java.lang.NoSuchFieldException: knownCommands' exception on script engine unload