Skip to content

PathBlockTypes 5.46.0 ​

final class · pocketmine\entity\ai\navigation\PathBlockTypes · source

Classifies block states for mob navigation and line of sight, reading block state IDs straight from chunks (no Block objects on the hot path). The classification of each state ID is computed once and cached.

Constants ​

CLIMBABLE ​

php
public const CLIMBABLE = 128

Ladders and vines.

CLOSED_DOOR ​

php
public const CLOSED_DOOR = 256

Closed door: only passable for mobs which open doors (see PathFinder::setCanOpenDoors()).

DANGER ​

php
public const DANGER = 8

Hurts mobs standing in or on it (fire, lava, cactus, magma, berry bush...).

FLOOR ​

php
public const FLOOR = 2

Mobs can stand on top of it (collision top between 0.5 and 1).

LOW ​

php
public const LOW = 4

Low collision (slab, carpet, snow layer): mobs stand on it from inside its cell.

OPAQUE ​

php
public const OPAQUE = 64

Blocks line of sight.

OPENABLE_DOOR ​

php
public const OPENABLE_DOOR = 512

Door mobs can open (not iron doors).

PASSABLE ​

php
public const PASSABLE = 1

No collision: entities can be inside it.

TALL ​

php
public const TALL = 32

Collision taller than a block (fences, walls, closed fence gates): can't be stepped or jumped over.

WATER ​

php
public const WATER = 16

Methods ​

at() ​

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

Returns the flags of the block at the given position. Unloaded chunks are solid; above the world is air.

classify() ​

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

inChunk() ​

php
public static function inChunk(\pocketmine\world\World $world, ?\pocketmine\world\format\Chunk $chunk, int $x, int $y, int $z) : int

Same as PathBlockTypes::at() with a chunk the caller already looked up (null = unloaded).

isStandable() ​

php
public static function isStandable(\pocketmine\world\World $world, int $x, int $y, int $z, int $headBlocks, bool $allowWater = true) : bool

Returns whether a mob needing $headBlocks free blocks above its feet can stand with its feet in this block (same rules as the path finder, without its per-search cache).

ofState() ​

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

Flags of the given block state at the given position (the position is only used to build the block the first time this state is seen). For callers which already read the state ID.

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