Skip to content

Scorched

BonsUnleashed edited this page Oct 7, 2026 · 3 revisions

Scorched

Minecraft 1.20.1 / Forge: this page documents that build and its measurements. For the separate 170-control Minecraft 1.21.1 port, see Minecraft 1.21.1 NeoForge.

One control for Scorched 1.1.3e (mod id mr_scorched): buried sandcrabs are processed only within 192 blocks of a player. This deliberately changes when a buried crab emerges; the section explains why that distance is safe. It is not a mixin. Bons and Furious registers a built-in data pack (through FunctionFixPacks) that replaces scorched:tick and scorched:mob/sandcrab/burrow_stay, and only when the switch is on, the mod is installed and every replaced function is byte-identical (SHA-256) to the version the fix was written for. An updated Scorched keeps its own functions, with one WARN line. See How the patches are applied for the mechanism. It matters on whichever side hosts the world.

This fix stacks with vanilla_data_merge_unchanged, which makes the /data merge these functions issue cheap when nothing changes.

Key Target Side Since Kind Result
scorched_sandcrab_burrow_gate Scorched 1.1.3e BOTH 1.0.13 change (function pack) scorched:tick 8,941 → 739 µs with ~290 buried crabs

scorched_sandcrab_burrow_gate

Kind: deliberate behaviour change (a distance gate) · Applied from: the installed Scorched JAR's own functions, repaired in memory by InstalledFunctionPack; the fixed text is not shipped, in keeping with Scorched's custom license

What upstream did. Scorched's sandcrab colonies bury crabs as postgen markers that become mobs when a player comes within 128 blocks. Its scorched:tick function ran mob/sandcrab/burrow_stay for every loaded buried crab, every tick, and that function merged Invulnerable:1b into the crab with a full-entity NBT serialise-merge-compare each time. In the normal-play profile that motivated this, data-pack functions were about 31 % of the server thread with roughly 290 buried crabs loaded; the crabs' whole cost was the script (about 7 ms per tick), because far crabs were loaded but not entity-ticking.

What the patch does. Buried crabs are processed only within 192 blocks of a player (the found-crab branch already had a 64-block gate), and Invulnerable is merged once instead of every tick.

Why 192 and why once is exact. The summon does not set Invulnerable, so the every-tick merge is what protects a buried crab from suffocating; nothing in Scorched clears Invulnerable before a crab is found, and no function un-finds a crab, so merging once is exact. The 192-block gate covers the placer's 128-block summon range plus the 8-chunk simulation distance, so every crab that can tick or be seen behaves as before.

Deliberate difference. Outside 192 blocks, an exposed buried crab waits to emerge (and drop its loot) until a player comes within 192 blocks; previously it emerged unseen.

Measured (private full-pack rig, 300 crabs buried exactly as the placer buries them, three rounds, medians; absolute numbers carry about ±30 % from other load, the ratios are solid):

Per crab, per server tick Upstream With the fix
Scorched script, no player within 192 blocks 29.8 µs 1.4 µs
Scorched script, player 80–160 blocks away 28.6 µs 5.2 µs
Scorched script, player close (165 of 300 within 32 blocks, turning to face them) 35.4 µs 6.6 µs
Real server tick, 300 crabs in entity-ticking chunks, no player +131 µs (+39 ms total) +79 µs (+24 ms total)
Real server tick, same, player close +119 µs +67 µs

A crab in entity-ticking chunks still costs about 70–80 µs, of which 60–70 µs is the crab ticking as a mob (a NoAI baby zombie); that part is unchanged and comparable to an idle zombie or cow. In the world A/B, scorched:tick with about 290 buried crabs and nobody near fell from 8,941 → 739 µs.

Log lines. … scorched_sandcrab_burrow_gate applied to mr_scorched (2 original functions verified) on success; … skipped for mr_scorched because the installed data/scorched/functions/tick.mcfunction does not match the supported version if Scorched changed.

Bons and Furious

Minecraft 1.20.1 / Forge 1.0.34

Compatibility

Controls by mod

Links

Clone this wiki locally