JSC
JSC is a simplicity-oriented, feature-rich rewrite of the excellent ScriptCraft by Walter Higgins.
JSC lets you write Bukkit plugins in Javascript. It has many advantages over traditional Java plugins, inlcuding:
- On-the-fly code editing
- No need to compile the plugins
- No need to learn/understand Java's complex object-oriented programming
- Insanely simple integration of plugins/modules: JSC uses Node.js's require() function, which allows you to access other plugins' variables/functions with ease.
It comes with helper functions/variables/modifications (e.g. event handling, global command registering), so you can painlessly write Bukkit plugins!
Commands
-
/js Evaluates Javascript. Permission - jsc.evaluate Example -
/js server.broadcastMessage("Hi");
-
/jsp Executes registered 'jsp' commands, including JSC's own commands (e.g. 'update', 'cancel'). Permission - jsc.proxy Example -
/jsp update core
-
/jsc Displays plugin version. Permission - none Example -
/jsc
How to use
First, install the plugin, and then in chat, type:
/js 5+5;
This is the most simple form of JS -- arithmetic. Now, it doesn't stop there, you can do a lot of things with it!
Take a look at the next example:
/js events.on("player.PlayerChatEvent", function(listener, event){event.setMessage(String(event.getMessage()).green())});
This registers a Bukkit PlayerChatEvent so when a player says something, it makes their text green!
Note how event.setMessage() and event.getMessage() are used. These are actual Bukkit API methods!
Writing plugins has never been as painless as this.
Writing modules/plugins
To get started, read the wiki (a work in progress). All the documentation and tutorials can be found there.
If you want inspiration, dig inside these plugins and these modules. You can run plugins/modules by putting them in the plugins/jsc/(plugins/modules)
folder.
Metrics
This plugin uses Hidendra's Metrics system, which collects and reports various data to mcstats.org, which can include:
- A unique identifier
- The server's version of Java
- Whether the server is in offline or online mode
- The plugin's version
- The server's version
- The OS version/name and architecture
- The core count for the CPU
- The number of players online
- The Metrics version
You can always opt-out by going in plugins/PluginMetrics/config.yml
and changing the opt-out
option to true
Source
Feel free to fork this project on GitHub!
@chistian95
Sorry, dude. School and (recently) my job have been stalling me. I will definitely finish the documentation this Saturday.
edit
Change of plans, again. I can't guarantee you when I'll get JSC done. I'm bogged down with a lot of other things right now. Sorry.
So... How is it going?
@chistian95
Sweet. I should have the wiki up over this weekend.
@Strategetical
Hmmm This is awesome! I have made my own join/leave messages and also a first join kit. I'll be doing a few more plugins until you put the wiki.
Thanks for this awesome plugin!
@chistian95
Yeah, but JSC does many things differently. It comes with lots of helper functions and whatnot, so it won't be as simple as you think, it's actually simpler.
@Strategetical
Yeah I know Javascript so I'll try to do something :P
@chistian95: I am very busy working on pushing out the documentation via wiki , so it might take some time before the project is ready for the general public. Otherwise, if you know what you're doing, have fun! :D
Awesome!! I'll test it tomorrow. Thanks.