use pocketmine\network\mcpe\NetworkSession; use function file_get_contents; class AvailableActorIdentifiersPacket extends DataPacket{ public const NETWORK_ID = ProtocolInfo::AVAILABLE_ACTOR_IDENTIFIERS_PACKET; /** @var string|null */ private static $DEFAULT_NBT_CACHE = null; /** @var string */ public $namedtag; protected function decodePayload(){ $this->namedtag = $this->getRemaining(); } protected function encodePayload(){ $this->put( $this->namedtag ?? self::$DEFAULT_NBT_CACHE ?? (self::$DEFAULT_NBT_CACHE = file_get_contents(\pocketmine\RESOURCE_PATH . '/vanilla/entity_identifiers.nbt')) ); } public function handle(NetworkSession $session) : bool{ return $session->handleAvailableActorIdentifiers($this); } }