BukkitJs 2.0.0

Bukkit JavaScript interface

  1. Yamakaja
    Tested Minecraft Versions:
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    Source Code:
    https://github.com/Yamakaja/BukkitJs
    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
    simpleauthority and clip like this.

Recent Updates

  1. Major Rewrite