Posted December 26, 20168 yr I'm having a problem with some custom chickens, for some reason, even when I override the onLivingUpdate method that is where Chickens lay the eggs and place my method to spawn XP Orbs, they still laying eggs. Any idea what can be causing this to happen? Thanks a lot. @Override public void onLivingUpdate() { super.onLivingUpdate(); this.oFlap = this.wingRotation; this.oFlapSpeed = this.destPos; this.destPos = (float)((double)this.destPos + (double)(this.onGround ? -1 : 4) * 0.3D); this.destPos = MathHelper.clamp_float(this.destPos, 0.0F, 1.0F); if (!this.onGround && this.wingRotDelta < 1.0F) { this.wingRotDelta = 1.0F; } this.wingRotDelta = (float)((double)this.wingRotDelta * 0.9D); if (!this.onGround && this.motionY < 0.0D) { this.motionY *= 0.6D; } this.wingRotation += this.wingRotDelta * 2.0F; if (!this.worldObj.isRemote && !this.isChild() && --this.timeUntilNextEgg <= 0) { //SPAWN XP HERE EntityXPOrb xporb = new EntityXPOrb(this.worldObj, this.getPosition().getX()+0.5, this.getPosition().getY()+0.5, this.getPosition().getZ()+0.5, 1); this.worldObj.spawnEntityInWorld(xporb); this.timeUntilNextEgg = this.rand.nextInt(10) + 10; } }
December 26, 20168 yr You are calling super.onLivingUpdate() , so it's doing the regular chicken update as well as your custom one.
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.