Loot Patcher
This mod is specifically designed for modpacks and allows adding new loot items to existing loot tables.
Configuration
By default, the mod does not make any changes to loot tables.
Configuration Files
The mod reads all JSON files in the config/loot-patcher/ directory as configuration files. Example file structure:
[
{
"target_tables": [...],
"extra_tables": [...]
}
]
If Cloth Config is installed, settings can be edited through the config/loot-patcher.json file:
{
"patches": [
{
"target_tables": [...],
"extra_tables": [...]
}
]
}
The mod is compatible with ModMenu, allowing configuration directly in-game through the configuration screen.
Applying Changes
After modifying settings, you need to reload the datapack by executing the /reload command in-game.
Example Usage
Consider an example configuration file loot-patcher.json:
{
"patches": [
{
"target_tables": [
"minecraft:chests/ancient_city",
"^(?!.xxx).entities." // Regular expression support
],
"extra_tables": [
"xxx:entities/common_drop",
"xxx:entities/rare_drop"
]
}
]
}
This configuration will add two loot pools: to the loot table with ID minecraft:chests/ancient_city and to all tables with IDs containing entities but not containing xxx. Items will be taken from the xxx:entities/common_drop and xxx:entities/rare_drop tables.
Important Warning
Avoid creating infinite loops in loot tables during configuration. For example, the following configuration may cause issues:
{
"target_tables": ["."],
"extra_tables": ["minecraft:entities/zombie"]
}
In this case, the target loot tables include additional tables. When killing a zombie, its loot table will attempt to drop itself, leading to infinite recursion.