-
Notifications
You must be signed in to change notification settings - Fork 2
Custom Populator
Sygikal edited this page Sep 18, 2025
·
5 revisions
Populators are a way to auto-generate restrictions for skills based on specified item logic.
To get started add the populator directory to a datapack.
In this directory create a json file (eg custom_armor_populator.json).
{
"populator": {
"type": "skillz:armor_material",
"whitelist": [],
"blacklist": [],
"item_blacklist": []
},
"skills": [
{
"skill": "defense",
"base": 0,
"multiply": 2
}
]
}
-
populatorobject that holds the populator data (specifics below) -
skillsobject array for skill info:-
skillthe skill key -
formulathe formula that the skill leveling will follow (variables provider by the populator)
-
These can be used in any formula:
-
SKILL_MAX: Max level for the given skill -
min(x, y): Returns the smallest of two numbers -
max(x, y): Returns the largest of two numbers -
sqrt(x): Square root sin, cos, tan-
clamp(value, min, max): Ensures the value will not be greater thanmaxor lower thanmin
ID: skillz:armor_material
Args:
-
whitelist(Optional) (String Array): If filled, only these armor materials will get generated -
blacklist(Optional) (String Array): String name of armor materials to skip -
item_blacklist(Optional) (Identifier Array): IDs of items to skip
Variables:
-
TOTAL_PROT: Total protection offered by the set -
TOTAL_TOUGH: Total toughness offered by the set -
TOTAL_KB_RES: Total knockback resistance offered by the set -
PIECES: How many pieces there are in the set
Generate restriction for armor material
ID: skillz:tool_material
Args:
-
tool_type(String): Which tool type should be calculated-
ALL,PICKAXE,AXE,SWORD,SHOVEL,HOE
-
-
item_blacklist(Optional) (Identifier Array): IDs of items to skip
Variables:
-
MINING_LEVEL: Materials mining level -
ATTACK_DAMAGE: Materials attack damage -
ENCHANTABILITY: Materials enchantability divided by 2 -
MINING_SPEED: Materials mining speed
Generate restriction for tool material
ID: skillz:enchantment_populator
Args:
-
cursed(Defaultfalse) (Boolean): Whether it should include curses -
treasure(Defaulttrue) (Boolean): Whether it should include treasure enchantments -
enchant_blacklist(Optional) (Identifier Array): IDs of enchantments to skip
Variables:
-
MIN_POWER: Enchantment min power based on level -
MAX_POWER: Enchantment max power based on level (which is justMIN_POWER + 5) -
WEIGHT: Its enchantment weight
Generate restriction for enchantments
ID: skillz:mining_populator
Args:
-
tags(Tag Array (No #)): Tags of blocks to be calculated -
tag_blacklist(Optional) (Tag Array (No #)): Blocks in these tags will be skipped -
block_blacklist(Optional) (Identifier Array): IDs of blocks to skip -
min(Default0) (Integer): Blocks below this hardness will be skipped -
max(Default50) (Integer): Blocks above this hardness will be skipped
Variables:
-
RESISTANCE: Blocks resistance (Same as hardness most of the time) -
HARDNESS: Blocks hardness
Generate restriction for enchantments