What is the use of "false" and the "0" at the end ?
Doesn't matter anymore because the official API has been implemented. Read the posts above for the new blocklauncher, as well as Zhuowei's example script.
Rollback Post to RevisionRollBack
Back to modding! Follow me on Twitter @byteandahalf
Make sure you follow me on twitter! @DarkDiaMiner IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->
I really hope I did this right. When I uploaded it I didn't realize it would change all the gray areas to black
This is just to help people know what block is what.
DO NOT USE THIS AS YOUR TERRAN.PNG, BECAUSE IT WILL HAVE NUMBERS ON THE BLOCKS WHEN PLAYING
FINALLY!! YES HERE COMES THE NEW ORES AND NEW TOOLS AND DIMENSIONS!!!!YESSSSSSS I FEEL SO EXPLOSIVE I COULD BE A CREEPER!! SO I WILL FIND A HOUSE!! I expect awesome things with this and the new file reader script!
Make sure you follow me on twitter! @DarkDiaMiner IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->
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!
Reason why it dosent work because its suposed to be Block.definedBlock not ModPE.definedBlock
function newLevel(){ Block.defineBlock(79, "Dispenser", [46, 62, 45, 45, 45, 45], false, 0); // [바닥, 위, 나머지 둘레] } function useItem(x, y, z, item, block, side, itemData, blockData){ var pos = getSide(x, y, z, side); if(item == 79){ setTile(pos[0], pos[1], pos[2], 79, 0); removeItemInventory(79, 0, 1); } } function destroyBlock(x, y, z, side){ if(getTile(x, y, z) == 79) Level.dropItem(x, y, z, 0, 79, 1, 0); } function getSide(x, y, z, side){ var pos = [];
switch(side){ case 0: pos = [x, y - 1, z]; // 아래쪽 break; case 1: pos = [x, y + 1, z]; // 위쪽 break; case 2: pos = [x, y, z - 1]; // 남쪽 break; case 3: pos = [x, y, z + 1]; // 북쪽 break; case 4: pos = [x - 1, y, z]; // 동쪽 break; case 5: pos = [x + 1, y, z]; // 서쪽 break; }
return pos; } function removeItemInventory(id, damage, count){ for(var i = 9; i <= 44; i++){ if(Player.getInventorySlot(i) == id && Player.getInventorySlotData(i) == damage){ var c = (Player.getInventorySlotCount(i) - count); Player.clearInventorySlot(i); if(c > 0){ addItemInventory(id, c, damage); return; }else if(c < 0){ count = parseInt(c); }else return; } } }
function newLevel(){ Block.defineBlock(79, "Dispenser", [46, 62, 45, 45, 45, 45], false, 0); // [바닥, 위, 나머지 둘레] } function useItem(x, y, z, item, block, side, itemData, blockData){ var pos = getSide(x, y, z, side); if(item == 79){ setTile(pos[0], pos[1], pos[2], 79, 0); removeItemInventory(79, 0, 1); } } function destroyBlock(x, y, z, side){ if(getTile(x, y, z) == 79) Level.dropItem(x, y, z, 0, 79, 1, 0); } function getSide(x, y, z, side){ var pos = [];
switch(side){ case 0: pos = [x, y - 1, z]; // 아래쪽 break; case 1: pos = [x, y + 1, z]; // 위쪽 break; case 2: pos = [x, y, z - 1]; // 남쪽 break; case 3: pos = [x, y, z + 1]; // 북쪽 break; case 4: pos = [x - 1, y, z]; // 동쪽 break; case 5: pos = [x + 1, y, z]; // 서쪽 break; }
return pos; } function removeItemInventory(id, damage, count){ for(var i = 9; i <= 44; i++){ if(Player.getInventorySlot(i) == id && Player.getInventorySlotData(i) == damage){ var c = (Player.getInventorySlotCount(i) - count); Player.clearInventorySlot(i); if(c > 0){ addItemInventory(id, c, damage); return; }else if(c < 0){ count = parseInt(c); }else return; } } }
Reason why it dosent work because its suposed to be Block.definedBlock not ModPE.definedBlock
I don't need your code that you copied. This is an outdated topic, before the API was implemented. Back then it was ModPE.setBlock. The blocks in the pictures wouldn't exist if I didn't know what I was doing. Please critisize someone on your(poor) level of modding, no offense, and read the topic thouroughly and you would know what is happening and that I made this before BlockLauncher custom block support was officially released..
I really hope I did this right. When I uploaded it I didn't realize it would change all the gray areas to black
This is just to help people know what block is what.
DO NOT USE THIS AS YOUR TERRAN.PNG, BECAUSE IT WILL HAVE NUMBERS ON THE BLOCKS WHEN PLAYING
You lost count at 112: 112, 133?!, 134...
I can autogenerate this picture for you if you need it. I'm also adding row-column style specification in the next beta.
Okay....
ModPE!?
What is the use of "false" and the "0" at the end ?
Back to modding! Follow me on Twitter @byteandahalf
IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumI release my demo script under Creative Commons CC0, which means you can do whatever you want with it.
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255
Lol some code!
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumhttp://tinyw.in/bl
I really hope I did this right. When I uploaded it I didn't realize it would change all the gray areas to black
This is just to help people know what block is what.
DO NOT USE THIS AS YOUR TERRAN.PNG, BECAUSE IT WILL HAVE NUMBERS ON THE BLOCKS WHEN PLAYING
Thanks that helped alot
IF I post a mod download it and give me a +1 if you appreciate.
Make sure you give me a suggestion at my WIP topic darkPE
Make sure you click on that +1 button if I help you! ---------------->
Block.defineBlock(79, "Dispenser", [46, 62, 45, 45, 45, 45], false, 0); // [바닥, 위, 나머지 둘레]
}
function useItem(x, y, z, item, block, side, itemData, blockData){
var pos = getSide(x, y, z, side);
if(item == 79){
setTile(pos[0], pos[1], pos[2], 79, 0);
removeItemInventory(79, 0, 1);
}
}
function destroyBlock(x, y, z, side){
if(getTile(x, y, z) == 79) Level.dropItem(x, y, z, 0, 79, 1, 0);
}
function getSide(x, y, z, side){
var pos = [];
switch(side){
case 0:
pos = [x, y - 1, z]; // 아래쪽
break;
case 1:
pos = [x, y + 1, z]; // 위쪽
break;
case 2:
pos = [x, y, z - 1]; // 남쪽
break;
case 3:
pos = [x, y, z + 1]; // 북쪽
break;
case 4:
pos = [x - 1, y, z]; // 동쪽
break;
case 5:
pos = [x + 1, y, z]; // 서쪽
break;
}
return pos;
}
function removeItemInventory(id, damage, count){
for(var i = 9; i <= 44; i++){
if(Player.getInventorySlot(i) == id && Player.getInventorySlotData(i) == damage){
var c = (Player.getInventorySlotCount(i) - count);
Player.clearInventorySlot(i);
if(c > 0){
addItemInventory(id, c, damage);
return;
}else if(c < 0){
count = parseInt(c);
}else return;
}
}
}
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYou can shorten that getSide function: see https://raw.github.com/zhuowei/ModPEScripts/master/500ise_mirrored.js
Also, Comic Sans MS is not a good font to use, especially for code. Use the [ code] tags.
EDIT: Sorry for being so vicious
Back to modding! Follow me on Twitter @byteandahalf
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYou lost count at 112: 112, 133?!, 134...
I can autogenerate this picture for you if you need it. I'm also adding row-column style specification in the next beta.
Tell me how I can quote part of the post...
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]