Home›Java›Mods›BukkitJs
BukkitJs
ModsJava

BukkitJs

Java mod listed for Minecraft 1.8–1.11. Downloads from the MC Java Mods app on Android.

⬇ Download on Spigot
BukkitJs is a tool which allows you to execute JavaScript scripts on certain events with access to the FULL Java and Bukkit (Spigot) API!
But this also means that this is a tool designed for people who know the Bukkit API but don't want to put together an entire new plugin for small features.

Dependencies:
- Java 8+

WARNING: This is an extremely powerful tool and nobody but highly trusted staff should be given access to it.

Command:
- /script
Permission: bukkitjs.admin

USAGE:

Note, you should be familiar with JavaScript and the basics of bukkit.
A tutorial on interfacing with Java from JavaScript can be found here, but is only required for more advanced usage:
https://docs.oracle.com/javase/8/docs/technotes/guides/scripting/prog_guide/javascript.html

Lets start by creating a really simple /fly command:

First, create a file with .js ending in plugins/BukkitJs/scripts/ (The file name is irrelevant) and open it in an editor.

To register the command we need to call the command method on the global server object. The parameters are as follows:

server.command(String name, String description, String usage, String[] aliases (Actually, a JavaScript array. Not a Java one), function(CommandSender sender, String alias, String[] args)

Code (Javascript):

with (bukkitImports ) {
    server. command ( "fly" , "Toggle survival flight" , "/fly" , [ "f" ] , function (sender , alias , args ) {
    if ( ! (sender. getAllowFlight ) ) { // Sender isn't a player
        sender. sendMessage (ChatColor. DARK_RED + "Only players may use this command!" ) ;
        return ;
    }
    sender. setAllowFlight ( !sender. getAllowFlight ( ) ) ;
    sender. sendMessage (ChatColor. GOLD + "Flight mode: " + (sender. getAllowFlight ( ) ? ChatColor. GREEN + "enabled" : ChatColor. RED + "disabled" ) )
    } )
}
 
A couple more examples can be found here: https://github.com/Yamakaja/BukkitJs/tree/master/examples

Please report bugs here: https://github.com/Yamakaja/BukkitJs/issues

Commands

Plugin details

Read from the plugin's own plugin.yml.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

BukkitJs is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.9, 1.10, 1.11. Downloaded 274 times (via Spigot). Download it and open it directly in the game.

Explore more