Skip to content

Blockset

LonghiTW edited this page Jun 30, 2026 · 1 revision

Custom Block Color Mapping

plugins/TileMapper/blockset/ holds your local blockset file, while online blocksets (such as Default, All, Grayscale) are read live from the repository. Together they give you full control over which blocks are used for tile image reproduction.

How it works

  • Config reference: active_blockset field in config.yml selects which blockset to use
  • Online blocksets — read live from the repository; no local file needed
  • Local blockset (custom_blockset.json) — auto-downloaded on first launch; freely editable
  • Hot-switch: Use /tsm blockset <name> to switch at runtime

Available blocksets

File Source Description
custom_blockset local blockset/custom_blockset.json Default local file (auto-downloaded from All.json on first launch; freely editable or replaceable)
All repository (online) All available blocks (full spectrum)
Default repository (online) Curated palette — good all-round balance
Grayscale repository (online) Pure grey blocks — activates luminance-only matching

JSON format

Blockset files are flat JSON arrays. Each entry has at least id (block registry name) and rgb (sRGB 8-bit color). The optional lab field stores pre-computed Oklab values for faster loading.

[
  {"id": "stone", "rgb": [126, 126, 126]},
  {"id": "dirt", "rgb": [134, 96, 67]}
]

The id field must be a valid Minecraft registry name (e.g. stone, oak_planks). Entries with unrecognized block IDs are silently skipped.

Lab vs RGB sanity check

On first load, the plugin checks whether the stored Oklab values match the RGB source. If they match (within d² < 0.01), the stored Oklab values are used directly. If they don't — indicating the file was generated for a different color space — the plugin automatically falls back to computing Oklab from rgb at runtime for all entries. This means you can safely add your own entries with just id + rgb — they'll work correctly.

Color space: TileMapper uses Oklab with Euclidean distance for perceptually-uniform block color matching.

Example layout

plugins/TileMapper/blockset/
  custom_blockset.json      # your local blockset file
  my_custom_palette.json    # additional local files

Local .json files are referenced by name (without extension) in active_blockset. To restore the default, delete the blockset/ folder and restart.

Generating a custom blockset

A Python tool is available at tool/assets2blockset.py that extracts block colors from Minecraft's official assets texture pack (using textures/block), computes Oklab values, and generates a complete blockset JSON file with palette-based deduplication. Derived from hueblocks/jar2blockset.

# Download the matching asset pack and run:
python tool/assets2blockset.py --version 1.21.8 --output my_blockset.json

Clone this wiki locally