Posted February 14, 201510 yr 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); } } }
February 14, 201510 yr which command do you want to execute? maybe you could copy the code of that command.
February 14, 201510 yr MinecraftServer.getServer().getCommandManager().executeCommand(player, command); Maker of the Craft++ mod.
February 14, 201510 yr Author @anon What is the player param... How do I make it work as a string, because it wants me to change it to ICommandSender
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.