World
Implements ChunkManager
Constants
DEFAULT_SIMULATION_DISTANCE 5.46.0
public const DEFAULT_SIMULATION_DISTANCE = 4Bedrock Dedicated Server's default simulation distance (server.properties tick-distance=4).
DEFAULT_TICKED_BLOCKS_PER_SUBCHUNK_PER_TICK
public const DEFAULT_TICKED_BLOCKS_PER_SUBCHUNK_PER_TICK = 3DIFFICULTY_EASY
public const DIFFICULTY_EASY = 1DIFFICULTY_HARD
public const DIFFICULTY_HARD = 3DIFFICULTY_NORMAL
public const DIFFICULTY_NORMAL = 2DIFFICULTY_PEACEFUL
public const DIFFICULTY_PEACEFUL = 0TIME_DAY
public const TIME_DAY = 1000TIME_FULL
public const TIME_FULL = 24000TIME_MIDNIGHT
public const TIME_MIDNIGHT = 18000TIME_NIGHT
public const TIME_NIGHT = 13000TIME_NOON
public const TIME_NOON = 6000TIME_SUNRISE
public const TIME_SUNRISE = 23000TIME_SUNSET
public const TIME_SUNSET = 12000Y_MAX
public const Y_MAX = 320Y_MIN
public const Y_MIN = -64Properties
$stopTime
public bool $stopTime$tickRateTime
public float $tickRateTime$timings
public \pocketmine\world\WorldTimings $timings$updateEntities
public array $updateEntitiesMethods
__construct()
public function __construct(\pocketmine\Server $server, string $name, \pocketmine\world\format\io\WritableWorldProvider $provider, \pocketmine\scheduler\AsyncPool $workerPool, \pocketmine\world\dimension\Dimension $dimension = \pocketmine\world\dimension\Dimension::OVERWORLD)Init the default world data
__debugInfo()
public function __debugInfo() : arrayactuallyDoTick() protected
protected function actuallyDoTick(int $currentTick) : voidaddEntity()
public function addEntity(\pocketmine\entity\Entity $entity) : voidaddGameEvent() 5.46.0
public function addGameEvent(\pocketmine\math\Vector3 $pos, \pocketmine\world\vibration\GameEvent $event, ?\pocketmine\entity\Entity $source = null, ?\pocketmine\block\Block $affected = null) : voidEmits a vibration (game event) that sculk sensors around the given position can detect.
addOnUnloadCallback()
public function addOnUnloadCallback(\Closure $callback) : voidaddParticle()
public function addParticle(\pocketmine\math\Vector3 $pos, \pocketmine\world\particle\Particle $particle, ?array $players = null) : voidaddRandomTickedBlock()
public function addRandomTickedBlock(\pocketmine\block\Block $block) : voidaddSound()
public function addSound(\pocketmine\math\Vector3 $pos, \pocketmine\world\sound\Sound $sound, ?array $players = null) : voidblockHash()
public static function blockHash(int $x, int $y, int $z) : intbroadcastPacketToViewers()
public function broadcastPacketToViewers(\pocketmine\math\Vector3 $pos, \pocketmine\network\mcpe\protocol\ClientboundPacket $packet) : voidBroadcasts a packet to every player who has the target position within their view distance.
cancelUnloadChunkRequest()
public function cancelUnloadChunkRequest(int $x, int $z) : voidcheckSleep()
public function checkSleep() : voidchunkBlockHash()
public static function chunkBlockHash(int $x, int $y, int $z) : intComputes a small index relative to chunk base from the given coordinates.
chunkHash()
public static function chunkHash(int $x, int $z) : intclearCache()
public function clearCache(bool $force = false) : voidcomputeSkyLightReduction()
public function computeSkyLightReduction() : intComputes how many points of sky light is subtracted based on the current time. Used to offset raw chunk sky light to get a real light value.
computeSunAnglePercentage()
public function computeSunAnglePercentage() : floatComputes the percentage of a circle away from noon the sun is currently at. This can be multiplied by 2 * M_PI to get an angle in radians, or by 360 to get an angle in degrees.
createBlockUpdatePackets()
public function createBlockUpdatePackets(array $blocks) : arraydoChunkGarbageCollection()
public function doChunkGarbageCollection() : voiddropExperience()
public function dropExperience(\pocketmine\math\Vector3 $pos, int $amount) : arrayDrops XP orbs into the world for the specified amount, splitting the amount into several orbs if necessary.
dropItem()
public function dropItem(\pocketmine\math\Vector3 $source, \pocketmine\item\Item $item, ?\pocketmine\math\Vector3 $motion = null, int $delay = 10) : ?\pocketmine\entity\object\ItemEntitygetAdjacentChunks()
public function getAdjacentChunks(int $x, int $z) : arrayReturns the chunks adjacent to the specified chunk.
getAutoSave()
public function getAutoSave() : boolgetBiome()
public function getBiome(int $x, int $y, int $z) : \pocketmine\world\biome\BiomegetBiomeId()
public function getBiomeId(int $x, int $y, int $z) : intgetBlock()
public function getBlock(\pocketmine\math\Vector3 $pos, bool $cached = true, bool $addToCache = true) : \pocketmine\block\BlockGets the Block object at the Vector3 location. This method wraps around getBlockAt, converting the vector components to integers.
Note: If you're using this for performance-sensitive code, and you're guaranteed to be supplying ints in the specified vector, consider using getBlockAt instead for better performance.
getBlockAt()
public function getBlockAt(int $x, int $y, int $z, bool $cached = true, bool $addToCache = true) : \pocketmine\block\BlockGets the Block object at the specified coordinates.
Note for plugin developers: If you are using this method a lot (thousands of times for many positions for example), you may want to set addToCache to false to avoid using excessive amounts of memory.
getBlockCollisionBoxes()
public function getBlockCollisionBoxes(\pocketmine\math\AxisAlignedBB $bb) : arraygetBlockLightAt()
public function getBlockLightAt(int $x, int $y, int $z) : intGets the raw block light level
getBlockPower() 5.46.0
public function getBlockPower(\pocketmine\math\Vector3 $pos) : intReturns the highest redstone power (0-15) received by the block at the given position. Always 0 if redstone is disabled.
getBlockXYZ()
public static function getBlockXYZ(int $hash, ?int &$x, ?int &$y, ?int &$z) : voidgetChunk()
public function getChunk(int $chunkX, int $chunkZ) : ?\pocketmine\world\format\ChunkgetChunkEntities()
public function getChunkEntities(int $chunkX, int $chunkZ) : arraygetChunkListeners()
public function getChunkListeners(int $chunkX, int $chunkZ) : arrayReturns all the listeners attached to this chunk.
getChunkLoaders()
public function getChunkLoaders(int $chunkX, int $chunkZ) : arrayGets the chunk loaders being used in a specific chunk
getChunkPlayers()
public function getChunkPlayers(int $chunkX, int $chunkZ) : arrayDeprecated
WARNING: This function has a misleading name. Contrary to what the name might imply, this function
Returns a list of players who have the target chunk within their view distance.
getChunkTickRadius()
public function getChunkTickRadius() : intReturns the radius of chunks to be ticked around each player. This is referred to as "simulation distance" in the Minecraft: Bedrock world options screen.
getCollidingEntities()
public function getCollidingEntities(\pocketmine\math\AxisAlignedBB $bb, ?\pocketmine\entity\Entity $entity = null) : arrayReturns all collidable entities whose bounding boxes intersect the given bounding box. If an entity is given, it will be excluded from the result. If a non-collidable entity is given, the result will be empty.
This function is the same as World::getNearbyEntities(), but with additional collidability filters.
getCollisionBlocks()
public function getCollisionBlocks(\pocketmine\math\AxisAlignedBB $bb, bool $targetFirst = false) : arraygetCollisionBoxes()
public function getCollisionBoxes(\pocketmine\entity\Entity $entity, \pocketmine\math\AxisAlignedBB $bb, bool $entities = true) : arrayDeprecated
Use World::getBlockCollisionBoxes() instead (alongside World::getCollidingEntities()
getDifficulty()
public function getDifficulty() : intgetDifficultyFromString()
public static function getDifficultyFromString(string $str) : intgetDimension() 5.46.0
public function getDimension() : \pocketmine\world\dimension\DimensionReturns the dimension this world is presented as to clients (sky, fog, chunk height, portals).
getDisplayName()
public function getDisplayName() : stringReturns the World display name. WARNING: This is NOT guaranteed to be unique. Multiple worlds at runtime may share the same display name.
getEntities()
public function getEntities() : arrayReturns a list of all the entities in this world, indexed by their entity runtime IDs
getEntity()
public function getEntity(int $entityId) : ?\pocketmine\entity\EntitygetFolderName()
public function getFolderName() : stringReturns the World folder name. This will not change at runtime and will be unique to a world per runtime.
getFullLight()
public function getFullLight(\pocketmine\math\Vector3 $pos) : intReturns the highest level of any type of light at the given coordinates, adjusted for the current weather and time of day.
getFullLightAt()
public function getFullLightAt(int $x, int $y, int $z) : intReturns the highest level of any type of light at the given coordinates, adjusted for the current weather and time of day.
getHighestAdjacentBlockLight()
public function getHighestAdjacentBlockLight(int $x, int $y, int $z) : intReturns the highest block light level available in the positions adjacent to the specified block coordinates.
getHighestAdjacentFullLightAt()
public function getHighestAdjacentFullLightAt(int $x, int $y, int $z) : intReturns the highest level of any type of light at, or adjacent to, the given coordinates, adjusted for the current weather and time of day.
getHighestAdjacentPotentialBlockSkyLight()
public function getHighestAdjacentPotentialBlockSkyLight(int $x, int $y, int $z) : intReturns the highest potential level of sky light in the positions adjacent to the specified block coordinates.
getHighestAdjacentPotentialLightAt()
public function getHighestAdjacentPotentialLightAt(int $x, int $y, int $z) : intReturns the highest potential level of any type of light at, or adjacent to, the given coordinates. This is not affected by weather or time of day.
getHighestAdjacentRealBlockSkyLight()
public function getHighestAdjacentRealBlockSkyLight(int $x, int $y, int $z) : intReturns the highest block sky light available in the positions adjacent to the given coordinates, adjusted for the world's current time of day and weather conditions.
getHighestBlockAt()
public function getHighestBlockAt(int $x, int $z) : ?intGets the highest block Y value at a specific $x and $z
getId()
final public function getId() : intReturns the unique world identifier
getLoadedChunks()
public function getLoadedChunks() : arraygetLogger()
public function getLogger() : \LoggergetMaxY()
public function getMaxY() : intgetMinY()
public function getMinY() : intgetNaturalMobSpawner() 5.46.0
public function getNaturalMobSpawner() : ?\pocketmine\world\mobs\NaturalMobSpawnerNatural mob spawning around players, or null if disabled in pocketmine.yml.
getNearbyEntities()
public function getNearbyEntities(\pocketmine\math\AxisAlignedBB $bb, ?\pocketmine\entity\Entity $entity = null) : arrayReturns all entities whose bounding boxes intersect the given bounding box, excluding the given entity.
getNearestEntity()
public function getNearestEntity(\pocketmine\math\Vector3 $pos, float $maxDistance, string $entityType = \pocketmine\entity\Entity::class, bool $includeDead = false) : ?\pocketmine\entity\EntityReturns the closest Entity to the specified position, within the given radius.
getOrLoadChunkAtPosition()
public function getOrLoadChunkAtPosition(\pocketmine\math\Vector3 $pos) : ?\pocketmine\world\format\ChunkReturns the chunk containing the given Vector3 position.
getPatrolSpawner() 5.46.0
public function getPatrolSpawner() : ?\pocketmine\world\mobs\PatrolSpawnerPillager patrol spawning, or null if disabled in pocketmine.yml.
getPlayers()
public function getPlayers() : arrayReturns a list of the players in this world
getPoiManager() 5.46.0
public function getPoiManager() : \pocketmine\world\raid\PoiManagerVillage points of interest of this world (beds, bells, job sites) and the villagers that claimed them.
getPotentialBlockSkyLightAt()
public function getPotentialBlockSkyLightAt(int $x, int $y, int $z) : intReturns the highest potential level of sky light at the target coordinates, regardless of the time of day or weather conditions.
getPotentialLight()
public function getPotentialLight(\pocketmine\math\Vector3 $pos) : intReturns the highest potential level of any type of light at the target coordinates. This is not affected by weather or time of day.
getPotentialLightAt()
public function getPotentialLightAt(int $x, int $y, int $z) : intReturns the highest potential level of any type of light at the target coordinates. This is not affected by weather or time of day.
getProvider()
final public function getProvider() : \pocketmine\world\format\io\WritableWorldProvidergetRaidManager() 5.46.0
public function getRaidManager() : \pocketmine\world\raid\RaidManagerRaids of this world (villages attacked by illagers) and the Bad Omen / Raid Omen effects that start them.
getRandomTickedBlocks()
public function getRandomTickedBlocks() : arraygetRealBlockSkyLightAt()
public function getRealBlockSkyLightAt(int $x, int $y, int $z) : intReturns the sky light level at the specified coordinates, offset by the current time and weather.
getRedstone() 5.46.0
public function getRedstone() : ?\pocketmine\world\redstone\RedstoneEngineReturns the redstone engine of this world, or null if redstone is disabled in pocketmine.yml.
getSafeSpawn()
public function getSafeSpawn(?\pocketmine\math\Vector3 $spawn = null) : \pocketmine\world\PositionReturns a safe spawn position near the given position, or near the world's spawn position if not provided. This function will throw an exception if the terrain is not already generated in advance.
getSeed()
public function getSeed() : intGets the world seed
getServer()
public function getServer() : \pocketmine\ServergetSimulationDistance() 5.46.0
public function getSimulationDistance() : intReturns the radius of chunks around each player in which entities are ticked ("simulation distance"), or 0 if the entities of every loaded chunk are ticked.
getSkyLightReduction()
public function getSkyLightReduction() : intReturns how many points of sky light is subtracted based on the current time.
getSpawnLocation()
public function getSpawnLocation() : \pocketmine\world\PositionReturns a Position pointing to the spawn
getSunAngleDegrees()
public function getSunAngleDegrees() : floatReturns the current sun angle in degrees.
getSunAnglePercentage()
public function getSunAnglePercentage() : floatReturns the percentage of a circle away from noon the sun is currently at.
getSunAngleRadians()
public function getSunAngleRadians() : floatReturns the current sun angle in radians.
getTickRateTime()
public function getTickRateTime() : floatgetTickingChunks()
public function getTickingChunks() : arrayReturns a list of chunk position hashes (as returned by World::chunkHash()) which are currently valid for ticking.
getTile()
public function getTile(\pocketmine\math\Vector3 $pos) : ?\pocketmine\block\tile\TileReturns the Tile in a position, or null if not found.
Note: This method wraps getTileAt(). If you're guaranteed to be passing integers, and you're using this method in performance-sensitive code, consider using getTileAt() instead of this method for better performance.
getTileAt()
public function getTileAt(int $x, int $y, int $z) : ?\pocketmine\block\tile\TileReturns the tile at the specified x,y,z coordinates, or null if it does not exist.
getTime()
public function getTime() : intGets the current time
getTimeOfDay()
public function getTimeOfDay() : intReturns the current time of day
getVibrations() 5.46.0
public function getVibrations() : \pocketmine\world\vibration\VibrationManagerReturns the manager which delivers vibrations (game events) to the sculk sensors of this world.
getViewersForPosition()
public function getViewersForPosition(\pocketmine\math\Vector3 $pos) : arrayReturns an array of players who have the target position within their view distance.
getWeather() 5.46.0
public function getWeather() : \pocketmine\world\weather\WeatherRain, snow and thunderstorms of this world (always clear outside the Overworld).
getXZ()
public static function getXZ(int $hash, ?int &$x, ?int &$z) : voidhasEntitiesThatMayBeStoodOn() 5.46.0
public function hasEntitiesThatMayBeStoodOn() : boolReturns whether this world holds any entity which players may be able to stand on (see Entity::canBeStoodOn()). Lets per-movement checks skip looking for such entities in most worlds.
isBlockPowered() 5.46.0
public function isBlockPowered(\pocketmine\math\Vector3 $pos) : boolReturns whether the block at the given position receives redstone power from any side. Always false if redstone is disabled.
isBlockUpdateScheduled() 5.46.0
public function isBlockUpdateScheduled(int $x, int $y, int $z) : boolReturns whether a delayed block update (see World::scheduleDelayedBlockUpdate()) is pending at the given position.
isChunkGenerated()
public function isChunkGenerated(int $x, int $z) : boolisChunkInUse()
public function isChunkInUse(int $x, int $z) : boolisChunkLoaded()
public function isChunkLoaded(int $x, int $z) : boolisChunkLocked()
public function isChunkLocked(int $chunkX, int $chunkZ) : boolReturns whether anyone currently has a lock on the chunk at the given coordinates. You should check this to make sure that population tasks aren't currently modifying chunks that you want to use in async tasks.
isChunkPopulated()
public function isChunkPopulated(int $x, int $z) : boolisChunkSimulated() 5.46.0
public function isChunkSimulated(int $chunkX, int $chunkZ) : boolReturns whether the entities of the chunk are ticked: it is within the simulation distance of a player, or registered for ticking or simulation, or the simulation distance is unlimited.
isDoingTick()
public function isDoingTick() : boolisInLoadedTerrain()
public function isInLoadedTerrain(\pocketmine\math\Vector3 $pos) : boolReturns whether the given position is in a loaded area of terrain.
isInWorld()
public function isInWorld(int $x, int $y, int $z) : boolisLoaded()
public function isLoaded() : boolisMobSpawningEnabled() 5.46.0
public function isMobSpawningEnabled() : boolReturns whether mobs spawn naturally in this world (gamerule domobspawning). Mobs keep despawning when it is off.
isSpawnChunk()
public function isSpawnChunk(int $X, int $Z) : boolReturns whether the chunk at the specified coordinates is a spawn chunk
loadChunk()
public function loadChunk(int $x, int $z) : ?\pocketmine\world\format\ChunkAttempts to load a chunk from the world provider (if not already loaded). If the chunk is already loaded, it is returned directly.
lockChunk()
public function lockChunk(int $chunkX, int $chunkZ, \pocketmine\world\ChunkLockId $lockId) : voidFlags a chunk as locked, usually for async modification.
This is an advisory lock. This means that the lock does not prevent the chunk from being modified on the main thread, such as by setBlock() or setBiomeId(). However, you can use it to detect when such modifications have taken place - unlockChunk() with the same lockID will fail and return false if this happens.
This is used internally by the generation system to ensure that two PopulationTasks don't try to modify the same chunk at the same time. Generation will respect these locks and won't try to do generation of chunks over which a lock is held.
WARNING: Be sure to release all locks once you're done with them, or you WILL have problems with terrain not being generated.
notifyNeighbourBlockUpdate()
public function notifyNeighbourBlockUpdate(\pocketmine\math\Vector3 $pos) : voidNotify the blocks at and around the position that the block at the position may have changed. This will cause onNearbyBlockChange() to be called for these blocks. TODO: Accept plain integers in PM6 - the Vector3 requirement is an unnecessary inconvenience
notifyNeighbourBlockUpdateAt() 5.46.0
public function notifyNeighbourBlockUpdateAt(int $x, int $y, int $z) : voidInteger version of World::notifyNeighbourBlockUpdate(): queues updates for the block at the given position and its six neighbours.
orderChunkPopulation()
public function orderChunkPopulation(int $chunkX, int $chunkZ, ?\pocketmine\world\ChunkLoader $associatedChunkLoader) : \pocketmine\promise\PromiseInitiates asynchronous generation/population of the target chunk, if it's not already generated/populated. If generation has already been requested for the target chunk, the promise for the already active request will be returned directly.
If the chunk is currently locked (for example due to another chunk using it for async generation), the request will be queued and executed at the earliest opportunity.
registerChunkListener()
public function registerChunkListener(\pocketmine\world\ChunkListener $listener, int $chunkX, int $chunkZ) : voidRegisters a listener to receive events on a chunk.
registerChunkLoader()
public function registerChunkLoader(\pocketmine\world\ChunkLoader $loader, int $chunkX, int $chunkZ, bool $autoLoad = true) : voidregisterSimulatingChunk() 5.46.0
public function registerSimulatingChunk(\pocketmine\world\ChunkTicker $ticker, int $chunkX, int $chunkZ) : voidInstructs the World to tick the entities of the specified chunk even if it is beyond the simulation distance of every player, for as long as this chunk ticker (or any other) is registered to it. Chunks registered with World::registerTickingChunk() are simulated too.
registerTickingChunk()
public function registerTickingChunk(\pocketmine\world\ChunkTicker $ticker, int $chunkX, int $chunkZ) : voidInstructs the World to tick the specified chunk, for as long as this chunk ticker (or any other chunk ticker) is registered to it.
removeEntity()
public function removeEntity(\pocketmine\entity\Entity $entity) : voidRemoves the entity from the world index
removeOnUnloadCallback()
public function removeOnUnloadCallback(\Closure $callback) : voidremoveRandomTickedBlock()
public function removeRandomTickedBlock(\pocketmine\block\Block $block) : voidrequestChunkPopulation()
public function requestChunkPopulation(int $chunkX, int $chunkZ, ?\pocketmine\world\ChunkLoader $associatedChunkLoader) : \pocketmine\promise\PromiseAttempts to initiate asynchronous generation/population of the target chunk, if it's currently reasonable to do so (and if it isn't already generated/populated). If the generator is busy, the request will be put into a queue and delayed until a better time.
A ChunkLoader can be associated with the generation request to ensure that the generation request is cancelled if no loaders are attached to the target chunk. If no loader is provided, one will be assigned (and automatically removed when the generation request completes).
requestSafeSpawn()
public function requestSafeSpawn(?\pocketmine\math\Vector3 $spawn = null) : \pocketmine\promise\PromiseRequests a safe spawn position near the given position, or near the world's spawn position if not provided. Terrain near the position will be loaded or generated as needed.
save()
public function save(bool $force = false) : boolsaveChunks()
public function saveChunks() : voidscheduleDelayedBlockUpdate()
public function scheduleDelayedBlockUpdate(\pocketmine\math\Vector3 $pos, int $delay) : voidSchedules a block update to be executed after the specified number of ticks. Blocks will be updated with the scheduled update type.
scheduleNeighbourBlockUpdateAt() 5.46.0
public function scheduleNeighbourBlockUpdateAt(int $x, int $y, int $z) : voidQueues Block::onNearbyBlockChange() for the block at the given position only (not its neighbours).
setAutoSave()
public function setAutoSave(bool $value) : voidsetBiomeId()
public function setBiomeId(int $x, int $y, int $z, int $biomeId) : voidsetBlock()
public function setBlock(\pocketmine\math\Vector3 $pos, \pocketmine\block\Block $block, bool $update = true) : voidSets the block at the given Vector3 coordinates.
setBlockAt()
public function setBlockAt(int $x, int $y, int $z, \pocketmine\block\Block $block, bool $update = true) : voidSets the block at the given coordinates.
If $update is true, it'll get the neighbour blocks (6 sides) and update them, and also update local lighting. If you are doing big changes, you might want to set this to false, then update manually.
setChunk()
public function setChunk(int $chunkX, int $chunkZ, \pocketmine\world\format\Chunk $chunk) : voidsetChunkTickRadius()
public function setChunkTickRadius(int $radius) : voidSets the radius of chunks ticked around each player. This may not take effect immediately, since each player needs to recalculate their tick radius.
setDifficulty()
public function setDifficulty(int $difficulty) : voidsetDisplayName()
public function setDisplayName(string $name) : voidSets the World display name.
setMobSpawningEnabled() 5.46.0
public function setMobSpawningEnabled(bool $enabled) : voidTurns natural mob spawning on or off (gamerule domobspawning, saved with the world when its format supports it).
setSimulationDistance() 5.46.0
public function setSimulationDistance(int $distance) : voidSets the radius of chunks around each player in which entities are ticked (0 = no limit). Like World::setChunkTickRadius(), players pick it up when they next recalculate their chunks.
setSleepTicks()
public function setSleepTicks(int $ticks) : voidsetSpawnLocation()
public function setSpawnLocation(\pocketmine\math\Vector3 $pos) : voidSets the world spawn location
setTime()
public function setTime(int $time) : voidSets the current time on the world
startTime()
public function startTime() : voidStart the time again, if it was stopped
stopTime()
public function stopTime() : voidStops the time for the world, will not save the lock state to disk
unloadChunk()
public function unloadChunk(int $x, int $z, bool $safe = true, bool $trySave = true) : boolunloadChunkRequest()
public function unloadChunkRequest(int $x, int $z, bool $safe = true) : boolunloadChunks()
public function unloadChunks(bool $force = false) : voidunlockChunk()
public function unlockChunk(int $chunkX, int $chunkZ, ?\pocketmine\world\ChunkLockId $lockId) : boolUnlocks a chunk previously locked by lockChunk().
You must provide the same lockID as provided to lockChunk(). If a null lockID is given, any existing lock will be removed from the chunk, regardless of who owns it.
Returns true if unlocking was successful, false otherwise.
unregisterChunkListener()
public function unregisterChunkListener(\pocketmine\world\ChunkListener $listener, int $chunkX, int $chunkZ) : voidUnregisters a chunk listener previously registered.
unregisterChunkListenerFromAll()
public function unregisterChunkListenerFromAll(\pocketmine\world\ChunkListener $listener) : voidUnregisters a chunk listener from all chunks it is listening on in this World.
unregisterChunkLoader()
public function unregisterChunkLoader(\pocketmine\world\ChunkLoader $loader, int $chunkX, int $chunkZ) : voidunregisterSimulatingChunk() 5.46.0
public function unregisterSimulatingChunk(\pocketmine\world\ChunkTicker $ticker, int $chunkX, int $chunkZ) : voidunregisterTickingChunk()
public function unregisterTickingChunk(\pocketmine\world\ChunkTicker $ticker, int $chunkX, int $chunkZ) : voidUnregisters the given chunk ticker from the specified chunk. If there are other tickers still registered to the chunk, it will continue to be ticked.
updateAllLight()
public function updateAllLight(int $x, int $y, int $z) : voiduseBreakOn()
public function useBreakOn(\pocketmine\math\Vector3 $vector, ?\pocketmine\item\Item &$item = null, ?\pocketmine\player\Player $player = null, bool $createParticles = false, array &$returnedItems = []) : boolTries to break a block using a item, including Player time checks if available It'll try to lower the durability if Item is a tool, and set it to Air if broken.
useItemOn()
public function useItemOn(\pocketmine\math\Vector3 $vector, \pocketmine\item\Item &$item, int $face, ?\pocketmine\math\Vector3 $clickVector = null, ?\pocketmine\player\Player $player = null, bool $playSound = false, array &$returnedItems = []) : boolUses a item on a position and face, placing it or activating the block
