[SPIGOT-2030] Damageable.damage(0) does nothing Created: 22/Mar/16  Updated: 26/Mar/16  Resolved: 22/Mar/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: ImAFlyingPancake Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: animation, damage


 Description   

Calling Damageable.damage(0) doesn't play the damage animation anymore.

Temporary workaround :

damageable.damage(0.0000000000000000000001);

//Or

double zeroDamage = 0.0000000000000000000001;
damageable.damage(zeroDamage);
damageable.setHealth(player.getHealth() + zeroDamage);


 Comments   
Comment by Sycholic [ 26/Mar/16 ]

what about the fishing rods also? they do zero dmg but are intended to agro what it hits.

Comment by md_5 [ 24/Mar/16 ]

There is another open bug for snowballs.

Comment by connection_lost [ 24/Mar/16 ]

@md_5
Just tested on a server with no plugins: I tried throwing snowballs to pig, zombie, sheep, other mobs and myself, and nothing happens. No knockback, no hit sound, no hit animation.

I also checked the damage value by using this...

public void onEntityDamageBySnowball(EntityDamageByEntityEvent event){
	if (event.getDamager() instanceof Snowball){
		Bukkit.broadcastMessage("Damage: " + event.getDamage());
	}
}

Which will always show "Damage: 0.0"

This issue should be re-opened.

Comment by md_5 [ 23/Mar/16 ]

Test it?

Comment by connection_lost [ 23/Mar/16 ]

Will this potentially break other mechanics such as snowball's damage = 0?

Comment by md_5 [ 22/Mar/16 ]

Entity is not being damaged, this is logical.

Comment by ImAFlyingPancake [ 22/Mar/16 ]

So if you use setDamage(0) in a damage related event, nothing will happen. The entity will not even be pushed back.

Generated at Tue Apr 08 03:01:10 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.