diff --git a/src/entity/ai/tasks/TaskAttackPlayer.php b/src/entity/ai/tasks/TaskAttackPlayer.php index 13a89e02..c0e48054 100644 --- a/src/entity/ai/tasks/TaskAttackPlayer.php +++ b/src/entity/ai/tasks/TaskAttackPlayer.php @@ -11,7 +11,7 @@ class TaskAttackPlayer extends TaskTempt } public function onUpdate(EntityAI $ai) { - if(($ai->entity instanceof Spider && $ai->entity->level->isDay()) || ($this->target instanceof Entity && !$this->target->isPlayer()) || $this->target->distanceSquared($ai->entity) > 100 || $this->target->level->getName() != $ai->entity->level->getName()){ + if(!($this->target instanceof Entity) ($ai->entity instanceof Spider && $ai->entity->level->isDay()) || ($this->target instanceof Entity && !$this->target->isPlayer()) || $this->target->distanceSquared($ai->entity) > 100 || $this->target->level->getName() != $ai->entity->level->getName()){ $this->reset(); return; } diff --git a/src/material/block/plant/CarrotBlock.php b/src/material/block/plant/CarrotBlock.php index 95bc3452..5e407666 100644 --- a/src/material/block/plant/CarrotBlock.php +++ b/src/material/block/plant/CarrotBlock.php @@ -56,7 +56,7 @@ class CarrotBlock extends FlowableBlock{ public function getDrops(Item $item, Player $player){ $drops = array(); if($this->meta >= 0x07){ - $drops[] = array(CARROT, 0, mt_rand(1)); + $drops[] = array(CARROT, 0, mt_rand(1, 4)); } for($i = 0; $i < 3; ++$i){ if(mt_rand(0,15) <= $this->meta){ //a way from 1.4.7