Community listing page, reviews here may not be monitored by the author.
Fast NBT
No reviews yet
Speed up all kinds of NBT operations and improve game performance
Community voices
Reviews
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
About
Description
Fast NBT makes the NBT work Minecraft does constantly cheaper: reading tags, turning them into game objects, and loading them from chunks, packets, block states and ItemStacks.
CompoundTag
- All kinds of get methods. In the vanilla game it first calls
containsto check whether the key exists, then invokesget— two map lookups. Fast NBT merges those two operations into one and applies inlining, which greatly improves the lookup speed. - Iteration. Iterating with
keySetpaired withgetis replaced by an approach that walks keys and values simultaneously, so writing and merging a compound no longer does a lookup for every entry. - Related classes. Operations that use those get methods in other related classes are optimized too.
ItemStack, block states and NBT I/O
- ItemStack loading. Reading an
ItemStackfrom NBT takestagandForgeCapsstraight from the backing map instead of probing with twocontainscalls, andgetOrCreateTagElement,getTagElementandremoveTagKeyresolve in a single lookup. - Block states.
NbtUtils.readBlockStateandgetDataVersionreadNameandPropertiesdirectly, instead of going through the vanillacontains/getStringchain. - Chunk section palettes. Each palette entry normally goes through the full DFU codec chain — dispatch codec, registry lookup, one
MapCodecper property, plusDataResult/Either/Pair/Optionalallocations — on every chunk load and every save. Fast NBT resolves the canonical{Name, Properties}tag straight from the map. This is the largest win in the mod. - NBT I/O. Unlimited readers — every chunk load, plus level.dat and playerdata — skip a byte-accounting pass whose result is thrown away.
So the gains land where NBT is decoded in bulk: world and chunk loading, server autosaves (which re-encode every chunk), and the inventory, block entity and entity payloads that carry tagged ItemStacks. Fewer temporary objects on the palette path also means less GC pressure.
This is not a general performance mod: it touches nothing outside NBT, and it cannot help a workload that is bounded by disk or network. The savings scale with how much NBT a pack decodes, and are smallest in a plain vanilla world.
Configuration
config/fastnbt.toml is generated on first launch and gives each optimization its own switch:
enabled = true # master switch for everything below
[features.itemStack]
enabled = true
[features.blockState]
enabled = true
[features.blockStateCodec]
enabled = true
[features.nbtIo]
enabled = true
The CompoundTag rewrites have no separate switch; the global enabled flag controls them.
How it stays safe
- Only canonical data takes a fast path. Anything that is not canonical is reported as a decode error instead of being guessed at, and a key in
Propertiesthat the block does not have is ignored, exactly as in vanilla. For chunk palettes the caller turns a failed entry into air, so a world referencing blocks from an uninstalled mod still loads — with one log line per entry. - Encoding is never replaced. The palette optimization only speeds up decoding, so saved chunks and network packets stay byte-identical.
- Injection conflicts. The optimizations replace or redirect vanilla methods and ship no non-destructive variant, so if another mod targets the same method, the last one applied wins. Test large packs before shipping them.
Licensed under the GNU LGPL v3.0 or later.
Screenshots
Gallery
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers