mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-31 07:21:17 +00:00
Make weakness effect only applicable for melee damage (#6489)
This commit is contained in:
parent
b3b8aaddff
commit
8c04d47b1b
@ -57,7 +57,7 @@ class EntityDamageByEntityEvent extends EntityDamageEvent{
|
|||||||
$this->setModifier($this->getBaseDamage() * 0.3 * $strength->getEffectLevel(), self::MODIFIER_STRENGTH);
|
$this->setModifier($this->getBaseDamage() * 0.3 * $strength->getEffectLevel(), self::MODIFIER_STRENGTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(($weakness = $effects->get(VanillaEffects::WEAKNESS())) !== null){
|
if(($weakness = $effects->get(VanillaEffects::WEAKNESS())) !== null && $this->getCause() === EntityDamageEvent::CAUSE_ENTITY_ATTACK){
|
||||||
$this->setModifier(-($this->getBaseDamage() * 0.2 * $weakness->getEffectLevel()), self::MODIFIER_WEAKNESS);
|
$this->setModifier(-($this->getBaseDamage() * 0.2 * $weakness->getEffectLevel()), self::MODIFIER_WEAKNESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user