Posted July 12, 201312 yr Is there any way to cause damage to an entity without making it temporarily invulnerable?
July 12, 201312 yr Author Resolved: protected void onImpact(MovingObjectPosition movingobjectposition) { if (movingobjectposition.entityHit != null && movingobjectposition.entityHit instanceof EntityLivingBase) { movingobjectposition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), Damage); ((EntityLivingBase)movingobjectposition.entityHit).hurtResistantTime = 0; ((EntityLivingBase)movingobjectposition.entityHit).hurtTime = 1; } this.setDead(); } ((EntityLivingBase)movingobjectposition.entityHit).hurtResistantTime = 0; ((EntityLivingBase)movingobjectposition.entityHit).hurtTime = 1;
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.