Damaging Mobs

So, right now I’m damaging entities like so:

        entities.stream().filter(entity -> entity.supports(HealthData.class)).forEach(entity -> {
            entity.offer(Keys.HEALTH, entity.get(Keys.HEALTH).get() - this.damage);
        });
    }```

However, the 'damaged' animation does not play. I notice the Entity#damage method, but it does not appear to be implemented. Is there a way to display the animation or get the method implemented?

You have to use Entity.damage(). I posted an issue for implementing it.

thanks, now to wait about a day… xD
Sponge is really awesome though.

1 Like