Skip to content

BlockStateData ​

final class · pocketmine\data\bedrock\block\BlockStateData · source

Contains the common information found in a serialized blockstate.

Constants ​

CURRENT_VERSION ​

php
public const CURRENT_VERSION = \pocketmine\data\bedrock\WorldDataVersions::BLOCK_STATES

TAG_NAME ​

php
public const TAG_NAME = "name"

TAG_STATES ​

php
public const TAG_STATES = "states"

TAG_VERSION ​

php
public const TAG_VERSION = "version"

Methods ​

__construct() ​

php
public function __construct(string $name, array $states, int $version)

current() ​

php
public static function current(string $name, array $states) : self

equals() ​

php
public function equals(self $that) : bool

fromNbt() ​

php
public static function fromNbt(\pocketmine\nbt\tag\CompoundTag $nbt) : self

getName() ​

php
public function getName() : string

getState() ​

php
public function getState(string $name) : ?\pocketmine\nbt\tag\Tag

getStates() ​

php
public function getStates() : array

getVersion() ​

php
public function getVersion() : int

getVersionAsString() ​

php
public function getVersionAsString() : string

toNbt() ​

php
public function toNbt() : \pocketmine\nbt\tag\CompoundTag

Encodes the blockstate as a TAG_Compound, but with extra PM-specific metadata, used for fixing bugs in old saved data. This should be used for anything saved to disk.

toVanillaNbt() ​

php
public function toVanillaNbt() : \pocketmine\nbt\tag\CompoundTag

Encodes the blockstate as a TAG_Compound, exactly as it would be in vanilla Bedrock.

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