gigimoi Posted July 12, 2013 Posted July 12, 2013 Is there any way to cause damage to an entity without making it temporarily invulnerable? Quote
gigimoi Posted July 12, 2013 Author Posted July 12, 2013 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; Quote
Recommended Posts
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.