Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Create TypeScript/JavaScript plugins for Minecraft 1.16 Bukkit/Spigot/Paper

License

NotificationsYou must be signed in to change notification settings

astorks/ScriptableMC-Engine

Repository files navigation

GitHub release (latest by date)SpigotMC ResourceLicense

Run JavaScript/TypeScript plugins for Minecraft 1.17 using the GraalJS script engine.
Supported Minecraft Versions: Bukkit/Spigot/Paper1.17
Previous Minecraft Versions:Use v1.3.X version of the plugin

New v1.17.X

We are switching to a new version numbering to match the supporting minecraft version.
New v1.17.X builds of this plugin will only work with Minecraft 1.17+
For Minecraft v1.12-1.16 you should use v1.3.X of this plugin.

This plugin is in a preview state, there may be breaking changes, missing features, and possibly a few bugs.
Feel free to create an issue if you find any missing features, bugs, or just have an idea for a great feature to add.

This plugin requires running your minecraft server with OpenJDK, Standard JDK, or the GraalVM java runtime.
Most linux servers already use OpenJDK, however if you're running windows or want a fully supported java runtime that supports AOT javascript compilation you can installGraalVM-CE.

GraalVM-CE is a free open source java runtime created by Oracle that is pre-packaged with the GraalJS Engine allowing all javascript engine features including AOT compilation of javascript.

Installing The JavaScript Engine Plugin

If your server is running on a Standard JDK
If your server is running on a GraalVM JDK

Take a look atScriptableMC-TypeScript for a full typescript plugin example.You can take the typescript example and compile it, then directly modify the javascript if you don't want to use typescript.

Commands and Permissions

ScritableMC Base Command
CommandAliasDescriptionPermission
/scriptablemc menu/smc mOpens an inventory menu that allows you to control the script engines.scriptablemc.menu
/scriptablemc info/smc iPrints plugin version and all loaded script engine versions if available.scriptablemc.info
/scriptablemc reload/smc rlFully reloads all script engines and all script files.scriptablemc.reload
/scriptablemc version/smc vCheck the github releases for any updates.scriptablemc.version
ScritableMC JavaScript Engine Commands
CommandAliasDescriptionPermission
/scriptablemc javascript reload/smc js rl/jsrlFully reloads the javascript engine and all script files.scriptablemc.js.reload
/scriptablemc javascript execute <source>/smc js ex <source>/jsex <source>Executes javascript source and prints the return value.scriptablemc.js.execute
/scriptablemc javascript file <filePath>/smc js f <filePath>/jsexfExecutes javascript file from the scripts folder.scriptablemc.js.execute.file
/scriptablemc javascript pastebin <filePath>/smc js pb <filePath>/jsexpbExecutes javascript source from a pastebin.scriptablemc.js.execute.pastebin

/smc javascript execute Command Example

/jsex return 1 + 1
2

/jsex sender.sendMessage(lib.org.bukkit.ChatColor.GREEN + "Hello World!")
Hello World!

Third Party Libraries

https://github.com/MinusKube/SmartInvs - Inventory helper library
https://github.com/lucko/helper - MinecraftVersions helper library
https://github.com/jkcclemens/khttp - HTTP helper library
https://github.com/aikar/commands - Built-in commands and auto-completion
https://github.com/tr7zw/Item-NBT-API - NBT helper library
https://github.com/apache/commons-io - FileUtils helper library
https://github.com/graalvm/graaljs - JavaScript engine

About

Create TypeScript/JavaScript plugins for Minecraft 1.16 Bukkit/Spigot/Paper

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

[8]ページ先頭

©2009-2025 Movatter.jp