hi guys i have a chiar plugin but when i try to sit i see this error Code: 15:15:32 CRITICAL > Could not pass event 'pocketmine\event\player\PlayerInteractEvent' to 'MmsCore v1.0.1': Argument 1 passed to pocketmine\network\mcpe\NetworkBinaryStream::putEntityUniqueId() must be of the type integer, null given, called in C:\Users\Administrator\Desktop\Mine_Pelx\src\pocketmine\network\mcpe\NetworkBinaryStream.php on line 486 on MmsCore\MainIR 15:15:32 CRITICAL > TypeError: "Argument 1 passed to pocketmine\network\mcpe\NetworkBinaryStream::putEntityUniqueId() must be of the type integer, null given, called in C:\Users\Administrator\Desktop\Mine_Pelx\src\pocketmine\network\mcpe\NetworkBinaryStream.php on line 486" (EXCEPTION) in "src/pocketmine/network/mcpe/NetworkBinaryStream" at line 287 how can i fix ?? help me plz i need it if U have a chair plugin give me plz
From what I can see, this plugin is catered for the latest DEVELOPMENT release of PocketMine. (4.0.0) This is not recommended. It is also not recommended to use plugins that are not off poggit, as there could be a chance that there is malicious code, or broken code. Stay with Update 3.0.x for now.
this is code Code: <?php declare(strict_types=1); namespace MmsCore; use pocketmine\Server; use pocketmine\Player; use pocketmine\entity\Entity; use pocketmine\entity\Zombie as FakeRidingEntity; use pocketmine\level\Level; use pocketmine\level\Position; use pocketmine\network\mcpe\protocol\AddEntityPacket; use pocketmine\network\mcpe\protocol\SetEntityLinkPacket; use pocketmine\network\mcpe\protocol\RemoveEntityPacket; use pocketmine\network\mcpe\protocol\types\EntityLink; use pocketmine\math\Vector3; class Chair extends Position{ private $id; private $entity; public function __construct(Entity $entity, $x, $y, $z, Level $level){ parent::__construct($x, $y, $z, $level); $this->entity = $entity; $this->id = Entity::$entityCount++; } public function getId(){ return $this->id; } public function getEntity(){ return $this->entity; } public function spawnTo(Player $player){ $pk = new AddEntityPacket(); $pk->entityRuntimeId = $this->id; $pk->motion = new Vector3(0, 0, 0); $pk->position = $this->asVector3()->add(0.5, 1.8, 0.5); $pk->type = FakeRidingEntity::NETWORK_ID; $flags = 1 << Entity::DATA_FLAG_INVISIBLE; $flags ^= 1 << Entity::DATA_FLAG_NO_AI; $flags ^= 1 << Entity::DATA_FLAG_CAN_SHOW_NAMETAG; $flags ^= 1 << Entity::DATA_FLAG_ALWAYS_SHOW_NAMETAG; $pk->metadata = [ Entity::DATA_FLAGS => [Entity::DATA_TYPE_LONG, $flags] ]; $player->dataPacket($pk); $pk = new SetEntityLinkPacket(); $pk->link = new EntityLink(); $pk->link->fromEntityUniqueId = $this->id; $pk->link->toEntityUniqueId = $this->entity->getId(); $pk->link->type = 0b01; $pk->link->bool1 = true; $player->dataPacket($pk); $player->sendTip(" \n "); $player->sendPopup("§aNeshasti"); //$this->entity->setGenericFlag(Entity::DATA_FLAG_NO_AI, true); } public function spawnToAll(){ foreach($this->level->getPlayers() as $player){ $this->spawnTo($player); } } public function despawnFrom(Player $player){ if($player === $this->entity){ //$this->entity->setGenericFlag(Entity::DATA_FLAG_NO_AI, false); } $pk = new RemoveEntityPacket(); $pk->entityUniqueId = $this->id; $player->dataPacket($pk); } public function despawnFromAll(){ foreach($this->level->getPlayers() as $player){ $this->despawnFrom($player); } } }
From what I can see, this plugin is catered for the latest DEVELOPMENT release of PocketMine. (4.0.0) This is not recommended. It is also not recommended to use plugins that are not off poggit, as there could be a chance that there is malicious code, or broken code. Stay with Update 3.0.x for now.
this is not a plugin help forum this is development forum which is for people to talk on how to make plugins