XML: <ChestConfiguration> <ItemPool> <Item type="CopperShortsword"/> <ItemSet> <Item type="MiningHelmet"/> <Item type="MiningShirt"/> <Item type="MiningPants"/> </ItemSet> </ItemPool> <Item type="HermesBoots"/> </ChestConfiguration>

"type" - This specifies which item will be put in the chest. This usually means the name of the item just with spaces removed, but there are some cases where the internal name does not match the display name.

"modName" (optional) - This specifies the name of the mod that the item is from. This should not be provided for vanilla items, and is required for modded items. Example: XML: <Item modName="WeaponsOfMassDecoration" type="PaintStaff"/>

"min" (optional) - For items that stack, this specifies the minimum quantity of the item. If no maximum is provided, it will be the quantity of the item. Example: XML: <Item type="GoldCoin" min="5"/>

"max" (optional) - For items that stack, this specifies the maximum quantity of the item. If no minimum is provided, the minimum will default to 1. A random number will be picked between the min and max values to get the quantity of the item. Example: XML: <Item type="CopperCoin" min="40" max="80"/>

"appearanceChance" (optional) - To give an item a chance to not show up at all, you can specify a number between 0 and 1. Example: XML: <!-- This item will have a 50% chance to show up in the chest --> <Item type="SuspiciousLookingEye" appearanceChance=".5"/>

"appearanceChance" (optional) - To give an entire set of items a chance to not show up at all, you can specify a number between 0 and 1. Example:

XML: <ItemSet appearanceChance=".25"> <Item type="FlareGun"/> <Item type="Flare" min="15" max="30"/> </ItemSet>

XML: <ChestConfiguration> <!-- This ItemPool has 3 child elements, so there are 3 options for what will be added to the chest. --> <ItemPool> <!-- This whole set is option 1 --> <ItemSet> <Item type="PharaohMask"/> <Item type="PharaohRobe"/> </ItemSet> <!-- This is option 2 --> <Item type="SandstormInABottle"/> <!-- This is option 3 --> <Item type="FlyingCarpet"/> </ItemPool> </ChestConfiguration>

"appearanceChance" (optional) - The give a chance that none of the items in the pool will show up at all, you can specify a number between 0 and 1. Example:

XML: <!-- There is a 75% chance that an option from this pool will be added --> <ItemPool appearanceChance=".75"> <!-- options --> </ItemPool>

"avoidDuplicates" (optional) - Enabling this attribute will make it so multiple chests filled with the same configuration will exhaust all possible options from the pool before reusing the same option. If the configuration in the example below were used to fill 3 chests, the player that opens them would be guaranteed to be able to make a Fish Finder! Example: XML: <ChestConfiguration> <ItemPool avoidDuplicates="true"> <Item type="FishermansGuide"/> <Item type="WeatherRadio"/> <Item type="Sextant"/> </ItemPool> </ChestConfiguration>

XML: <ChestConfiguration> <ItemPool> <Item type="GoldCoin" weight="1"/> <Item type="SilverCoin" weight="2"/> <Item type="CopperCoin" weight="3"/> </ItemPool> </ChestConfiguration>

XML: <ChestConfiguration> <ItemPool avoidDuplicates="true"> <ItemSet> <ItemSet appearanceChance=".5"> <Item type="MagicPowerPotion" min="3" max="7"/> <Item type="ManaRegenerationPotion" min="3" max="7"/> </ItemSet> <Item appearanceChance=".5" type="IronskinPotion" min="3" max="6"/> <ItemPool avoidDuplicates="true"> <Item type="EndurancePotion" min="2" max="5"/> <Item type="SwiftnessPotion" min="4" max="8"/> <Item type="ShinePotion" min="3" max="6"/> <ItemSet> <Item type="MasterBait" min="3" max="7"/> <Item type="FishingPotion" min="5" max="8"/> <Item type="SonarPotion" min="6" max="10"/> </ItemSet> </ItemPool> </ItemSet> <ItemSet> <Item type="FlareGun"/> <ItemPool> <Item type="Flare" min="10" max="20" weight="3"/> <Item type="BlueFlare" min="10" max="20"/> <!-- if weight is excluded it defaults to 1 --> </ItemPool> </ItemSet> <Item type="MagicMirror"/> <Item type="LifeCrystal" min="2" max="5"/> </ItemPool> <Item type="HealingPotion" min="2" max="5"/> <ItemPool> <Item type="GoldCoin" max="2"/> <Item type="SilverCoin" min="10" max="40" weight="2"/> <Item type="CopperCoin" min="40" max="80" weight="3"/> </ItemPool> </ChestConfiguration>

This mod uses XML config files for determining the contents of chests. It's a bit complicated, which is why I'm not sure how to adapt them the the built in json config system, but all the information for how to edit them is described below.If you ever want to restore the config files back to their defaults, you can just delete them. They will then be regenerated the next time you create a world.It should also be noted that if any errors occur while reading the config files, they will be regenerated and lose any edits that may have been made to them. I may make it more forgiving at a later point, but for now I just went the safer route.This system is also not currently set up to handle items that aren't from the vanilla game. That'll be a thing for me to add later.Anyways, onto the actual config files. Here is the basic structure that they all follow:Every chest config starts off the same way, with a "ChestConfiguration" element. Inside of the ChestConfiguration element, you can have "ItemPool", "ItemSet", and "Item" elements.The Item tags are ultimately the things that will be put in the chest, and they can have the following attributes:The ItemSet tag specifies a grouping of Item tags that will be put in the chest. The purpose is mainly for all-or-nothing groups of items. An example in the vanilla game is the Pharaoh vanity in pyramid chests. You can either find both the mask and the robe in the chest, or you can find neither, but you cannot find only one of them. These 2 items would be in an ItemSet together.The ItemSet tag can also have the following attributes:It should also be noted that the "ChestConfiguration" tag is essentially just a glorified ItemSet tag, and it can contain any combination of ItemPool, ItemSet, and Item tags all the same.The ItemPool tag specifies a selection between different items. Only one of the child elements will actually contribute to what is put in the chest, and it is picked at random. You can also have ItemSet elements nested within ItemPool tags. Going back to the pyramids from the vanilla game, this is how you would make a chest generate with either a Sandstorm in a Bottle, a Flying Carpet, or a combination of the Pharaoh vanity items.The ItemPool tag can also have the following attributes:Additionally, any of the child elements within an ItemPool can be given a "weight" attribute. This number will be used to make some options more likely than others. Example:In the above example, there would be a 1 in 6 chance of getting a gold coin, a 2 in 6 (or 1 in 3) chance of getting a silver coin, and a 3 in 6 (or 1 in 2) chance of getting a copper coin. (chances are out of 6 because that's the sum of the weights specified. 1 + 2 + 3)The ItemPool and ItemSet tags support infinite nesting (theoretically), and there's nothing stopping you from putting an ItemPool inside of an ItemSet that is inside of an ItemPool and so on.This configuration, while rather over the top, is totally valid:Feel free to ask any question about these configuration files below. It will let me know if I need to update my explanation to make it more clear!