/** * @param Vector3 $v * @param mixed $data * @param int $id * @param FullChunk $chunk */ public function __construct($v, $data, $id = -2, $chunk = null) { $this->data = $data; if (!$v instanceof Vector3) { if ($v instanceof FullChunk) { $v->removeEntity($this); } throw new \RuntimeException("BadConstructCustomHuman"); } $nbt = new Compound(); $nbt->Pos = new Enum("Motion", [new Double(0, $v->x), new Double(1, $v->y), new Double(2, $v->z)]); $nbt->Motion = new Enum("Motion", [new Double(0, 0), new Double(1, 0), new Double(2, 0)]); $nbt->Rotation = new Enum("Rotation", [new Float(0, $this->getDefaultYaw()), new Float(1, $this->getDefaultPitch())]); $nbt->FallDistance = new Float("FallDistance", 0); $nbt->Fire = new Short("Fire", 0); $nbt->Air = new Short("Air", 0); $nbt->OnGround = new Byte("OnGround", 1); $nbt->Invulnerable = new Byte("Invulnerable", 1); $nbt->Health = new Short("Health", 20); $nbt->NameTag = $this->getDefaultName(); $nbt->Inventory = new Enum("Inventory", []); $nbt->Inventory->setTagType(NBT::TAG_Compound); $this->inventory = new PlayerInventory($this); $this->setSkin($this->getDefaultSkin()); parent::__construct($chunk, $nbt); }