QUARK INCOMPATIBILITY
You must disable Quark's option that replaces world generation chests with its own chests before world generation in order for Lootr to be function properly, as it cannot currently replace Quark's chests. I hope to rectify this issue in a future update.
What is Lootr? It's simple: unique inventories for every loot chest for every player on a server.
What does that mean? When you open a loot chest (distinctly textured from Vanilla chests), what you see in it is unique to you. Nobody's dumped junk (unless you dumped your own junk!), and no empty chests.
How does this help? For multiplayer servers, especially those with mods that depend on items looted from chests, it means finding loot closer to home. No more extensive, server-draining trips generating hundreds of chunks in search of a fresh chest.
How does it work? Any time a creates a loot chest or loads one from NBT, it will be replaced with a Lootr chest. This also includes barrels and trapped chests. For a more detailed explanation, see below.
What could go wrong? In theory, not a lot:
- World generation crashes are gone due to robust Structure Processors.
- Lootr chests may theoretically & rarely spawn and be un-openable, although this has not yet been reported.
- You may find theoretically Vanilla chests spawned with loot that weren't replaced by Lootr chests, but this has not yet been reported.
For these last two, it is likely a compatibility issue between this mod and another. Please file an issue report with screenshots of the structure and a mod list so that I can see about replicating and adding an exception.
What will happen if I remove this mod? As with any mod that you remove from an instance, blocks, entities, items, etc, are removed. This means that every Lootr converted chest will be removed. There is no easy way to avoid this.
Can I break the chests? Yes. If you try to break a Lootr chest, you will receive a notice basically saying "please don't, others may benefit", in case the player is not aware. They are also instructed that if they break the chest while sneaking, it will completely destroy the chest.
What about data corruption? Will this take up more space? Lootr uses the relatively robust WorldSavedData from Vanilla, used in many features and in many mods. Each chest generates a single file for the location, in which are added new inventories whenever a new player opens it.
With even a moderate number of players, the size of these files shouldn't grow to the point of causing concern or corruption. You can view each of these files (and "reset" individual or every loot chest) in the "data" folder inside of the world or save folder.
Commands
The /lootr command can be used by administrators for a variety of purposes.
- /lootr chest/barrel/cart - this will generate the relevant block or entity right on you using a random loot table.
- /lootr chest/barrel/cart minecraft:loot_table - this will generate the relevant block or entity right on you using the specified loot table.
- /lootr custom - this will convert the Vanilla chest that you are standing on into a custom inventory.
Custom Inventories
Custom inventories are identical in function to Lootr chests: every player who opens it will see the same, pre-specified set of items and can take from them (without any randomisation).
These inventories are created by placing a Vanilla chest and placing the items that you wish to be included in the custom inventory, in the slots that you wish them to appear in. Once you are happy with this selection, simply stand on the block and run the admin command /lootr custom to perform the conversion. From this point forward it should function as though it were a normal Lootr chest, except that it gives everyone an exact replica of that original chest inventory instead of randomising it.
Configuration
There are two configuration options:
- randomise_seed: This option (default true) allows for loot to be randomly rolled per chest. If you wish players to gain access to identical loot per chest, set this value to false.
- convert_mineshafts: This option is currently default to true and only affects Vanilla minecarts. For modded Mineshaft structures (like Repurposed Structures), support will be added and the configuration option re-enabled in a future release.
Detailed Explanation
- Lootr injects a Structure Processor to convert loot chests into Lootr chests. No horrible workarounds are required to "catch" loot chests from NBT.
- The "generateChest" function used by a number of structures to create and place a loot chest injects a Lootr chest instead of a default Vanilla chest instead.
- The "generateChest" function used by Mineshafts defers to the default "generateChest", preventing minecarts from being spawned.
- The "generate" function used by DungeonsFeature (the underground dungeon with chest, spawner & mossy/normal cobblestone) also replaces a Vanilla chest with a Lootr chest.
- The static "setLootTable" function used by a number of older Vanilla structures (End Cities, Shipwrecks) is potentially the most complex Mixin, as it must manually replace both the chest (with correct facing and waterlogging) and the chest's tile entity.
Areas where Lootr may fail to replace a chest likely indicate that the chest is manually created and the loot table is set via the tile entity, rather than the static "setLootTable" function, or some other method that isn't used in Vanilla.
Video
Vallen from Mischief of Mice has graciously created this bit-by-bit video roughly covering the basics of Lootr:
Patreon & Discord
You can support me on Patreon!
All support for this mod is available on my Discord. You can also keep up with what I'm doing and get notifications streams!
For all other support, please hit "Issues" at the top of this page.
