Jump to content

[1.7.10] Run a command.


Scriph

Recommended Posts

Not make a new command, but RUN it.

I looked in the CommandBlock classes, the net.minecraft imports. Even in the imports I checked the imports, I could not find how.

I would like the code here to do it. In the (jf==3) { } code block

 

 

public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta){

int jf = 0;

for(int i=1; i<=10; i++) {

jf=randomWithRange(3,3);

}

/* Wanted */

if (jf==3) {

}

if (jf==4) {

Entity gravelz = EntityList.createEntityByID(200, world);

gravelz.setPosition(x, y, z);

world.spawnEntityInWorld(gravelz);

}

 

if (jf==5) {

Entity gravel = EntityList.createEntityByID(2, world);

gravel.setPosition(x, y, z);

world.spawnEntityInWorld(gravel);

 

Entity gravelz = EntityList.createEntityByID(2, world);

gravelz.setPosition(x, y, z);

world.spawnEntityInWorld(gravelz);

}

 

if (jf==6) {

Entity gravel = EntityList.createEntityByID(50, world);

gravel.setPosition(x, y, z);

world.spawnEntityInWorld(gravel);

 

Entity gravelz = EntityList.createEntityByID(50, world);

gravelz.setPosition(x, y, z);

world.spawnEntityInWorld(gravelz);

world.spawnEntityInWorld(gravelz);

world.spawnEntityInWorld(gravelz);

world.spawnEntityInWorld(gravelz);

world.spawnEntityInWorld(gravelz);

}

 

if (jf==7) {

Entity EntityTNTPrimed = EntityList.createEntityByID(20, world);

EntityTNTPrimed.setPosition(x, y, z);

    world.spawnEntityInWorld(EntityTNTPrimed);

   

Entity EntityTNTPrimedz = EntityList.createEntityByID(20, world);

EntityTNTPrimedz.setPosition(x-3, y, z);

    world.spawnEntityInWorld(EntityTNTPrimedz);

   

Entity EntityTNTPrimedm = EntityList.createEntityByID(20, world);

EntityTNTPrimedm.setPosition(x+3, y, z);

    world.spawnEntityInWorld(EntityTNTPrimedm);

   

Entity EntityTNTPrimedz1 = EntityList.createEntityByID(20, world);

EntityTNTPrimedz1.setPosition(x, y, z-3);

    world.spawnEntityInWorld(EntityTNTPrimedz1);

   

Entity EntityTNTPrimedz2 = EntityList.createEntityByID(20, world);

EntityTNTPrimedz2.setPosition(x, y, z+3);

    world.spawnEntityInWorld(EntityTNTPrimedz2);

}

}

 

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.