Lootr (Fabric)

Mods
449,620 Downloads Last Updated: Dec 6, 2022 Game Version: 1.19.3   +5

 

Lootr is also available for Forge.

 

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 items you get are unique to you (as though you had opened an Ender Chest). This means no empty chests, and no picking up other people's trash!

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 an eligible container is placed in the world, it is tested to see if it can be converted. This is now retroactive! You can add Lootr to a pre-existing world.

What if I don't want all chests to be available to everyone? Especially when it comes to mods that require you to pass through a dungeon and clear it to obtain loot, there can be balance issues. You can now block certain chests (based on dimension, loot table, loot table's mod ID, or structure), or set chests to Decay, meaning they can only be looted for a pre-determined (and configurable) period of time. See the Refreshing & Decaying section for more info.

 

What could go wrong? This is the compatibility update of Lootr! Hopefully, nothing will actually go wrong; unfortunately, it a loot table has an invalid item in it, this will result in un-openable containers or containers that have nothing inside them. Lootr will report this in the log, and optionally you can configure it to inform the player opening it of what has happened.

For all other issues, please file a report on GitHub including a screenshot of the structure and a list of mods.

 

For developers, please see the For Developers section.

 

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. 

 

Can I break the chests? Yes. If you try to break a Lootr container, 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. Destroying the chest will destroy all items stored in it, even those placed by yourself or other players.

You can configure Lootr to prevent chests from being destroyed outside of creative mode (and even then, it is required for you to sneak).

 

What about data corruption? Will this take up more space? Lootr uses the 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. 

 

Containers

Lootr currently converts the following containers:

  • Vanilla chests (double chests are converted into two single chests)
  • Vanilla barrels
  • Vanilla trapped chests
  • Vanilla shulker boxes
  • Vanilla Minecarts

In addition, you can use the configuration to add additional containers (either chests or trapped chests).

 

Decaying & Refreshing Containers

Containers (including minecarts) can be configured to decay or refresh. This means that, when the container is opened, a count-down of a specified duration begins. Once that count-down completes, the next time someone opens the container, it will be either be destroyed (in the case of a decaying container), or its contents will be regenerated (in the case of refreshing containers).

For options, see Configuration.

 

Commands

The /lootr command can be used by administrators for a variety of purposes.

  • /lootr chest/barrel/cart/shulker - this will generate the relevant block or entity right on you using a random loot table.
  • /lootr chest/barrel/cart/shulker 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.
  • /lootr clear player_name - this will attempt to reset all Lootr chests that player_name may have opened. This means that their state will revert to gold, and new loot will be generated the next time player_name opens that chest.

There are two debug options which may be used to determine specific files to edit. Lootr data is found in the world/data/ folder (or Your_Save_Name/data folder for single-player).

  • /lootr id - This will attempt to print the "id" of a Lootr chest that you are standing upon. This id is used in the file name as follows: "Lootr-chests-dimension-id.dat". 
  • /lootr openers - This will attempt to display in chat the "openers" list of the chest you are standing upon. Please note: this information is output in the form of player UUIDs. It will most likely not be useful for debugging purposes.

 

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.

 

Client Configuration 

  • vanilla_textures: By default, false. When set to true, vanilla textures are used for all containers.

 

Configuration

There are multiple configuration options. 

For decay:

  • decay_value: This option specifies the length of the count-down in ticks (i.e., number of seconds multiplied by 20; default being 5 minutes). 
  • decay_loot_tables: A list of tables (in the format ["minecraft:chest/abandoned_mineshaft"], etc) which will trigger decay.
  • decay_modids: A list of modids whose loot tables (in the format ["minecraft", "lootr"], etc) will trigger decay.
  • decay_dimensions: A list of dimension where all containers will trigger decay (in the format ["minecraft:the_end"], etc)
  • decay_all: An override which causes all loot chests to decay.

For refreshing:

  • refresh_value: This option specifies the length of the count-down in ticks (i.e., number of seconds multiplied by 20; default being 20 minutes). 
  • refresh_loot_tables: A list of tables (in the format ["minecraft:chest/abandoned_mineshaft"], etc) which will trigger refresh.
  • refresh_modids: A list of modids whose loot tables (in the format ["minecraft", "lootr"], etc) will trigger refresh.
  • refresh_dimensions: A list of dimension where all containers will trigger refresh (in the format ["minecraft:the_end"], etc)
  • refresh_all: An override which causes all loot chests to refresh.

For conversion:

  • convert_mineshafts: This option (default true) determines whether or not Minecarts with loot tables should be converted into the Lootr minecart.

Allow/disallow:

  • loot_table_blacklist: A list of loot tables (in the format of ["modid:loot_table_name", ] etc) which should not be converted into Lootr chests.
  • dimension_whitelist: A list of dimensions (in the format of ["modid:dimension_name", "minecraft:overworld"] etc) where Lootr conversions should take place. By default, the blank entry allows all dimensions.
  • dimension_blacklist: A list of dimensions (as per dimension_whitelist) where Lootr conversions should not take place. By default, the blank entry prevents nothing.

Miscellaneous:

  • 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.
  • disable_break: This option prevents Loot containers from being broken unless done so in creative mode while sneaking.
  • report_unresolved_tables: All tables that are unresolved (i.e., Lootr looks up the name of the table but gets the "empty" result instead) are logged into your log file. Enabling this option also sends a message to people who try and fail to open these containers, or open them to find them empty.

 

For Developers

 

All containers that extend RandomizableContainerBlockEntity and have a lootTable set are supported. For help on adding compatibility, please leave a message on my Discord.

 

For Modpack Authors

When a player opens a Lootr container, the loot table associated with it will be provided with the LootItemConditionType "lootr:loot_count", which is the number of players who have previously opened this container.

This allows you to adjust the quantity of loot found in a container depending on the number of times it has previously been opened.

 

Exclusions

By default, there are a few Vanilla-specific chests that cannot be converted by Lootr. These include:

  • The Woodland Mansion "axe" chest found near the tree. 

 

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.

Comments

Posts Quoted: