Skip to content

Instantly share code, notes, and snippets.

View tryashtar's full-sized avatar

tryashtar tryashtar

View GitHub Profile
@theaddonn
theaddonn / mcb-format.md
Last active July 27, 2026 23:50
The MCB binary format: Minecraft Bedrock's compiled JSON (cameras, particles, trades, voxel shapes) stored inside .brarchive containers

The MCB binary format (Minecraft Bedrock compiled JSON)

MCB is a compiled, schema typed binary re-encoding of the definition files that Bedrock used to ship as plain JSON: cameras, particles, villager trades, voxel shapes, and more. Each MCB blob lives as a single entry inside a .brarchive container, and an archive can freely mix MCB entries with ordinary text JSON entries. You can tell them apart by the first four bytes: an entry is MCB when it starts with 7F 4D 43 42, which is \x7F followed by MCB, in the same spirit as the \x7FELF magic.

# execute positioned ~ Double.NEGATIVE_INFINITY ~ run summon minecraft:eye_of_ender ~ ~Double.POSITIVE_INFINITY ~ {UUIDMost: 0L, UUIDLeast: 0L}
execute positioned ~ -179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497792 ~ run summon minecraft:eye_of_ender ~ ~179769313486231580793728971405303415079934132710037826936173778980444968292764750946649017977587207096330286416692887910946555547851940402630657488671505820681908902000708383676273854845817711531764475730270069855571366959622842914819860834936475292719074168444365510704342711559699508093042880177904174497792 ~ {UUIDMost: 0L, UUIDLeast: 0L}
kill 0-0-0-0-0
data modify storage _ nan set from entity 0-0-0-0-0 Pos[1]
tick
commandFunctions
minecraft:tick -> (Server)
minecraft:load -> (Server)
levels
$level
timeSync
tick
world border
weather
@BarelyAliveMau5
BarelyAliveMau5 / modified_utf8.py
Last active November 15, 2024 07:58
python's version of java's modified utf8
# translated from: http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/94cc251d0c45/src/share/npt/utf.c
def utf8s_to_utf8m(string):
"""
:param string: utf8 encoded string
:return: modified utf8 encoded string
"""
new_str = []
i = 0
while i < len(string):