Skip to content

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
    }
  ]
}
  • populator object that holds the populator data (specifics below)
  • skills object array for skill info:
    • skill the skill key
    • formula the formula that the skill leveling will follow (variables provider by the populator)

Global Variables

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 than max or lower than min

Armor

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

Tool

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

Enchantments

ID: skillz:enchantment_populator

Args:

  • cursed (Default false) (Boolean): Whether it should include curses
  • treasure (Default true) (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 just MIN_POWER + 5)
  • WEIGHT: Its enchantment weight

Generate restriction for enchantments

Mining

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 (Default 0) (Integer): Blocks below this hardness will be skipped
  • max (Default 50) (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

Clone this wiki locally