EfficientHashing
by ZZZank
Hash lookups for block positions in the game get fewer collisions with EfficientHashing, which swaps the hashing algorithm of Vec3i and BlockPos.
What it does
EfficientHashing changes how Vec3i and its subclass BlockPos compute their hash codes. The replacement algorithm, called PhiMix, gives nearly every distinct position its own code, where the vanilla algorithm assigns many positions the same value. The mod's author describes the change as affecting wherever the hash code is used, so any feature that stores positions in hash-based collections is touched by it.
In a test covering every block position from -100, -20, -100 to 100, 50, 100, about 2,800,000 objects, the vanilla algorithm produced 194,571 distinct hash codes, while PhiMix produced 2,868,471. The author reports PhiMix running at about 95.3 percent of the vanilla speed, a gap described as small next to other hashing solutions. The default position 0, 0, 0 still hashes to 0 under PhiMix, which keeps behavior compatible with vanilla.
Every player and the server need a copy of the mod. It is published for Fabric, Forge and NeoForge, with files for game versions 1.18 – 26.1.2 across 13 release versions. The mod is licensed under the GNU Lesser General Public License v3.0 only, and it is open source, with the source code publicly available.
Key features
PhiMix hashing algorithm
Vec3i and BlockPos hash codes come from the PhiMix algorithm instead of the vanilla formula.
Fewer hash collisions
Distinct block positions receive distinct codes in the author's test, where vanilla produced far fewer unique values.
Default position hash
The position 0, 0, 0 still hashes to 0, the same value as the vanilla default integer.
Compatibility
Latest build for each game version and loader.
26.x1 of 1 version with builds
1.21.x2 of 2 versions with builds
1.20.x2 of 2 versions with builds
1.19.x5 of 5 versions with builds
1.18.x3 of 3 versions with builds
Only full game releases are shown. This mod publishes no snapshot builds.
Use cases
Servers with heavy block-position lookups
Server owners whose worlds store many positions in hash-based structures can test the mod on their load.
Who it’s for: Server owners and modpack authors who want a hashing change in Vec3i and BlockPos, and players who run the mod on a client that uses the same hashing.
Questions
Does EfficientHashing need to be installed on the server?
Which loaders does EfficientHashing support?
Does the hashing change affect vanilla behavior?
In the catalog
EfficientHashing is one of 3,545 Optimization mods on ModsFinder, and one of 2,575 Optimization mods for Fabric. 15,189 mods support Minecraft 26.1.2.
More from ZZZank
Similar mods
What the author says
EfficientHashing replaced hashing algorithm of Vec3i (and its subclasses like BlockPos) with one that's much much more collision resistant, providing performance improvement in basically wherever its hashcode is used. We can prove this by doing a simple test. Test is perform by hashing every combination of BlockPos…
Official listing
- Modrinth page
- modrinth.com/mod/efficient-hashing
- Owner
- ZZZank
- Published
- 2025-11-28
- Updated on Modrinth
- 2026-10-08
- Facts verified
- 2026-10-15
