use of de.Keyle.MyPet.api.entity.MyPetBukkitEntity in project MyPet by xXKeyleXx.
the class Thorns method reflectDamage.
public void reflectDamage(LivingEntity damager, double damage) {
if (myPet.getEntity().isPresent()) {
MyPetBukkitEntity entity = myPet.getEntity().get();
damager.damage(getReflectedDamage(damage), entity);
if (MyPetApi.getCompatUtil().compareWithMinecraftVersion("1.9") >= 0) {
entity.getHandle().makeSound("enchant.thorns.hit", 0.2F, 1.0F);
} else {
entity.getHandle().makeSound("damage.thorns", 0.5F, 1.0F);
}
MyPetApi.getPlatformHelper().playParticleEffect(entity.getLocation().add(0, 1, 0), "CRIT_MAGIC", 0.5F, 0.5F, 0.5F, 0.1F, 20, 20);
MyPetApi.getPlatformHelper().playParticleEffect(entity.getLocation().add(0, 1, 0), "CRIT", 0.5F, 0.5F, 0.5F, 0.1F, 10, 20);
}
}
Aggregations