Posted March 29, 201312 yr I am making a mod just now and I'm stuck at one line of code. Basically I want my mob to explode if it is in combat and its health <10 I thought something like: public void onUpdate() If {entity.health>20 then { boolean flag = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"); this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, (float)(this.explosionRadius * 5), flag);
March 29, 201312 yr Author Also, my java knowledge is still not perfect. I occasionally keep using BASIC language instead. lol!
March 29, 201312 yr Author Sorry for all the extra posts: I believe that code is wrong as I do not have explosion radius set up. I grabbed some of the from the creeper properties.
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.