Conditional Item Entry
A loot pool entry that only generates loot if the specified item exists in the registry. Unlike the conditional item function, this entry type fails silently if the item is not found, preventing the entire entry from generating.Entry Type ID
Parameters
The item ID to check and generate.Example:
"your_mod:jade_gem"The number of items to generate. Can be a constant number or a loot number provider.Default:
1The weight of this entry in the pool. Higher weights increase selection probability.
Quality modifier that can be affected by luck. Positive values increase with luck, negative values decrease.
List of loot conditions that must pass for this entry to be selected.
List of loot functions to apply to the generated item stack.
Behavior
- Checks the item registry before generating loot
- If the item ID is not registered, the entry produces no loot (fails silently)
- If the item exists, generates the item stack with the specified count
- Applies all loot functions to the stack before returning
- Minimum count is clamped to 1 even if the provider returns less
Count Providers
Thecount parameter supports various number provider types:
Constant value:
Example: Basic Usage
Example: With Weight and Quality
Example: With Conditions and Functions
Comparison: Entry vs Function
More RPG Library provides two ways to handle conditional items:| Feature | Conditional Item Entry | Conditional Item Function |
|---|---|---|
| Type | Loot pool entry | Loot function |
| Fallback | No fallback (silent fail) | Uses original item as fallback |
| Use Case | Optional items that should be skipped if not available | Items that should always drop (with fallback) |
| Pool Impact | Entry is not selected if item missing | Function always processes |
| Count Handling | Supports count providers directly | Requires separate set_count function |
When to Use Each
Use Conditional Item Entry when:- The item is completely optional (mod integration items)
- You want the loot table to remain valid without the item
- You don’t need a fallback item
- You want to set count directly on the entry
- You always need to drop something (with fallback)
- The fallback item is important for game balance
- You need more complex function chaining
Example: Using Both Together
- Tries to drop
special_gemif the mod is loaded (weight 1) - Otherwise falls back to diamond (weight 2), which becomes
upgraded_diamondif that mod is loaded - Ensures something always drops even if both optional mods are missing