Minecraft PE does not allow adding custom recipes to it's crafting system. So I decided to do so, feel free to look at the code, use it, or improve it, if you improve it, please send me the improved script!
VERY EARLY DEVELOPMENT!
Currently in code:
Custom crafting table
A method for obtaining the custom crafting table
Place a chest in the world and 4 crafting tables in a diamond shape (c is crafting table and 0 is chest, - is nothing)
-c-
c0c
-c-
Make sure you have 4 or more iron ingots in your hand, and tap the chest's top side. The mutliblock will now shrink into a new block - the Crafting table (custom one). You will have 4 iron ingots less in your hand.
Download: None yet, wait until the first release.
Code: https://github.com/l.../craftingAPI.js
Raw code: https://raw.github.c.../craftingAPI.js
The block (must download): https://raw.github.c...aftingBlocks.js Bugs: the block isn't breakable
I would love to get a custom texture if anyone is willing to make one!
When implemented, you could add your own recipes, which is the purpose of this API!
To prevent people from using the same recipe, I have a spreadsheet, please, if you use my API (when it's done) use the spreadsheet! https://docs.google.com/spreadsheet/ccc?key=0AirYJmYDx0EsdDV3VzczeWdpMEk3U0NoUmVjRVBMR0E&usp=sharing
How to craft:
Tap the custom crafting table with what you want to add in your hand, and repeat that until you get the right amounts, I have kind of force made this a tile entity (this isn't normally possible) so it saves it's internal inventory in an Array, externally (modders, should I switch to an object instead of an array?). You need to have a normal crafting table directly above the custom one, and tap it to craft using the custom table's internal inventory.
I added an example recipe - 1 stick and 2 iron = iron sword, meaning, if you insert 1 stick and 2 iron in the method mentioned above, then tap the crafting table, an iron sword will be added into your inventory.
Thanks, but it's not nearly done. In fact I am now focusing on getting a tileEntity API, because the way this custom crafting table is going to work requires it being a tile entity, using the code I made, any block could turn into a tile entity. Check my github REPO: https://github.com/lirannl/modpe
I added the spreadsheet, please enter your recipes and I'll add them, when the API is functional. By the way, could you add that at the start of your script?
scriptList = ModPE.readData(scriptList)
for (var i=0; i < scriptList.length; i++)
{
if (scriptList [i] == "<name of your script here>")
}
{
scriptList.push("<name of your script here>")
}
ModPE.saveData(scriptList, scriptList)
This basically checks if user has your script and writes it
I might never use it, but why not
Thanks, but it's not nearly done. In fact I am now focusing on getting a tileEntity API, because the way this custom crafting table is going to work requires it being a tile entity, using the code I made, any block could turn into a tile entity. Check my github REPO: https://github.com/lirannl/modpe
I added the spreadsheet, please enter your recipes and I'll add them, when the API is functional. By the way, could you add that at the start of your script?
scriptList = ModPE.readData(scriptList)
for (var i=0; i < scriptList.length; i++)
{
if (scriptList [i] == "<name of your script here>")
}
{
scriptList.push("<name of your script here>")
}
ModPE.saveData(scriptList, scriptList)
This basically checks if user has your script and writes it
I might never use it, but why not
I might end up adding an actual crafting API, but it seems that what you really need is a cross-script API. Hmm.
Ugh, my workaround for not understanding GUIS is a total failure.
I can't continue this thing alone.
Also ISE, if you do make one, please make it Xbox crafting and not PC crafting (so there's no 3x3 grid), I find it needless to craft like the way it is in PC, and the way it is in PE isn't at good as the way it is in Xbox.
VERY EARLY DEVELOPMENT!
Currently in code:
Custom crafting table
A method for obtaining the custom crafting table
-c-
c0c
-c-
Make sure you have 4 or more iron ingots in your hand, and tap the chest's top side. The mutliblock will now shrink into a new block - the Crafting table (custom one). You will have 4 iron ingots less in your hand.
Code: https://github.com/l.../craftingAPI.js
Raw code: https://raw.github.c.../craftingAPI.js
The block (must download): https://raw.github.c...aftingBlocks.js Bugs: the block isn't breakable
I would love to get a custom texture if anyone is willing to make one!
When implemented, you could add your own recipes, which is the purpose of this API!
To prevent people from using the same recipe, I have a spreadsheet, please, if you use my API (when it's done) use the spreadsheet! https://docs.google.com/spreadsheet/ccc?key=0AirYJmYDx0EsdDV3VzczeWdpMEk3U0NoUmVjRVBMR0E&usp=sharing
How to craft:
Tap the custom crafting table with what you want to add in your hand, and repeat that until you get the right amounts, I have kind of force made this a tile entity (this isn't normally possible) so it saves it's internal inventory in an Array, externally (modders, should I switch to an object instead of an array?). You need to have a normal crafting table directly above the custom one, and tap it to craft using the custom table's internal inventory.
I added an example recipe - 1 stick and 2 iron = iron sword, meaning, if you insert 1 stick and 2 iron in the method mentioned above, then tap the crafting table, an iron sword will be added into your inventory.
https://github.com/lirannl/modpe
I added the spreadsheet, please enter your recipes and I'll add them, when the API is functional. By the way, could you add that at the start of your script?
This basically checks if user has your script and writes it
I might never use it, but why not
I might end up adding an actual crafting API, but it seems that what you really need is a cross-script API. Hmm.
Currently, I have one script that abuses the direct Java access and calls other scripts' commands; that might be one way to register into your script.
https://raw.github.com/zhuowei/ModPEScripts/master/500ise_macro.js
saveData and getData are local to each script: scripts cannot read each others' data with this method.
I can't continue this thing alone.
Also ISE, if you do make one, please make it Xbox crafting and not PC crafting (so there's no 3x3 grid), I find it needless to craft like the way it is in PC, and the way it is in PE isn't at good as the way it is in Xbox.