Нужна помощь! Как сделать что бы при получении дамага, хил слетал?
@SubscribeEvent
public void removePotionEffectRegeneration(LivingHurtEvent event) {
if (event.source instanceof EntityDamageSource) {
EntityDamageSource dmgSource = (EntityDamageSource)event.source;
Entity from = dmgSource.getEntity();
EntityLivingBase to = event.entityLiving;
if (to.getActivePotionEffect(Potion.regeneration) != null) {
to.removePotionEffect(Potion.regeneration.id);
}
}
}
Пробовал так, но не работает
@SubscribeEvent
public void removePotionEffectRegeneration(LivingHurtEvent event) {
if (event.source instanceof EntityDamageSource) {
EntityDamageSource dmgSource = (EntityDamageSource)event.source;
Entity from = dmgSource.getEntity();
EntityLivingBase to = event.entityLiving;
if (to.getActivePotionEffect(Potion.regeneration) != null) {
to.removePotionEffect(Potion.regeneration.id);
}
}
}
Пробовал так, но не работает



