SpawnBlockInfo 5.46.0
Classifies block states for mob spawning, by state ID (cached, so the column scans of the spawner read chunks without creating Block objects):
- mobs spawn with their feet in a block without collision (
PASSABLE: air, grass, flowers, snow layers...), or in water for aquatic mobs; - on a block with a full, solid top face (
SOLID_TOP): not carpets, bottom slabs, fences, glass or leaves; - striders on lava.
Constants
DANGER
php
public const DANGER = 16Hurts or traps mobs at their feet (fire, berry bushes, cobwebs, powder snow...).
LAVA
php
public const LAVA = 8PASSABLE
php
public const PASSABLE = 1SOLID
php
public const SOLID = 32Has a collision box or is lava: ends the "surface" of a column.
SOLID_TOP
php
public const SOLID_TOP = 2WATER
php
public const WATER = 4Methods
classify()
php
public static function classify(\pocketmine\block\Block $block) : intflags()
php
public static function flags(\pocketmine\world\World $world, int $stateId, int $x, int $y, int $z) : intFlags of the state ID found at this position (the block is looked up there the first time, since collision boxes of some blocks depend on their neighbours).
name()
php
public static function name(int $stateId) : stringBedrock name of the state ID, e.g. "minecraft:grass_block".
