EntityDamageEvent: Add API to customize Living entity attack cooldown time

closes #2310
This commit is contained in:
왕고슴도치
2018-07-16 09:29:17 +00:00
committed by Dylan K. Taylor
parent f582b5a3db
commit 47cd6fe105
2 changed files with 24 additions and 1 deletions

View File

@ -560,7 +560,7 @@ abstract class Living extends Entity implements Damageable{
return;
}
$this->attackTime = 10; //0.5 seconds cooldown
$this->attackTime = $source->getAttackCooldown();
if($source instanceof EntityDamageByEntityEvent){
$e = $source->getDamager();