13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
20 public const NETWORK_ID = ProtocolInfo::COMPLETED_USING_ITEM_PACKET;
22 public const ACTION_UNKNOWN = -1;
23 public const ACTION_EQUIP_ARMOR = 0;
24 public const ACTION_EAT = 1;
25 public const ACTION_ATTACK = 2;
26 public const ACTION_CONSUME = 3;
27 public const ACTION_THROW = 4;
28 public const ACTION_SHOOT = 5;
29 public const ACTION_PLACE = 6;
30 public const ACTION_FILL_BOTTLE = 7;
31 public const ACTION_FILL_BUCKET = 8;
32 public const ACTION_POUR_BUCKET = 9;
33 public const ACTION_USE_TOOL = 10;
34 public const ACTION_INTERACT = 11;
35 public const ACTION_RETRIEVED = 12;
36 public const ACTION_DYED = 13;
37 public const ACTION_TRADED = 14;
38 public const ACTION_BRUSHING_COMPLETED = 15;
46 public static function create(
int $itemId,
int $action) : self{
48 $result->itemId = $itemId;
49 $result->action = $action;
54 $this->itemId = $in->getShort();
59 $out->putShort($this->itemId);
60 $out->putLInt($this->action);
64 return $handler->handleCompletedUsingItem($this);
decodePayload(PacketSerializer $in)
handle(PacketHandlerInterface $handler)
encodePayload(PacketSerializer $out)
static create(int $itemId, int $action)