Lithium (Forge) - Minecraft Optimization Mod
Attention: Support for the Forge version has been discontinued, and all download files have been archived. Lithium development continues exclusively for the Fabric platform. New versions of the mod are available on the corresponding CurseForge page. Releases on this page are no longer updated and do not receive technical support. Using these versions is not recommended due to their unstable quality.
What is Lithium?
Lithium is a universal optimization mod for Minecraft that significantly improves the performance of various game systems (physics, mob artificial intelligence, block updates, and others) without changing game mechanics. The mod works on both the client and server sides, and installing it on a server does not require players to have the mod. Thanks to the implemented optimizations, the average server tick execution time is reduced by approximately 45%, making the game much smoother.
Even in single-player games, an "integrated server" operates that processes the world where the player is located. Optimizing the server side frees up computer processor resources for other tasks, leading to increased frame rates and improved game responsiveness. For multiplayer servers, administrators can expect a significant reduction in tick execution time, allowing the hardware to support more active entities, chunks, and players.
If you are not already using it, the Phosphor mod pairs excellently with Lithium and is fully compatible.
Currently, there are no plans to adapt Lithium for Minecraft versions 1.12 and older. These optimizations are designed for modern versions of the game, and many of them are not applicable to older versions because the corresponding systems are either absent or significantly different.
Installation
To operate, you must download and install MixinBootstrap version 1.0.2 or newer into the mods folder. After that, installing Lithium is done the same way as any other Forge mod - simply place the file in the mods folder. To use the mod's advantages, you do not need to create new worlds.
Key Improvements
You might be interested in what specific changes Lithium implements to achieve such impressive results. Here are some of the key optimizations:
Physics Optimization: The entity collision detection system has been significantly improved by reducing the complexity of collision resolution for simple block objects. A more accurate algorithm is used, reducing the number of blocks checked each tick, especially when entities are moving at high speed.
Mob AI Enhancement: For some tasks, an event-based system is applied, reducing processor load from constantly polling the world for changes. Mob "brains" are optimized for faster selection between different artificial intelligence tasks.
Chunk Loading Optimization: Temporary data structures used in block palette compression have been replaced with more efficient ones. This reduces TPS drops when players explore territory and slightly speeds up world loading. Some verification operations are combined to reduce unnecessary input/output operations.
Mob Farm Improvement: The mob cramming system has become significantly less resource-intensive because collision resolution between entities is optimized considering the use of simple boxes. This makes mob farms less harmful to server performance.
Block Update Optimization: Overhead during block updates has been reduced, speeding up processes such as stabilizing block updates after chunk generation and the operation of redstone mechanisms. The time to determine if a block needs updating has been reduced from O(n) to O(1), providing significant acceleration when many blocks are being updated.
Redstone Optimization: Redstone wire has been completely rewritten to use breadth-first search when updating states, reducing the number of block updates for dust and other blocks by an order of magnitude. (Experimental feature, disabled by default)
Explosion Improvement: Numerous optimizations have been applied to TNT and explosions, reducing the associated lag without changing behavior. In particular, ray tracing is optimized to reuse the results of previous steps when passing through the same block. A faster position tracking algorithm is used, avoiding excessive memory allocations.
Point of Interest Optimization: Complex mob AIs in Minecraft, mainly those of villagers and pillagers, often need to search for relevant points of interest in the world. In the standard version, querying all points in a chunk requires 16 separate operations. With Lithium, this task is reduced to one simple operation using a faster iterative approach, providing a performance improvement of 16-22 times.
Data Tracking System Enhancement: The internal data manager for tracking entity state and properties is optimized to use flat arrays and avoid expensive locks, providing noticeable acceleration when accessing these attributes during a game tick.
... And other internal improvements for better code optimization by the Java Virtual Machine.
Configuration
Lithium uses an unusual configuration system that allows enabling or disabling certain optimizations. This system provides detailed control over the modified code and can be used to completely eliminate errors or incompatibilities with other mods. An empty configuration file is normal and means using the default settings.
Reporting Issues
To report bugs, crashes, and other problems, use the issue tracking system available at the top of the page. The comments section on CurseForge is not intended for reporting such problems.