mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
creepers will explode if they will come close to player(do not remind me of animation bug, pretty sure it is unfixable
This commit is contained in:
parent
bae0d4618e
commit
f4569d6edf
3 changed files with 15 additions and 2 deletions
|
|
@ -29,7 +29,8 @@ class TaskAttackPlayer extends TaskTempt
|
|||
{
|
||||
$target = $this->findTarget($ai->entity, 10);
|
||||
if($target instanceof Entity && $target->class === ENTITY_PLAYER && $target->isPlayer()){
|
||||
$this->target = $target;
|
||||
$this->target = $target; //TODO get rid of it
|
||||
$ai->entity->target = $target;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class TaskTempt extends TaskBase
|
|||
public function onEnd(EntityAI $ai)
|
||||
{
|
||||
unset($this->target);
|
||||
unset($ai->entity->target);
|
||||
$ai->entity->pitch = 0;
|
||||
}
|
||||
|
||||
|
|
@ -34,6 +35,7 @@ class TaskTempt extends TaskBase
|
|||
$target = $this->findTarget($ai->entity, 10);
|
||||
if($target instanceof Entity && $target->class === ENTITY_PLAYER && $target->isPlayer() && $ai->entity->isFood($target->player->getHeldItem()->getID())){
|
||||
$this->target = $target;
|
||||
$ai->entity->target = $target;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue