893dbd6aaa
I was having trouble adding recipes to my bukkit server using ScriptCraft. It looks like the example in js/modules/recipes.js only works on a CanaryMod server, and the original version of js/modules/bukkit/recipes.js caused type related errors and didn't seem to implement Spigot/Bukkit methods properly. With these changes I can now create a custom recipe and add it to the server with the following (note that the recipes.add() function both creates a bukkit ShapedRecipe AND adds the recipe to the server): var items = require("items"); var recipes = require("recipes"); var events = require("events"); var bow = items.bow(1); var tnt = items.tnt(1); var explodeBow = items.bow(1); var explodeBowMeta = explodeBow.getItemMeta(); explodeBowMeta.setDisplayName("Bow of Exploding"); explodeBowMeta.setLore(["Excite. Very boom."]); explodeBow.setItemMeta(explodeBowMeta); var explodeBowRecipe = recipes.add( { result: explodeBow, ingredients: {B: bow, T: tnt}, shape: [" ", "TB ", " "] }); |
||
---|---|---|
.. | ||
lib | ||
modules | ||
plugins | ||
readme.md |
scriptcraft root directory
This directory contains the following subdirectories...
- lib - contains core scriptcraft modules and code.
- modules - contains modules for use by others
- plugins - contains plugins (modules which are automatically loaded and globally-namespaced at startup)
If you are a minecraft modder who wants to develop simple mods then the plugins
location is where you should probably place your .js files.
If you are a minecraft modder who wants to develop more complex mods or provide an API for other modders, then modules intended for use by plugins (your own or others) should probably be placed in the modules
directory.
The lib
directory is reserved for use by ScriptCraft. If a module is considered essential for all, or adds significantly useful new functionality to ScriptCraft then it should be placed in the lib
directory.