13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
20 public const NETWORK_ID = ProtocolInfo::NPC_REQUEST_PACKET;
22 public const REQUEST_SET_ACTIONS = 0;
23 public const REQUEST_EXECUTE_ACTION = 1;
24 public const REQUEST_EXECUTE_CLOSING_COMMANDS = 2;
25 public const REQUEST_SET_NAME = 3;
26 public const REQUEST_SET_SKIN = 4;
27 public const REQUEST_SET_INTERACTION_TEXT = 5;
28 public const REQUEST_EXECUTE_OPENING_COMMANDS = 6;
30 public int $actorRuntimeId;
31 public int $requestType;
32 public string $commandString;
33 public int $actionIndex;
34 public string $sceneName;
39 public static function create(
int $actorRuntimeId,
int $requestType,
string $commandString,
int $actionIndex,
string $sceneName) : self{
41 $result->actorRuntimeId = $actorRuntimeId;
42 $result->requestType = $requestType;
43 $result->commandString = $commandString;
44 $result->actionIndex = $actionIndex;
45 $result->sceneName = $sceneName;
50 $this->actorRuntimeId = $in->getActorRuntimeId();
51 $this->requestType = $in->
getByte();
53 $this->actionIndex = $in->
getByte();
58 $out->putActorRuntimeId($this->actorRuntimeId);
59 $out->putByte($this->requestType);
60 $out->putString($this->commandString);
61 $out->putByte($this->actionIndex);
62 $out->putString($this->sceneName);
66 return $handler->handleNpcRequest($this);
handle(PacketHandlerInterface $handler)
encodePayload(PacketSerializer $out)
decodePayload(PacketSerializer $in)
static create(int $actorRuntimeId, int $requestType, string $commandString, int $actionIndex, string $sceneName)