getBlockLightAt always returns Level 15 (when night, when day and etc). setBlockLightAt doesn't work. I have problems with these functions in all cases (in minecraft pe and in BigBrother). In details I wanted set Block light when a player touches on it. So, I apologize for my bad language. PHP: /** * Gets the raw block light level * * @param int $x * @param int $y * @param int $z * * @return int 0-15 */ public function getBlockLightAt($x, $y, $z){ return $this->getChunkAt($x >> 4, $z >> 4, true)->getBlockLight($x & 0x0f, $y & 0x7f, $z & 0x0f); } PHP: /** * Sets the raw block light level. * * @param int $x * @param int $y * @param int $z * @param int $level 0-15 */ public function setBlockLightAt($x, $y, $z, $level){ $this->getChunkAt($x >> 4, $z >> 4, true)->setBlockLight($x & 0x0f, $y & 0x7f, $z & 0x0f, $level & 0x0f); }
Look here: http://docs.pocketmine.net/d3/d4b/classpocketmine_1_1level_1_1_level.html http://docs.pocketmine.net/d7/d6b/_level_8php_source.html#l01648 If it doesnt work, try getLightLevel() to get the light level. You have to get the light level this way:$this->getBlockLightAt($x, $y, $z) To set the light level: $this->setBlockLightAt($x, $y, $z, $level) Maybe you tried to add $level on getBlockLightAt()