Tetrachord Lib
Tetrachord Lib is a library mod that supplies data structures such as KD trees and segment trees, along with a few other utility functions.
What it does
Other mods that handle spatial lookups or range queries in a Minecraft world can call the structures this library provides, instead of scanning every element by hand. A KD tree stores k-dimensional points and answers nearest-neighbor and range queries. A segment tree splits a range into smaller subsections arranged hierarchically, so range updates and queries stay quick. The author states that brute-force methods often prove inefficient for these jobs, and that the structures are meant to improve performance during world generation.
The library sits in the Optimization category and is classed as a Library. Either side can run it, and neither needs it, so it can be used on a client, a server, both, or left out entirely. Files exist for Fabric, Forge and NeoForge across 38 release versions, 1.16 – 26.1.2, and the code is released under the GNU Lesser General Public License v2.1 or later, which makes it open source. The author used the Spark profiler to measure milliseconds per tick (mspt) when testing the optimization, with benchmarks run on a campfire-lighting scenario.
Key features
KD tree structure
Provides a KD tree that stores points in k-dimensional space, supporting nearest-neighbor and range searches.
Segment tree structure
Provides a segment tree that handles range updates and range queries, with subsections organized hierarchically.
Lookup-focused design
Aims to replace brute-force scans in world-related code, which the author describes as frequently inefficient.
Benchmarked with Spark
Performance was measured in milliseconds per tick using the Spark profiler, including a campfire-lighting test.
Gallery
Compatibility
Latest build for each game version and loader.
26.x3 of 3 versions with builds
1.21.x12 of 12 versions with builds
1.20.x7 of 7 versions with builds
1.19.x5 of 5 versions with builds
1.18.x3 of 3 versions with builds
1.17.x2 of 2 versions with builds
1.16.x6 of 6 versions with builds
Only full game releases are shown. This mod publishes no snapshot builds.
Questions
Does Tetrachord Lib need to be installed on the server?
Which loaders does Tetrachord Lib support?
Which game versions have files?
In the catalog
Tetrachord Lib 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 Viola-Siemens
Similar mods
What the author says
Numerous Minecraft mods have integrated functional features within both 2D and 3D environments1[3], yet brute-force methods frequently prove inefficient. In this regard, we introduce Tetrachord Lib, a lightweight library modification designed to optimize diverse data structures. jellysquid3_[4] introduced Lithium, a…
Official listing
- Modrinth page
- modrinth.com/mod/tetrachord-lib
- Owner
- Viola-Siemens
- Published
- 2024-02-27
- Updated on Modrinth
- 2026-06-02
- Facts verified
- 2026-10-15
