CraftJS is a Bukkit plugin that adds support for writing plugins in TypeScript and JavaScript.
CraftJS is in early development and has little documentation aside of the JS/Javadocs. No guarantees about API stability are provided.
Tutorials for creating CraftJS plugins will come later. For now, see 'internal' for a JS plugin example. If you copy the package.json from there, make sure to change dependency 'craftjs-plugin' to latest version from npm.
To install CraftJS, just copy the jar file to your plugins folder.
CraftJS can be built with 'build.sh' script available at repository root. Unfortunately, only Linux is supported for building at the moment.
More development instructions will come later.
JavaScript is executed with GraalJS, which (unline Nashorn) supports modern JavaScript features. CraftJS itself provides
TypeScript types are generated automatically from Java source code and include Javadoc. They are available on npm as 'craftjs-plugin'.
CraftJS consists of the following components that can be found in directories with similar names:
CraftJS is inspired by an older scripting plugin, Scriptcraft. Despite the obvious similarities, the two plugins have several important differences: