Posted July 10, 201312 yr Hello all! Before updating, I had my mob call an event when its health reached a certain point. However, "this.gethealth();" and "this.getMaxhealth();" are no longer useable. My question is, how do I recreate this functionality in 1.6.2? Here is my entity class, and thank you in advance! EntityRiot_Zombie: http://pastebin.com/4K69nMyL Thanks to everyone who helps, and sorry if this is a bit noobish. --Tenyar97 I am the creator of "The Breakfast Mod". http://cache.gyazo.com/9f747cb0c5979bafb79bcd28e86c0f5b.png[/img]
July 11, 201312 yr Author Can nobody help me? I am the creator of "The Breakfast Mod". http://cache.gyazo.com/9f747cb0c5979bafb79bcd28e86c0f5b.png[/img]
July 11, 201312 yr I haven't looked at your block yet, but I believe these are the functions you want for your mob. func_110143_aJ() should replace gethealth() func_110138_aP() should be getMaxhealth() EDIT: Fixed your block, the dispenser face uses the block icon name, there is two places to easily fix this. when you set up your block make sure you have .func_111022_d("dispenser") example: dispenser = (new Dispenser(2000)).setHardness(3.5F).setStepSound(soundStoneFootstep).setUnlocalizedName("dispenser").func_111022_d("dispenser"); or add it here: protected Dispenser(int par1) { super(par1); func_111022_d("dispenser"); this.setCreativeTab(null); }
July 11, 201312 yr Author Thank you! My dispenser works properly now. However, the functions you gave me don't seem to be doing anything. Below is my new code public boolean attackEntityFrom(DamageSource par1DamageSource, int par2) { if (par1DamageSource.isFireDamage()) { par2 = 0; } if (super.attackEntityFrom(par1DamageSource, par2)) { if (par1DamageSource.getEntity() != null) { Entity par1Entity = par1DamageSource.getEntity(); int j = 0; if (par1Entity instanceof EntityLiving) { j += EnchantmentHelper.getKnockbackModifier((EntityLiving) par1Entity, this); if (j > 0) { this.motionX /= 0.6D; this.motionZ /= 0.6D; this.addVelocity((double) (MathHelper.sin(par1Entity.rotationYaw * (float) Math.PI / 180.0F) * (float) j * 0.5F), -0.1D, (double) (-MathHelper.cos(par1Entity.rotationYaw * (float) Math.PI / 180.0F) * (float) j * 0.5F)); } } } if (this.func_110143_aJ() < this.func_110138_aP() * 0.75) { stage++; System.out.println("Stage advanced!"); } else if (stage == 1 && this.func_110143_aJ() < this.func_110138_aP() * 0.5) { stage++; System.out.println("Stage advanced, again!"); } else if (stage == 2 && this.func_110143_aJ() < this.func_110138_aP() * 0.25) { stage++; } return true; } return false; } I have a feeling that it is my fault, and the health values are messed up, because I'm not familiar with this new system, but before I get myself anymore confused, I'm asking. Thanks! I am the creator of "The Breakfast Mod". http://cache.gyazo.com/9f747cb0c5979bafb79bcd28e86c0f5b.png[/img]
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.