Skip to content

BlockSurvival 5.46.0 ​

final class · pocketmine\world\generator\vanilla\feature\block\BlockSurvival · source

Java's BlockState.canSurvive() for the blocks placed by features (Java 26.3 rules, mostly block tags), used by would_survive predicates and by the features that check it (simple_block, bamboo, root_system...). During worldgen the light level is 0 (the light engine has not run yet), which matters for mushrooms. Blocks without a rule (plain blocks) always survive.

Methods ​

__construct() ​

php
public function __construct(\pocketmine\world\generator\vanilla\feature\block\JavaBlocks $blocks)

canAttachTo() ​

php
public function canAttachTo(\pocketmine\world\generator\vanilla\feature\FeatureLevel $level, int $x, int $y, int $z, int $direction) : bool

MultifaceBlock.canAttachTo(): the neighbour face towards the block is full.

canSurvive() ​

php
public function canSurvive(\pocketmine\world\generator\vanilla\feature\FeatureLevel $level, int $state, int $x, int $y, int $z) : bool

isSolidRender() ​

php
public function isSolidRender(int $state) : bool

Approximation of BlockState.isSolidRender(): full cube that occludes (not leaves, glass or ice).

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