ScriptCraft
ScriptCraft lets you create your own mods using Javascript. ScriptCraft uses the CommonJS module system (the same module loading system used by Node.js) so managing your code will be easier. You can also run Javascript code on the in-game command prompt or extend the game by writing plugins that use the Bukkit API in javascript.
Examples:
At the command prompt type:
/js 1 + 1
> 2
... Any javascript code can be evaluated at the in-game command prompt.
/js alert( 'Hello ' + self.name )
> Hello walterh
... Special bukkit variables are available via javascript , for example the server object is the instance of org.bukkit.Server . Writing event handlers in ScriptCraft is relatively easy...
events.blockBreak( function( event ) {
echo(event.player, 'You broke a block!' );
});
events.playerJoin( function( event ) {
echo( event.player, 'Welcome to the server!' );
});
... Any bukkit event can be handled. The above code prints the name of any player who breaks a block in the game. ScriptCraft comes with some built-in functions to make building easier...
/js box( blocks.wool.black, 4, 9 , 1)
... creates a 2001 Monolith 4 blocks wide by 9 blocks high by 1 block long.
The full bukkit API can be used via javascript to write new mods. Yes - you can write bukkit plugins in javascript! See ScriptCraft on GitHub for more information. Full documentation is available on the github docs page.
A Youtube Video demonstrating Exploding Arrows in ScriptCraft A Youtube video demonstrating a mini-game (SnowBall Fight)
-
View User Profile
-
Send Message
Posted Dec 30, 2020[11:53:20 ERROR]: [scriptcraft] No JavaScript Engine available. ScriptCraft will not work without Javascript.
How do I fix this error/install a JS engine?
-
View User Profile
-
Send Message
Posted Dec 3, 2017guys, im in html and js very good. i just need to know how to make dehydratation. i dont know "mc javascript". how i can add delay time to wait to start dehydratation? how i add effects?
thanks.
-
View User Profile
-
Send Message
Posted Dec 3, 2017In reply to Forge_User_62261398:
Take a look at the Young Person's Guide to Programming in Minecraft, and the API Reference. Both are avaialable here https://github.com/walterhiggins/ScriptCraft/tree/development/docs
-
View User Profile
-
Send Message
Posted Jul 25, 2017This is one the best minecraft plugins I've ever seen.
Anything you can do with Java you can do it with JavaScript using this plugin, writing less lines and making it easier to read and mantain.
Never abandon this project, Walter.
-
View User Profile
-
Send Message
Posted Mar 13, 2015Do you have a IRC channel?
-
View User Profile
-
Send Message
Posted Mar 12, 2015Do you have a IRC channel on esper.net?
-
View User Profile
-
Send Message
Posted Oct 6, 2014Awesome plugin. I'm pretty familiar with the Bukkit API and am currently learning JavaScript, so this is perfect for adding in features to my server quickly, thanks.
-
View User Profile
-
Send Message
Posted Aug 29, 2014@broluigi
Yes. ScriptCraft itself is just a Java plugin that houses Javascript plugins so you can use all of the plugman commands.
-
View User Profile
-
Send Message
Posted Aug 29, 2014does this plugin work with plugman
-
View User Profile
-
Send Message
Posted Aug 29, 2014- Removed advertising of another plugin - Eyamaz
-
View User Profile
-
Send Message
Posted Apr 17, 2014What is easer teaching javascript or default java?
-
View User Profile
-
Send Message
Posted Apr 16, 2014@siemaeniu500
You can write javascript scripts and put them in the /scriptcraft/plugins/ folder.
For example: save the above code in a file called blockbrk.js and drop it in the scriptcraft/plugins folder and every time a player breaks a block they're sent a message.
-
View User Profile
-
Send Message
Posted Apr 16, 2014I can write scripts like in plugin"Skript"? And load it from file?
-
View User Profile
-
Send Message
Posted Mar 4, 2014@ThoLav
I'm not sure it will work (I haven't tried it myself) but you could try listening for this event...
http://jd.bukkit.org/beta/apidocs/org/bukkit/event/player/AsyncPlayerChatEvent.html
All events are cancelable so you could cancel it or change the message sent.
Walter
-
View User Profile
-
Send Message
Posted Mar 4, 2014Hey Walter,
is there a way to catch a message from plugins to a player? For example a WorldGuard message?
I want to script my own plot management, using WG in background, but I want to have the possibility to suppress the WG messages and send my own changed/translated message to player.
-
View User Profile
-
Send Message
Posted Mar 2, 2014@walterhiggins
Hey Walter,
thanks for your information.
-
View User Profile
-
Send Message
Posted Mar 2, 2014<<reply 2057497="">>
Usage: /jsp command command-params
If you type /jsp without a command it throws the Usage error you see above. I should probably make this a warning rather than an error/exception.
Thanks.
Walter
-
View User Profile
-
Send Message
Posted Mar 2, 2014Hey Walter,
I'm getting this error when I type /jsp without parameters!
http://pastebin.com/nczvYcL3
-
View User Profile
-
Send Message
Posted Jan 27, 2014@kgame
Take a look at this: https://forums.bukkit.org/threads/ignore-cancelled-events.61155/
Essentially, if [event].isCancelled() is true, then just don't let the handler do anything.
-
View User Profile
-
Send Message
Posted Jan 23, 2014@EventHandler(ignoreCancelled = true)
How to set this attribute at events.on