Skip to content

R12ItemIdToBlockIdMap ​

final class · pocketmine\data\bedrock\item\upgrade\R12ItemIdToBlockIdMap · source

Maps all known 1.12 and lower item IDs to their respective block IDs, where appropriate. If an item ID does not have a corresponding 1.12 block ID, assume the item is not a blockitem.

This is only needed for deserializing blockitems from 1.8 and lower (or 1.12 and lower in the case of PM). In 1.9 and above, the blockstate NBT is stored in the itemstack NBT, and the item ID is not used.

Methods ​

__construct() ​

php
public function __construct(array $itemToBlock)

blockIdToItemId() ​

php
public function blockIdToItemId(string $blockId) : ?string

itemIdToBlockId() ​

php
public function itemIdToBlockId(string $itemId) : ?string

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