THIS TOPIC IS OUTDATED, AS A PROPER API HAS NOW BEEN IMPLEMENTED.
Here are Soul Sand, Pumpkins, and Sponge added to MCPE, all running on new block IDs. This version of BlockLauncher has not been released yet to support custom blocks, so you'll have to compile the github source yourself to use these mods, But If you do so, enjoy
Here's the code:
function newLevel() {
ModPE.defineBlock(23, "Sponge", [48, 48, 48, 48, 48, 48], false, 0);
//48 is the location of spong on terrain.png read from
//Left to right, top to bottom, like a book
}
function useItem(x, y, z, itemId, blockId) {
Level.setTile(x, y + 1, z, 23, 0); //Set our block 1 block up
}
WARNING: DO NOT ADD THE BLOCK TO YOUR INVENTORY IN SURVIVAL. YOUR GAME WILL CRASH INSTANTLY AND CORRUPT YOUR WORLD. ALSO, IF YOU USE Entity.setCarriedItem() TO ADD IT TO YOUR INVENTORY IN CREATIVE, DO NOT CHANGE OUT OF ITS SLOT THEN BACK ONTO IT, FOR SOME REASON DISPLAYING THE BLOCKS NAME WILL CRASH THE GAME
Anyway, this is the only method involving custom blocks, because it is an incomplete build of BlockLauncher(explaining the major bugs above) and Zhuowei will be adding a proper ModPE API soon. This is only used to really create some test blocks. Anyway, enjoy!
Here are Soul Sand, Pumpkins, and Sponge added to MCPE, all running on new block IDs. This version of BlockLauncher has not been released yet to support custom blocks, so you'll have to compile the github source yourself to use these mods, But If you do so, enjoy
Here's the code:
function newLevel() {
ModPE.defineBlock(23, "Sponge", [32, 32, 32, 32, 32, 32], false, 0);
//32 is the location of spong on terrain.png read from
//Left to right, top to bottom
}
function useItem(x, y, z, itemId, blockId) {
Level.setTile(x, y + 1, z, 23, 0); //Set our block 1 block up
}
WARNING: DO NOT ADD THE BLOCK TO YOUR INVENTORY IN SURVIVAL. YOUR GAME WILL CRASH INSTANTLY AND CORRUPT YOUR WORLD. ALSO, IF YOU USE Entity.setCarriedItem() TO ADD IT TO YOUR INVENTORY IN CREATIVE, DO NOT CHANGE OUT OF ITS SLOT THEN BACK ONTO IT, FOR SOME REASON DISPLAYING THE BLOCKS NAME WILL CRASH THE GAME
Anyway, this is the only method involving custom blocks, because it is an incomplete build of BlockLauncher(explaining the major bugs above) and Zhuowei will be adding a proper ModPE API soon. This is only used to really create some test blocks. Anyway, enjoy!
How did you get 32 as the location of the sponge. I am looking at terrain.png right now and the sponge is in the first column and the fourth row.
My question is how do you find thenumber for the block on terrain png? Is it the first block on the first row = 1?
Like I said already: You have to read the terrain.png like a book: Left to right, top to bottom. The very first column, very first row is 0, so no, in programming almost everything is indexed 0-based. 1 is not first. Then, the stone texture, moving like a book, is 1, the first column, 2nd row is 16. Like a book guys, like a book. In this case, the very bottom right is 255.
Rollback Post to RevisionRollBack
Back to modding! Follow me on Twitter @byteandahalf
Like I said already: You have to read the terrain.png like a book: Left to right, top to bottom. The very first column, very first row is 0, so no, in programming almost everything is indexed 0-based. 1 is not first. Then, the stone texture, moving like a book, is 1, the first column, 2nd row is 16. Like a book guys, like a book. In this case, the very bottom right is 255.
umm.. so the sponge texture is on the fourth row 1st column, 4*16-1=63... I'm confused... still..
Here are Soul Sand, Pumpkins, and Sponge added to MCPE, all running on new block IDs. This version of BlockLauncher has not been released yet to support custom blocks, so you'll have to compile the github source yourself to use these mods, But If you do so, enjoy
Here's the code:
function newLevel() { ModPE.defineBlock(23, "Sponge", [48, 48, 48, 48, 48, 48], false, 0); //48 is the location of spong on terrain.png read from //Left to right, top to bottom, like a book
}
function useItem(x, y, z, itemId, blockId) {
Level.setTile(x, y + 1, z, 23, 0); //Set our block 1 block up
}WARNING: DO NOT ADD THE BLOCK TO YOUR INVENTORY IN SURVIVAL. YOUR GAME WILL CRASH INSTANTLY AND CORRUPT YOUR WORLD. ALSO, IF YOU USE Entity.setCarriedItem() TO ADD IT TO YOUR INVENTORY IN CREATIVE, DO NOT CHANGE OUT OF ITS SLOT THEN BACK ONTO IT, FOR SOME REASON DISPLAYING THE BLOCKS NAME WILL CRASH THE GAME
Anyway, this is the only method involving custom blocks, because it is an incomplete build of BlockLauncher(explaining the major bugs above) and Zhuowei will be adding a proper ModPE API soon.
Back to modding! Follow me on Twitter @byteandahalf
http://www.twitter.com/AuthenticPixel
Back to modding! Follow me on Twitter @byteandahalf
http://www.minecraftforum.net/forums/minecraft-pocket-edition/mcpe-mods-tools/2610428-0-13-emeraldcraft-metalurgic-gems-alchemy
Back to modding! Follow me on Twitter @byteandahalf
+1 Me If I Helped You!
Follow Me On Twitter: @shadowdude246
I guess with coordinates(x,y), like in the items.png
http://www.twitter.com/AuthenticPixel
Click Banner to SUBSCRIBE!!! I'm in the Team Flame Clan!!! Click that little green arrow!! -------------->
+1 Me If I Helped You!
Follow Me On Twitter: @shadowdude246
Click Banner to SUBSCRIBE!!! I'm in the Team Flame Clan!!! Click that little green arrow!! -------------->
Click Banner to SUBSCRIBE!!! I'm in the Team Flame Clan!!! Click that little green arrow!! -------------->
ModPE!?
How did you get 32 as the location of the sponge. I am looking at terrain.png right now and the sponge is in the first column and the fourth row.
Want GUI Templates? Done!
https://github.com/BeATz-UnKNoWN/ModPE_Scripts/wiki/ModPE-Script-Templates
P.S. Feel free to follow me so you know when I post "awesome" content and make the MCForums a brighter place (totally).
If you need to contact me you can either shoot a Kik message to beatz_unknown or send an email to [email protected]
Back to modding! Follow me on Twitter @byteandahalf
+1 Me If I Helped You!
Follow Me On Twitter: @shadowdude246
Yeah, you're right. Sponge is actually 48 :3 That was just off the top of my head. And no, you can't multiply like that, it doesn't work that way...
Back to modding! Follow me on Twitter @byteandahalf
And yes, Byteandahalf, consider my day "more" made!!
http://www.minecraftforum.net/forums/minecraft-pocket-edition/mcpe-mods-tools/2610428-0-13-emeraldcraft-metalurgic-gems-alchemy