TransferNPC помогите

ошибка
[22:24:30] [Server thread/CRITICAL]: "Could not pass event ‘pocketmine\event\entity\EntityDamageByEntityEvent’ to ‘TransferNPC v1’: Undefined offset: 1 on TransferNPC\AnonymousPL
[22:24:30] [Server thread/CRITICAL]: ErrorException: “Undefined offset: 1” (EXCEPTION) in “plugins/TransferNPC/src/TransferNPC/AnonymousPL” at line 94

код

<?php

namespace TransferNPC;

use pocketmine\Server;
use pocketmine\Player;
use pocketmine\tile\Tile;
use pocketmine\item\Item;
use pocketmine\block\Block;
use pocketmine\utils\Config;
use pocketmine\math\Vector3;
use pocketmine\entity\Entity;
use pocketmine\event\Listener;
use pocketmine\plugin\PluginBase;
use pocketmine\event\player\PlayerChatEvent;
use pocketmine\event\player\PlayerQuitEvent;
use pocketmine\event\entity\EntityDamageEvent;
use pocketmine\event\entity\EntityDamageByEntityEvent;
use pocketmine\command\{CommandSender, Command};
use pocketmine\nbt\tag\{CompoundTag, IntTag, StringTag, DoubleTag, FloatTag, ListTag, ShortTag};

class AnonymousPL extends PluginBase implements Listener{

	public $mode = [];

	public function onEnable(){
		$this->getServer()->getPluginManager()->registerEvents($this, $this);
		@mkdir($this->getDataFolder());
  }

	public function onCommand(CommandSender $sender, Command $command, $label, array $args){
		if($command->getName() == "tnpc"){
			if(!$sender->isOp()){
				return $sender->sendMessage("§l§cНет прав!");
			}
			if(!isset($args[0])){
				return $sender->sendMessage("§l§cИспользование: /tnpc <create|remove>");
			}
			switch($args[0]){
				case "create":
					if(!isset($args[3])){
						$sender->sendMessage("§l§cИспользование: /tnpc create <размер> <ip:port>");
						break;
					}
					if(count(explode(":", $args[2])) < 2){
						$sender->sendMessage("§l§cНе верный формат адреса сервера. Используйте /tnpc create <размер> <ip:port>");
						break;
					}
					if(!is_numeric($args[1])){
						$sender->sendMessage("§l§cНе верный формат размера. Используйте /tnpc create <размер> <ip:port>");
						break;
					}
					array_shift($args);
					$this->setNpc($sender, $args);
				break;
				case "remove":
					$this->removeNPC($sender);
				break;
				default:
					$sender->sendMessage("§l§cИспользование: /tnpc <create|remove>");
				break;
			}
		}
	}

	public function removeNPC($player){
		$this->mode[$player->getName()] = "remove";
		$player->sendMessage("§l§fНажмине на §eNPC §fкоторую хотите удалить\n§l§eЧтобы отменить напишите \"§bcancel§e\" в чат");
	}

	public function onQuit(PlayerQuitEvent $ev){
		$player = $ev->getPlayer();
		if(isset($this->mode[$player->getName()])){
			unset($this->mode[$player->getName()]);
		}
	}

	public function onDamage(EntityDamageEvent $ev){
		$entity = $ev->getEntity();
		if(isset($entity->namedtag->Address)){
			$ev->setCancelled();
		}
		if($ev instanceof EntityDamageByEntityEvent){
			$damager = $ev->getDamager();
			if(isset($entity->namedtag->Address)){
				if($damager instanceof Player){
					if(isset($this->mode[$damager->getName()])){
						unset($this->mode[$damager->getName()]);
						$damager->sendMessage("§l§fВы §aуспешно §fудалили NPC для перехода на §e{$entity->namedtag->Address}");
						$entity->kill();
						$entity->close();
					}else{
						$address = explode(":", (string) $entity->namedtag->Address);
						$damager->transfer($address[0], $address[1]);
					}
				}
			}
		}
	}

	public function onChat(PlayerChatEvent $ev){
		$player = $ev->getPlayer();
		if($ev->getMessage() == "cancel" and isset($this->mode[$player->getName()])){
			$ev->setCancelled();
			unset($this->mode[$player->getName()]);
		}
	}

	public function setNpc($player, $settings){
		$size = array_shift($settings);
		$address = array_shift($settings);
		$nbt = new CompoundTag;
		$nbt->Pos = new ListTag("Pos", [
			new DoubleTag(0, $player->getX()),
			new DoubleTag(1, $player->getY()),
			new DoubleTag(2, $player->getZ())
		]);
		$nbt->Motion = new ListTag("Motion", [
			new DoubleTag(0, $player->getMotion()->x),
			new DoubleTag(1, $player->getMotion()->y),
			new DoubleTag(2, $player->getMotion()->z)
		]);
		$nbt->Rotation = new ListTag("Rotation", [
			new FloatTag(0, $player->getYaw()),
			new FloatTag(1, $player->getPitch())
		]);
		$nbt->Health = new ShortTag("Health", 1);
		$nbt->Address = new ShortTag("Address", $address);
		$player->saveNBT();
		$nbt->Skin = new CompoundTag("Skin", [
			"Data" => new StringTag("Data", $player->getSkinData()),
			"Name" => new StringTag("Name", $player->getSkinId())
		]);
		$entity = Entity::createEntity("Human", $player->getLevel(), $nbt);
		$entity->setNameTag("     §6РЕЖИМ  АНАРХИЯ\n§7ТАПНИ ЧТОБЫ ПРИСОЕДИНИТСЯ\n");
		$entity->setNameTagVisible(true);
		$entity->setNameTagAlwaysVisible(true);
		$entity->setScale($size);
		$entity->spawnToAll();
		$player->sendMessage("§l§fСтатуя для перехода на сервер §e{$address}§f, §aуспешно §fустановленна!");
	}
}

?>

как исправить ошибку?

Для начала кинуть плагин

TransferNPC.zip (3,9 КБ)

На не ной