I am trying to add a creative mode into the script so you can destroy it without respawning in creative mode but cannot get it to work.
public void breakBlock(World world, int x, int y, int z, Block block, EntityPlayer player, int meta )
{
//Using random ints in the drops may cause a crash. Set amounts don't.
//Loops through all drops.
for(int i = 0; i < block.getDrops(world, x, y, z, meta, 0).size(); i++){
//Breaks the loop if i == size.
if(i == block.getDrops(world, x, y, z, meta, 0).size()){
break;
}
//Spawns the drops into the world.
world.spawnEntityInWorld(new EntityItem(world, x, y, z, block.getDrops(world, x, y, z, meta, 0).get(i)));
}
if (!player.capabilities.isCreativeMode && (meta & != 0 && world.getBlock(x, y - 1, z) == this)
{
world.setBlock(x, y, z, this);
}
this is what i have ...