I have this AI plugin but when I var_dump() the player object, it is blank. Code: object(core\NexusPlayer)#113620 (0) { } This happens when I attempt to attack my target. PHP: $event = new EntityDamageByEntityEvent($this, $target, EntityDamageEvent::CAUSE_ENTITY_ATTACK, $this->getBaseAttackDamage());$target->attack($event); This is how I find my targets. PHP: $distance = 15;$target = null;foreach($this->getLevel()->getPlayers() as $player) { if($player instanceof self) { continue; } if($player instanceof NexusPlayer and $player->distance($this) <= $distance) { $distance = $player->distance($this); $target = $player; }}$this->target = ($target != null ? $target : null); The error I got. Code: [03:04:40] [Server thread/CRITICAL]: Error: "Call to a member function getContents() on null" (EXCEPTION) in "src/pocketmine/entity/Living" at line 423 [03:04:40] [Server thread/DEBUG]: #0 src/pocketmine/entity/Living(466): pocketmine\entity\Living->getArmorPoints() [03:04:40] [Server thread/DEBUG]: #1 src/pocketmine/entity/Human(764): pocketmine\entity\Living->applyDamageModifiers(object pocketmine\event\entity\EntityDamageByEntityEvent) [03:04:40] [Server thread/DEBUG]: #2 src/pocketmine/entity/Living(562): pocketmine\entity\Human->applyDamageModifiers(object pocketmine\event\entity\EntityDamageByEntityEvent) [03:04:40] [Server thread/DEBUG]: #3 src/pocketmine/Player(3737): pocketmine\entity\Living->attack(object pocketmine\event\entity\EntityDamageByEntityEvent) [03:04:40] [Server thread/DEBUG]: #4 plugins/NexusPE/src/core/combat/boss/Boss(173): pocketmine\Player->attack(object pocketmine\event\entity\EntityDamageByEntityEvent) [03:04:40] [Server thread/DEBUG]: #5 plugins/NexusPE/src/core/combat/boss/Boss(84): core\combat\boss\Boss->attackTarget()
You armorInventory appears to be null, have you tried calling the initEntity() method of the entity object?