use of com.bergerkiller.generated.net.minecraft.server.DamageSourceHandle in project BKCommonLib by bergerhealer.
the class CommonMethods method damageBy.
public static void damageBy(org.bukkit.entity.Entity entity, org.bukkit.entity.Entity damager, double damage) {
DamageSourceHandle source;
if (damager instanceof Player) {
source = DamageSourceHandle.playerAttack((HumanEntity) damager);
} else if (damager instanceof LivingEntity) {
source = DamageSourceHandle.mobAttack((LivingEntity) damager);
} else {
source = DamageSourceHandle.byName("generic");
}
CommonNMS.getHandle(entity).damageEntity(source, (float) damage);
}
Aggregations