Skip to content

Alexs Mobs

BonsUnleashed edited this page Oct 7, 2026 · 4 revisions

Alex's Mobs

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.

Two controls for Alex's Mobs 1.22.9 (mod id alexsmobs), both added in 1.0.30: the nearest partner is found without sorting the whole list, and the crows' pumpkin search is answered from the chunk's block lists where nothing can be found. Every switch checks the code it would change against the tested build; another build is left untouched with one WARN line (see How the patches are applied).

Key Target Side Since Kind
alexsmobs_crow_scan_palette_check Alex's Mobs 1.22.9 BOTH 1.0.30 opt
alexsmobs_partner_min_scan Alex's Mobs 1.22.9 BOTH 1.0.30 opt

alexsmobs_partner_min_scan

Since: 1.0.30 · Target: Alex's Mobs 1.22.9 · Side: BOTH (acts where mob AI runs) · Kind: opt

Mixin: PartnerSortMixin

Alex's Mobs finds the nearest partner without sorting. Devil's Hole pupfish looking for a chase partner, fed triops looking for a mate and catfish looking for food sort every candidate nearby by distance and then take only the first. The switch finds that same first candidate in one pass: the nearest one, and among equally near ones the same one as before.

Idea: Alex's Mobs: Tweaks, idea text only

Measured: a search among 30 candidates 1,325 -> 304 ns, among 300 16.2 -> 2.6 us; 30,000 searches identical (choice, partner links, random draws). Public value for big fish and triops farms; not visible in this pack


alexsmobs_crow_scan_palette_check

Since: 1.0.30 · Target: Alex's Mobs 1.22.9 · Side: BOTH (the goal runs on the server) · Kind: opt

Mixins: CrowAvoidPumpkinsMixin, ServerChunkCacheHolderAccess

Alex's Mobs: crows' pumpkin search is answered from the chunk's block lists where nothing can be found. Every few seconds each wild crow looks for something it fears (pumpkins and the like) in a 39 x 11 x 39 box around it: 16,731 block reads, usually to find nothing. A 16x16x16 section of a chunk can only hold the blocks on its block list, so when no list in the box shows a feared block (and every chunk there is already fully loaded), the answer is known: nothing. The search then makes only the chunk lookups the reads would have made, in the same order, so chunk loading and bookkeeping stay exactly as before, and skips the block reads (consecutive lookups of the same chunk are made once, so the profiler's "getChunk" counter, counted only while /debug or /perf runs, shows fewer lookups; cache misses and tickets are unchanged). Anywhere a feared block could be, Alex's Mobs' own search runs. The crows' crop search is left alone (it uses vanilla's search, which another switch covers).

Measured: offline on Alex's Mobs' own class, 20,000 searches (loaded and unloaded chunks, pumpkins near and far, old block-list entries, datapack tags) gave the same results, destinations and chunk bookkeeping; a search over open ground took half the time offline, where the chunk lookups dominate; in game the reads it skips cost more.

Bons and Furious

Minecraft 1.20.1 / Forge 1.0.34

Compatibility

Controls by mod

Links

Clone this wiki locally