ItemStringParser
A library for parsing Item Strings. Does nothing on its own.
About this mod Author’s original text
ItemStringParser
This mod is a library for parsing ItemStrings. See bottom on the developer manual.
User Manual
ItemStrings are a way to describe a droptable using plain text. They let you describe what items should appear and how many in a simple, readable line. ItemStrings can include instructions for repeating items, choosing items randomly, or excluding certain items.
ItemString Operators
ItemString operators are symbols that help you decide which items to give, repeat, or exclude in a list. They make it easy to write rules like "give this item", "skip that one", or "choose one randomly" using short codes. Each entry in the ItemString roughly follows the format:
x!*:
Entries can be separated by & or |. Entries can be grouped with { and }.! (Not-Operator)
- Purpose: Blacklist items from tiers or droptables.
- Placement: Directly after the name of the droptable or tier.
- Example:
- Tier1!Hoof - White item but not a Hoof
- dtChest1!Bear!Crowbar - Content of a Small Chest but neither Tougher Times nor Crowbar.
& (And-Operator)
- Purpose: Every item separated by & will be selected.
- Example:
- Hoof & Boss - The player receives both a Hoof and a random Boss item.
| (Or-Operator)
- Purpose: Only one of the items separated by | will be chosen at random.
- Weights: You can specify selection weights using a colon: after the item (e.g., Tier1: 0.5 | Tier2: 0.5).
- Example:
- Tier1 | Tier2 - The player gets either a Tier1 or a Tier2 item (equal chance unless weighted).: (Weight Separator)
- Purpose: Assigns probability weights to options with the Or-Operator (|).
- Default: If omitted, the default weight 1 is used.
- Example:
- Tier1: 0.6 | Tier2: 0.4 - Tier1 has a 60% chance, Tier2 a 40% chance.
- Tier1: 3.0 | Tier2 - Tier1 has a 75% chance, Tier2 a 25% chance.
x (Repeat-Operator)
- Purpose: Repeats the immediately following item or group a fixed number of times.
- Placement: Directly before a group or item.
- Example:
- 5xHoof - The player gets 5 Hoof items.
- 3x{ Tier1 | Tier2 } - The player gets 3 times a randomly selected item from Tier1 or Tier2.
- (Multiplier-Operator)
- Purpose: Multiplies the amount of items of a group.
- Placement: Directly after a group or item.
- Example:
- Hoof*5 - The player gets 5 Hoof items.
- { Tier1 | Tier2 }*3 - The player gets 3 copies of a single type of item from either Tier1 or Tier2.
{ and } (Grouping Symbols)
- Purpose: Group items and operators together. Can use & and | within a group, but they cannot be mixed.
- Operator precedence: Use { } to explicitly control grouping and order of operations, especially when combining repeat, and, or multiply.
- Nested groups: You can nest { } for more complex item generation logic.
- Example:
- { 2xdtChest1 | dtChest2 } - Represents a choice between "2x small chest" and "1 large chest" as a single entity; useful with other operators.
Summary Table
| Operator | Symbol | Description | Example |
|----------|--------|-----------------------------------------------------------|-----------------------|
| Not |! | Blacklists the item from the group | A!B |
| And | & | All items, together | A & B |
| Or | \| | Only one item, random (optional weight via:) | A \| B:0.7 \| C:0.3 |
| Weight |: | Specifies probability weight for options when using \| | A: 0.6 \| B: 0.4 |
| Repeat | x | Repeats the following item/group N times | 5xA or 3x{A \| B} |
| Multiply | ` | Multiplies the amount of items in the group by N | {A & B}4` |
| Grouping | {} | Groups items/expressions | {A & 2xB} |
Examples
A random lunar item, except for Light Flux Pauldron and Stone Flux Pauldron:
ItemList = Lunar!HalfSpeedDoubleHealth!HalfAttackSpeedHalfCooldowns
5 Hooves:
ItemList = 5xHoof
Also 5 Hooves:
ItemList = Hoof*5
5 random whites:
ItemList = 5xTier1
5 copies of the same white:
ItemList = Tier1*5
5 Hooves and 2 Armor Plates:
ItemList = 5xHoof & 2xArmorPlate
Either 5 Hooves or 2 Armor Plates:
ItemList = 5xHoof | 2xArmorPlate
Either 5 Hooves with 30% c
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.