More RPG Library provides a powerful loot function for creating spell scrolls from specific spell pools with fine-grained control over tiers and spell selection.
Basic Usage
The specific_spell_scroll_pool loot function allows you to add spell scrolls to loot tables with control over:
- Spell pools (tags or specific spells)
- Minimum and maximum spell tiers
- Number of spells to add
- Blacklisted spells
Loot Function Syntax
{
"type": "minecraft:item",
"name": "spell_engine:scroll",
"functions": [
{
"function": "more_rpg_classes:specific_spell_scroll_pool",
"spell_pools": ["#wizards:frost", "#wizards:fire"],
"spell_tier_min": 3,
"spell_tier_max": 4,
"count": 1,
"blacklist_spells": ["wizards:frost_blizzard", "wizards:fire_meteor"]
}
]
}
Parameters
spell_pools
Type: Array of strings
Required: Yes
Specifies which spell pools to draw from. Supports:
- Spell pool tags (prefixed with
#): "#wizards:frost"
- Specific spell IDs:
"wizards:frost_bolt"
You can mix both types in the same array.
"spell_pools": [
"#wizards:frost",
"#wizards:fire",
"paladins:holy_smite"
]
spell_tier_min
Type: Number provider
Required: Yes
Minimum tier of spells to include. Can be a constant number or a loot number provider.
spell_tier_max
Type: Number provider
Required: Yes
Maximum tier of spells to include. Can be a constant number or a loot number provider.
If spell_tier_min is greater than spell_tier_max, they will be automatically swapped.
count
Type: Number provider
Required: Yes
Number of spells to add to the scroll.
Or with a range:
"count": {
"type": "minecraft:uniform",
"min": 1,
"max": 3
}
blacklist_spells
Type: Array of strings
Required: No
Default: Empty array
Spells to exclude from selection, even if they match the pools and tier criteria.
"blacklist_spells": [
"wizards:frost_blizzard",
"wizards:fire_meteor"
]
Examples
Create scrolls with tier 1-2 frost spells:
{
"type": "minecraft:item",
"name": "spell_engine:scroll",
"functions": [
{
"function": "more_rpg_classes:specific_spell_scroll_pool",
"spell_pools": ["#wizards:frost"],
"spell_tier_min": 1,
"spell_tier_max": 2,
"count": 1
}
]
}
Create scrolls with tier 3-4 spells from multiple schools:
{
"type": "minecraft:item",
"name": "spell_engine:scroll",
"functions": [
{
"function": "more_rpg_classes:specific_spell_scroll_pool",
"spell_pools": [
"#wizards:arcane",
"#wizards:fire",
"#wizards:frost"
],
"spell_tier_min": 3,
"spell_tier_max": 4,
"count": 1,
"blacklist_spells": [
"wizards:arcane_meteor",
"wizards:fire_storm"
]
}
]
}
Random Tier with Multiple Spells
Create scrolls with 2-3 spells of varying tiers:
{
"type": "minecraft:item",
"name": "spell_engine:scroll",
"functions": [
{
"function": "more_rpg_classes:specific_spell_scroll_pool",
"spell_pools": ["#wizards:frost"],
"spell_tier_min": {
"type": "minecraft:uniform",
"min": 1,
"max": 4
},
"spell_tier_max": {
"type": "minecraft:uniform",
"min": 1,
"max": 4
},
"count": {
"type": "minecraft:uniform",
"min": 2,
"max": 3
}
}
]
}
Specific Spell Selection
Create scrolls from specific spells without using pools:
{
"type": "minecraft:item",
"name": "spell_engine:scroll",
"functions": [
{
"function": "more_rpg_classes:specific_spell_scroll_pool",
"spell_pools": [
"wizards:frost_bolt",
"wizards:ice_shard",
"wizards:blizzard"
],
"spell_tier_min": 1,
"spell_tier_max": 4,
"count": 1
}
]
}
Complete Loot Table Example
Here’s a complete loot table for a chest with various spell scrolls:
{
"type": "minecraft:chest",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "spell_engine:scroll",
"weight": 10,
"functions": [
{
"function": "more_rpg_classes:specific_spell_scroll_pool",
"spell_pools": ["#wizards:frost", "#wizards:fire"],
"spell_tier_min": 1,
"spell_tier_max": 2,
"count": 1
}
]
},
{
"type": "minecraft:item",
"name": "spell_engine:scroll",
"weight": 5,
"functions": [
{
"function": "more_rpg_classes:specific_spell_scroll_pool",
"spell_pools": ["#wizards:arcane"],
"spell_tier_min": 3,
"spell_tier_max": 4,
"count": 1,
"blacklist_spells": ["wizards:arcane_missile"]
}
]
}
]
}
]
}
Behavior Notes
If no spells match the specified criteria (pools, tiers, blacklist), the function will return an empty ItemStack for scroll items. For other items, the original item will be returned unchanged.
Avoiding Duplicates: The function automatically prevents adding spells that are already present on the scroll. It also makes up to 3 retry attempts to avoid selecting the same spell multiple times when count > 1.
Implementation Reference
The loot function is implemented in:
net.more_rpg_classes.util.loot.SpecificSpellScrollPoolLootFunction
Function ID: more_rpg_classes:specific_spell_scroll_pool