Skip to content

SpawnBlockInfo 5.46.0 ​

final class · pocketmine\world\mobs\spawn\SpawnBlockInfo · source

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 = 16

Hurts or traps mobs at their feet (fire, berry bushes, cobwebs, powder snow...).

LAVA ​

php
public const LAVA = 8

PASSABLE ​

php
public const PASSABLE = 1

SOLID ​

php
public const SOLID = 32

Has a collision box or is lava: ends the "surface" of a column.

SOLID_TOP ​

php
public const SOLID_TOP = 2

WATER ​

php
public const WATER = 4

Methods ​

classify() ​

php
public static function classify(\pocketmine\block\Block $block) : int

flags() ​

php
public static function flags(\pocketmine\world\World $world, int $stateId, int $x, int $y, int $z) : int

Flags 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) : string

Bedrock name of the state ID, e.g. "minecraft:grass_block".

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.