mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
creepers will explode if they are in 3 block radius from the player
This commit is contained in:
parent
72a1a93283
commit
e28498c4c2
2 changed files with 4 additions and 2 deletions
|
|
@ -30,7 +30,9 @@ class TaskAttackPlayer extends TaskBase
|
|||
|
||||
--$this->attackCounter;
|
||||
$v1 = $ai->entity->width * $ai->entity->width * 4;
|
||||
|
||||
if($ai->entity instanceof Creeper){
|
||||
$v1 = 9;
|
||||
}
|
||||
$e = $ai->entity;
|
||||
$t = $e->target;
|
||||
$xDiff = ($t->x - $e->x);
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class Creeper extends Monster{
|
|||
}
|
||||
|
||||
public function attackEntity($entity, $distance){
|
||||
if(Utils::distance_noroot($entity, $this) <= 49 && !$this->isIgnited()){
|
||||
if(Utils::distance_noroot($entity, $this) <= 49 && !$this->isIgnited() && $this->ai->canSee($entity)){
|
||||
$this->ignite();
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue