13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
24 public const NETWORK_ID = ProtocolInfo::LEVEL_SOUND_EVENT_PACKET_V1;
28 public int $extraData = 0;
29 public int $entityType = 1;
30 public bool $isBabyMob =
false;
31 public bool $disableRelativeVolume =
false;
36 public static function create(
int $sound,
Vector3 $position,
int $extraData,
int $entityType,
bool $isBabyMob,
bool $disableRelativeVolume) : self{
38 $result->sound = $sound;
39 $result->position = $position;
40 $result->extraData = $extraData;
41 $result->entityType = $entityType;
42 $result->isBabyMob = $isBabyMob;
43 $result->disableRelativeVolume = $disableRelativeVolume;
48 $this->sound = $in->getByte();
52 $this->isBabyMob = $in->
getBool();
53 $this->disableRelativeVolume = $in->
getBool();
57 $out->putByte($this->sound);
61 $out->putBool($this->isBabyMob);
62 $out->putBool($this->disableRelativeVolume);
66 return $handler->handleLevelSoundEventPacketV1($this);
encodePayload(PacketSerializer $out)
handle(PacketHandlerInterface $handler)
decodePayload(PacketSerializer $in)
static create(int $sound, Vector3 $position, int $extraData, int $entityType, bool $isBabyMob, bool $disableRelativeVolume)
putVector3(Vector3 $vector)