Skip to content

Chests & Loot Generation

Tempest051 edited this page Apr 30, 2024 · 4 revisions

Page Index

Generation Tags
Creating An Inventory Generation Tag
Create External Loot Tables

Loot Basics

All container inventories within a structure are preserved when it is exported. This can be used to generate an identical set of items in that structure each time, if you wish to always give players a specific set of loot. However, if you want to randomize the loot generated in inventories, you'll need a "inventory generation tag" item.

Generation Tags

Inventory generators are items that randomize chest loot. Their name is determined by the component ID set upon saving them. RC comes with several default generation tags for its structures, and also generates ones for each loaded loot table. When a generator tag is inside a properly coded container (chest, dispenser, or mod containers), it will activate the saved generation component or loot table and fill the container when the RC structure generates. These will only fire on structure generation, so can still be edited by importing a structure. You can also test them by shift right clicking on a container to generate items inside. While you can place as many tags as you want inside a container, placing too many will cause container overfill errors which will stop filling once the container is full. While this won't actually break anything, it does create worldgen lag.

Generation tags come in Inventory Generation tag and Component Generation tag types. A Component Generation Tag is essentially a single tag which can generate one item stack from the items it has saved, based on their weights. An Inventory Generation Tag is like a set of Component Tags, and will generate multiple items in a container. These are both generated and added to the creative "tags" tab when saving a generation tag that you're editing.
Tags creative tab

There are two ways to edit custom loot generation in containers:

Creating An Inventory Generation Tag

To create an Inventory Generation Tag, you'll need to first create some Component tags. Get the "Create New Generator" item from the tags tab (the first half broken black circle), and right click. This will bring up the editor GUI.
Tags creative tab

WIP

Create External Loot Tables

The arguably easier method would be to create an external loot table using a mod like CraftTweaker and its addons. Since Recurrent Complex registers any loaded loot table as a Generation Tag, you can create a loot table through a CT script and have a tag generated automatically.

Clone this wiki locally