Created
September 10, 2015 01:03
-
-
Save TheXFactor117/ff2f23833e49fce16590 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//used to cool down the mummy spawning | |
public int coolDown = 100; | |
public int count = 0; | |
/** | |
* Updates every tick the Pharoah is alive. Once the cool | |
* down has finished, the Pharoah will spawn a mummy at | |
* its coordinates. The cool down then resets, and will | |
* tick down again and repeat. | |
*/ | |
@Override | |
public void onLivingUpdate() | |
{ | |
super.onLivingUpdate(); | |
if (coolDown > 0) | |
{ | |
this.coolDown = coolDown - 1; | |
} | |
if (count > 1) | |
{ | |
this.count = count - 1; | |
} | |
if ((coolDown < 2) && (!this.worldObj.isRemote)) | |
{ | |
this.count = 60; | |
this.coolDown = 200; | |
} | |
if ((count == 1) && (!this.worldObj.isRemote)) | |
{ | |
EntityMummy mummy = new EntityMummy(this.worldObj); | |
//spawns the Mummy at the Pharaoh's coordinates | |
mummy.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rand.nextFloat() * 360, 0.0F); | |
this.worldObj.spawnEntityInWorld(mummy); | |
LogHelper.info("The Pharaoh has summoned a mummy!"); | |
this.count = 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment