Skip to content

BlockMapColors 5.46.0 ​

final class · pocketmine\world\map\BlockMapColors · source

Base map colour of each block, as vanilla Bedrock reports it (resources/block_map_colors.json, generated by tools/generate-block-map-colors.php from a Bedrock Dedicated Server block state dump).

Colours are 0xRRGGBB ints; NONE means the block doesn't show on maps (air, glass, ...) so the map looks through it.

Constants ​

FALLBACK ​

php
public const FALLBACK = 0x707070

Used for blocks missing from the table, so that new blocks still show up

NONE ​

php
public const NONE = -1

SHADE_HIGH ​

php
public const SHADE_HIGH = 255

SHADE_LOW ​

php
public const SHADE_LOW = 180

Brightness multipliers used for height shading (out of 255), as in vanilla

SHADE_LOWEST ​

php
public const SHADE_LOWEST = 135

SHADE_NORMAL ​

php
public const SHADE_NORMAL = 220

WATER ​

php
public const WATER = 0x4040ff

Methods ​

__construct() ​

php
public function __construct(?string $path = null)

getColor() ​

php
public function getColor(int $stateId) : int

Returns the base map colour (0xRRGGBB) of the given block state, or NONE if it doesn't show on maps.

getColorByName() ​

php
public function getColorByName(string $name, ?string $pillarAxis = null) : int

Returns the base map colour (0xRRGGBB) of the block with the given vanilla ID, or NONE if it doesn't show on maps. Blocks missing from the table get FALLBACK.

isKnown() ​

php
public function isKnown(string $name) : bool

Returns whether the table has a colour (or explicitly no colour) for the given block.

shade() ​

php
public static function shade(int $color, int $brightness) : int

Applies a shading brightness (SHADE_*) to a base colour.

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