In theory, it is possible. But it makes BlockLauncher freeze even before any replacing of blocks. This could be because BlockLauncher needs to check which of the 8388608 blocks in the world are coal ore.
If you want to try it, here is an example script:
function useItem(x,y,z,itemId,blockId,side) {
for(worldX=0;worldX<=255;worldX++) {
for(worldY=0;worldY<=127;worldY++) {
for(worldZ=0;worldZ<=255;worldZ++) {
if(getTile(worldX,worldY,worldZ) == 16) {
setTile(worldX,worldY,worldZ,246);//sets all coal to glowing obsidian
}
}
}
}
}
It Worked
I Tried Changing All The Water To Obsidian And Blocklauncher Froze,But After 5 Minutes,All The Water Was Changed Into Obsidian
lol 5 minutes???
your mcpe lags ALOT without anything, if it is 5 minutes to load.
Well 5 minutes approximately
i went to a shop after using that script and came after 5 minutes and the water was changes into obsidian
And Try Using This Script And Tell Me How Much Time Your Device Takes To Change All The Water In The World Into Obsidian: http://www.mediafire.com/download/u0wt4ti7m5edvv4/New_Text_Document.js
You can use modTick() to do it steadily. I will give an example later.
This is an example of world editing of displacing all stone (id1). It detects 20 blocks per second (too slow? change c++; into var c=c+10;)
if(/*your conditions here to enable*/){
static var enabled=true; //is there such thing called [b]static[/b] in js? If not, what about store data at a specific block (0,0,0)?
}
/*******************************************/
function modTick(){
if(enabled)testPerBlock(1); //I used another function to ensure local variables are not duplicated. But is this true in js?
//1 is the block (stone) to change
}
function testPerBlock(blockToTest){
if(!(0<=a<=255)){ //if not initialized
var a=0; //temp x coor;
var b=0; //temp y coor;
var c=0; //temp z coor;
}else{
a++;
b++;
c++;
}
if(c==256){
var c=0; //is this wrong?
b++;
}
if(b==128){
a++;
b==0;
}
var blockId=getTile(a,b,c);
if(blockId==blockToTest){
actionToDo(a,b,c);
}
}
function actionToDo(x,y,z){
//your code here
//example code:
setTile(x,y,z,0);
}
I didn't test it. Someone please help me debug it, as I am 99% sure there is a bug somewhere.
I can be found on Freenode IRC channels #pocketmine, #ModPEScripts, #LegendOfMCPE, #pmplugins or #BeaconMine.
I am a PocketMine-MP plugin developer. I hate it when people think that I love stupid admin positions. Being an admin is nothing compared to being a plugin developer.
I am also a main developer of BlockServer, a work-in-progress MCPE server software. You are welcome to download it, but it so far onlly spawns you in the upther (above the world). You can chat, though.
I do not own this server but I just love to put this banner here:
To post a comment, please login or register a new account.
Is There Any Way I Can Search For Blocks In The Whole World ?
Like I Want To Search For All The Coal Ore In The World And Replace It With Air ?
I Know...
But I Want To Make Make A ModPe Script..
but it laggs like crazy
ex)
for(var x=0;x<=256;x++)
{for(var z=0;z<=256;z++)
{for(var y=0;y<=256;y++)
{/*do something*/}}}
It Worked
I Tried Changing All The Water To Obsidian And Blocklauncher Froze,But After 5 Minutes,All The Water Was Changed Into Obsidian
Well 5 minutes approximately
i went to a shop after using that script and came after 5 minutes and the water was changes into obsidian
And Try Using This Script And Tell Me How Much Time Your Device Takes To Change All The Water In The World Into Obsidian:
http://www.mediafire.com/download/u0wt4ti7m5edvv4/New_Text_Document.js
This is an example of world editing of displacing all stone (id1). It detects 20 blocks per second (too slow? change c++; into var c=c+10;)
if(/*your conditions here to enable*/){ static var enabled=true; //is there such thing called [b]static[/b] in js? If not, what about store data at a specific block (0,0,0)? } /*******************************************/ function modTick(){ if(enabled)testPerBlock(1); //I used another function to ensure local variables are not duplicated. But is this true in js? //1 is the block (stone) to change } function testPerBlock(blockToTest){ if(!(0<=a<=255)){ //if not initialized var a=0; //temp x coor; var b=0; //temp y coor; var c=0; //temp z coor; }else{ a++; b++; c++; } if(c==256){ var c=0; //is this wrong? b++; } if(b==128){ a++; b==0; } var blockId=getTile(a,b,c); if(blockId==blockToTest){ actionToDo(a,b,c); } } function actionToDo(x,y,z){ //your code here //example code: setTile(x,y,z,0); }I didn't test it. Someone please help me debug it, as I am 99% sure there is a bug somewhere.