ScriptingApi is a project mainly written in JAVASCRIPT and JAVA, it's free.
A plugin for hMod that allows you to write plugins in Javascript.
ScriptingApi is a plugin that allows you to create plugins for hMod in pure Javascript (or Python). Every hook for hMod has been implemented so the results are limitless. Also, a few extra features were rolled in in order to make plugin development as painless as possible. All Javascript errors are stack traced in the console. If one plugin crashes, the others are unaffected.
The best way to learn is to look at the files in the "src/js/" directory.
All of these hooks are available to you: http://hmod.ricin.us/javadoc/index.html?PluginListener.html
If you wish to make an instance of a new hMod class, say Minecart you would do it like this:
var minecart = Api.create("Minecart", [
/* x */ 0,
/* y */ 50,
/* z */ 10,
/* http://hmod.ricin.us/javadoc/index.html?Minecart.Type.html */ Api.fetchEnum("Minecart.Type").Minecart
]);
* `Api.onPlayerMove`
* `Api.onSignShow`
* `Api.onSignChange`
* `Api.onOpenInventory`
* `Api.onTeleport`
* `Api.onLoginChecks`
* `Api.onLogin`
* `Api.onDisconnect`
* `Api.onChat`
* `Api.onCommand`
* `Api.onConsoleCommand`
* `Api.onBan`
* `Api.onIpBan`
* `Api.onKick`
* `Api.onBlockCreate`
* `Api.onBlockDestroy`
* `Api.onArmSwing`
* `Api.onAttack`
* `Api.onBlockBreak`
* `Api.onBlockPlace`
* `Api.onBlockPhysics`
* `Api.onBlockRightClicked`
* `Api.onDamage`
* `Api.onExplode`
* `Api.onFlow`
* `Api.onHealthChange`
* `Api.onIgnite`
* `Api.onItemDrop`
* `Api.onItemPickUp`
* `Api.onItemUse`
* `Api.onLiquidDestroy`
* `Api.onMobSpawn`
* `Api.onRedstoneChange`
* `Api.onVehicleCollision`
* `Api.onVehicleDamage`
* `Api.onVehicleCreate`
* `Api.onVehicleDestroyed`
* `Api.onVehicleEnter`
* `Api.onVehiclePositionChange`
* `Api.onVehicleUpdate`
The BlockBuilder class is meant to make building simple to complex objects really easy. It accounts for the users rotation and the axes.
Essentially you first create the blocks that you want, then you attach them to the world. All you have to do is construct the group of blocks in a "sandbox" where you start at x = 0, y = 0 and z = 0.
See the end of "src/js/Hitblox.js" for a simple example of how to use the BlockBuilder class.