Dysfold / craftjs

MIT License
10 stars 2 forks source link

CraftJS

CraftJS is a Bukkit plugin that adds support for writing plugins in TypeScript and JavaScript.

Current status

CraftJS is in early development and has little documentation aside of the JS/Javadocs. No guarantees about API stability are provided.

Requirements

Usage

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.

Development

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.

Technical details

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'.

Components

CraftJS consists of the following components that can be found in directories with similar names:

Differences from ScriptCraft

CraftJS is inspired by an older scripting plugin, Scriptcraft. Despite the obvious similarities, the two plugins have several important differences: