xpLevel = $xpLevel; } /** * @return int */ public function getXpLevel() : int{ return $this->xpLevel; } public function encode(?Vector3 $pos){ //No idea why such odd numbers, but this works... //TODO: check arbitrary volume return LevelSoundEventPacket::create(LevelSoundEventPacket::SOUND_LEVELUP, $pos, 0x10000000 * intdiv(min(30, $this->xpLevel), 5)); } }