Magic Find is a player attribute that adds extra rewards to loot tables from containers and entities depending on the number of points the player has.
(It does not replace the original loot.)
When a player opens a container or defeats a configured entity, Magic Find checks the player’s current points and the configuration assigned to that loot table. If activation occurs, the mod selects and adds extra rewards into empty slots, keeping the original loot intact. The player hears an activation sound, and the added items are visually marked.
Place JSON files in:
data/magicfind/mf_inject/
Example:
data/magicfind/mf_inject/my_rewards.json
Use /reload after adding or changing a file.
{
"target": "minecraft:chests/simple_dungeon",
"replace": false,
"rolls_by_mf": {
"0": { "min": 1, "max": 1 },
"2200": { "min": 1, "max": 2 },
"3750": { "min": 1, "max": 3 }
},
"pool": [
{
"item": "minecraft:iron_ingot",
"count_min": 2,
"count_max": 5,
"required_mf": 0,
"weight": 40
},
{
"item": "minecraft:diamond",
"count_min": 1,
"count_max": 2,
"required_mf": 1650,
"weight": 10
}
]
}
targetThe loot table that receives bonus rewards.
"target": "minecraft:chests/simple_dungeon"
Use the complete loot table ID, including its namespace.
Examples:
minecraft:chests/simple_dungeon
minecraft:chests/abandoned_mineshaft
minecraft:chests/end_city_treasure
minecraft:entities/zombie
rolls_by_mfControls the number of bonus reward rolls.
"rolls_by_mf": {
"0": { "min": 1, "max": 1 },
"2200": { "min": 1, "max": 2 },
"3750": { "min": 1, "max": 3 }
},
The highest Magic Find threshold reached by the player is used. In this example:
0: 1 bonus roll.2200: 1 to 2 bonus rolls.3750: 1 to 3 bonus rolls.A number creates a fixed amount of rolls. min and max create a random range.
poolThe list of rewards that can be added.
Each reward uses:
{
"item": "minecraft:diamond",
"count_min": 1,
"count_max": 2,
"required_mf": 1650,
"weight": 10
}
item: the item ID.count_min: minimum amount.count_max: maximum amount.required_mf: Magic Find required to unlock the reward.weight: relative chance of selection.A reward with weight 20 is selected twice as often as an eligible reward with weight 10.
Create a pool that fits the container you are modifying. For example:
Use higher required_mf values for stronger rewards and lower weight values for rarer rewards.
Players can gain Magic Find from:
Higher Magic Find can unlock better rewards and increase the number of bonus rolls.
Configurations can be added through a datapack using the same path:
<datapack>/data/magicfind/mf_inject/my_rewards.json
Datapacks allow you to add or change rewards without modifying the mod's Java code.
Magic Find supports vanilla loot tables, modded loot tables and Lootr containers. Attribute Core is required for the Magic Find progression system.
Do you have new ideas, improvements for my mods, or have you found a bug? This is the perfect place to share them!
In our Discord community you can:
💡 Submit proposals and suggestions for improving the mods.
🛠️ Report problems and bugs so we can fix them together.
🎮 Show your creativity: you're free to use my mods in your own modpacks.
📢 Share your modpack on the server and show the community your unique style.
This space is designed for us to grow together, with respect and enthusiasm for creating mods and modpacks. Your contribution is always welcome!
