MineHacker - JavaScripting Plugin

Warning: This project is experimental. Its files will not synchronize across the CurseForge network.

Coding Extraordinaire!

MineHacker is a Minecraft JavaScripting plugin for beginners and pros. It aims at being easy to use but powerful, giving you the best there is to offer in the JavaScript language.

Making a script is easy, just place your .js file in the folder plugins/MineHacker. Alternately you can put your script in a subfolder, in case you have assets or other scripts that go with it. The main.js file of every direct sub-folder will be loaded automatically.

Example plugins/MineHacker/Eval.js:

command("eval", function (parameters) {
 if (this.player.hasPermission("js.eval")) {
  this.player.sendMessage(eval(parameters.join(" ")))
 } else {
  this.player.sendMessage("You do not have permission to eval. (js.eval)")
 }
})

/eval server.broadcastMessage("Hello, all!")

command(name, callback) is built into MineHacker to allow you to create arbitrary commands. In true hacker fashion, it abuses the PlayerCommandPreprocessEvent to let you create any command you like without hard-coding it. The this object is the PlayerCommandPreprocessEvent, and parameters is a space-separated array of parameters.

There are a few other builtins you should be aware of:

server - The Bukkit.getServer() object. See here for all the goodies.

plugin - The MineHacker JavaPlugin object. Do plugin.logger.info("message") to log in the console.

on(event, [priority = "normal", [ignoreCancelled = true,]] callback) - Registers an event. You can peruse events under the org.bukkit.event packages in the docs. If you surround the event name in quotes, you can omit the package if you want.

mod("jsModName.js") - Loads a .js file and returns its api variable. You can use the api variable (an empty object by default) to give your mods a mod API. Works on js mod files and folders too.

persist(filename, defaultObject) - Returns a persistent object stored in the specified file. JSON is used to encode the object, so you must avoid using circular references. e.g. var store = persist("ModFolder/store.json", {defaultProp:true})

There are a few more APIs, but that's the gist of what you need to know to get started writing scripts in MineHacker.

 

FAQ:

Q: Where is da eval command?
A: In the example plugin above.

Q: What are da permissions?
A: No permissions. To use MineHacker you need to create and edit script files in the plugins/MineHacker directory.

Q: How can I show mah appreciation?
A: If you have made money off MineHacker, it would be appreciated if you would donate $10 to support the development. All donations are appreciated.

 

License:
Copyright Jonathan A Graef - All Rights Reserved
You may use this plugin for any purpose except you may not distribute it.


Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

  • Project ID
    315438
  • Created
    Feb 21, 2019
  • Last Released File
    Mar 5, 2019
  • Total Downloads
    417
  • License

Categories

Members

Recent Files