I'm trying to make a strobe light block that changes the block (like a furnace).
I need it to start flashing when you shift-right click
The first change works, but it doesn't continue.
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9){
if (!world.isRemote){
while(world.getBlock(x,y,z) == StrobeLights.StrobeLightBlue || world.getBlock(x,y,z) == StrobeLights.StrobeLightBlueOn){
if(world.getBlock(x, y, z) == StrobeLights.StrobeLightBlue){
world.setBlock(x,y,z, StrobeLights.StrobeLightBlueOn);
}else if(world.getBlock(x, y, z) == StrobeLights.StrobeLightBlueOn){
world.setBlock(x, y, z, StrobeLights.StrobeLightBlue);
return true;
}
return false;
}
return false;
}
return false;
Any suggestions?