Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ProfessorFichte/More-RPG-Classes/llms.txt

Use this file to discover all available pages before exploring further.

More RPG Library provides custom loot pool entry types that extend Minecraft’s loot system with registry-aware conditional items.

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

more_rpg_classes:conditional_item

Parameters

item
string
required
The item ID to check and generate.Example: "your_mod:jade_gem"
count
number | object
The number of items to generate. Can be a constant number or a loot number provider.Default: 1
weight
integer
default:"1"
The weight of this entry in the pool. Higher weights increase selection probability.
quality
integer
default:"0"
Quality modifier that can be affected by luck. Positive values increase with luck, negative values decrease.
conditions
array<object>
default:"[]"
List of loot conditions that must pass for this entry to be selected.
functions
array<object>
default:"[]"
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

The count parameter supports various number provider types: Constant value:
"count": 3
Uniform range:
"count": {
  "type": "minecraft:uniform",
  "min": 1,
  "max": 3
}
Binomial distribution:
"count": {
  "type": "minecraft:binomial",
  "n": 10,
  "p": 0.3
}

Example: Basic Usage

{
  "type": "more_rpg_classes:conditional_item",
  "item": "your_mod:jade_gem",
  "count": {
    "type": "minecraft:uniform",
    "min": 1,
    "max": 3
  }
}

Example: With Weight and Quality

{
  "type": "more_rpg_classes:conditional_item",
  "item": "your_mod:rare_crystal",
  "count": 1,
  "weight": 5,
  "quality": 2
}

Example: With Conditions and Functions

{
  "type": "more_rpg_classes:conditional_item",
  "item": "your_mod:enchanted_gem",
  "count": {
    "type": "minecraft:uniform",
    "min": 1,
    "max": 5
  },
  "weight": 10,
  "conditions": [
    {
      "condition": "minecraft:random_chance",
      "chance": 0.25
    }
  ],
  "functions": [
    {
      "function": "minecraft:set_name",
      "name": {"text": "Mystical Gem"}
    }
  ]
}

Comparison: Entry vs Function

More RPG Library provides two ways to handle conditional items:
FeatureConditional Item EntryConditional Item Function
TypeLoot pool entryLoot function
FallbackNo fallback (silent fail)Uses original item as fallback
Use CaseOptional items that should be skipped if not availableItems that should always drop (with fallback)
Pool ImpactEntry is not selected if item missingFunction always processes
Count HandlingSupports count providers directlyRequires 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
Use Conditional Item Function when:
  • 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

{
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "more_rpg_classes:conditional_item",
          "item": "optional_mod:special_gem",
          "weight": 1,
          "count": 1
        },
        {
          "type": "minecraft:item",
          "name": "minecraft:diamond",
          "weight": 2,
          "functions": [
            {
              "function": "more_rpg_classes:conditional_item",
              "conditional_item": "another_mod:upgraded_diamond"
            }
          ]
        }
      ]
    }
  ]
}
This configuration:
  1. Tries to drop special_gem if the mod is loaded (weight 1)
  2. Otherwise falls back to diamond (weight 2), which becomes upgraded_diamond if that mod is loaded
  3. Ensures something always drops even if both optional mods are missing

Build docs developers (and LLMs) love