-
Notifications
You must be signed in to change notification settings - Fork 7
Item Profiles
Item profiles define which items can level up and link them to trigger, reward, and display profiles.
plugins/LevelTools/item_profiles.yml
profiles:
profile_id:
materials:
- DIAMOND_PICKAXE
- IRON_PICKAXE
trigger_profiles: # XP from all matching profiles is combined into one gain
- block_mining
reward_profile: tools
display_profile: default
max_level: 100
level_xp_formula: "100 + {current_level} * 100" # Optional| Option | Description | Required |
|---|---|---|
materials |
List of item materials | Yes |
trigger_profiles |
List of IDs from trigger_profiles.yml. If several profiles match the same action, their XP is added together and granted as a single XP gain. A deprecated singular trigger_profile form exists in code but is not the supported usage. |
Yes (at least one) |
reward_profile |
ID from reward_profiles.yml | Yes |
display_profile |
ID from display_profiles.yml | Yes |
max_level |
Maximum level for these items | No (defaults to 100, or inherited via extends) |
level_xp_formula |
Override configured global and permission XP formulas | No |
extends |
Inherit from another profile | No |
Each material can only belong to ONE item profile. If the same material appears in multiple profiles, LevelTools will fail to load and log an error.
# This will cause an error:
pickaxes:
materials:
- DIAMOND_PICKAXE # Duplicate!
special_pickaxes:
materials:
- DIAMOND_PICKAXE # Error: already in pickaxes profilepickaxes:
materials:
- WOODEN_PICKAXE
- STONE_PICKAXE
- IRON_PICKAXE
- GOLDEN_PICKAXE
- DIAMOND_PICKAXE
- NETHERITE_PICKAXE
trigger_profiles:
- block_mining
reward_profile: tools
display_profile: default
max_level: 100axes:
materials:
- WOODEN_AXE
- STONE_AXE
- IRON_AXE
- GOLDEN_AXE
- DIAMOND_AXE
- NETHERITE_AXE
trigger_profiles:
- block_mining
reward_profile: tools
display_profile: default
max_level: 100shovels:
materials:
- WOODEN_SHOVEL
- STONE_SHOVEL
- IRON_SHOVEL
- GOLDEN_SHOVEL
- DIAMOND_SHOVEL
- NETHERITE_SHOVEL
trigger_profiles:
- block_mining
reward_profile: tools
display_profile: default
max_level: 100swords:
materials:
- WOODEN_SWORD
- STONE_SWORD
- IRON_SWORD
- GOLDEN_SWORD
- DIAMOND_SWORD
- NETHERITE_SWORD
trigger_profiles:
- combat
reward_profile: swords
display_profile: default
max_level: 100bows:
materials:
- BOW
trigger_profiles:
- combat
reward_profile: bows
display_profile: default
max_level: 100crossbows:
materials:
- CROSSBOW
trigger_profiles:
- combat
reward_profile: crossbows
display_profile: default
max_level: 100fishing_rods:
materials:
- FISHING_ROD
trigger_profiles:
- fishing
reward_profile: fishing_rods
display_profile: default
max_level: 100tridents:
materials:
- TRIDENT
trigger_profiles:
- combat
reward_profile: tridents
display_profile: default
max_level: 100hoes:
materials:
- WOODEN_HOE
- STONE_HOE
- IRON_HOE
- GOLDEN_HOE
- DIAMOND_HOE
- NETHERITE_HOE
trigger_profiles:
- farming
reward_profile: hoes
display_profile: default
max_level: 100Use extends to inherit settings from another profile, then override specific options.
profiles:
pickaxes:
materials:
- WOODEN_PICKAXE
- STONE_PICKAXE
- IRON_PICKAXE
- GOLDEN_PICKAXE
- DIAMOND_PICKAXE
trigger_profiles:
- block_mining
reward_profile: tools
display_profile: default
max_level: 100
netherite_pickaxes:
extends: pickaxes
materials:
- NETHERITE_PICKAXE
max_level: 150 # Override max levelThe netherite_pickaxes profile inherits trigger_profiles, reward_profile, and display_profile from pickaxes, but has its own materials and max level.
Override configured xp_formulas for specific item types:
legendary_swords:
materials:
- NETHERITE_SWORD
trigger_profiles:
- combat
reward_profile: swords
display_profile: default
max_level: 200
level_xp_formula: "500 + {current_level} * 250" # Harder to levelItem profile formulas take priority over both the global formula and permission-selected formulas from config.yml.
Formula priority:
- This profile's
level_xp_formula - First matching
leveltools.formula.<id>permission formula fromconfig.yml xp_formulas.global
If a parent profile has level_xp_formula, child profiles inherit it unless they define their own.
Like the formulas in config.yml, level_xp_formula must return a positive value for every level from 0 to 1000. Profiles with an invalid formula are rejected with an error when profiles load.
First, create a trigger profile in trigger_profiles.yml:
profiles:
shearing:
type: BLOCK_BREAK
xp_modifier:
default:
min: 1.0
max: 2.0
filter:
type: WHITELIST
list:
- "GRASS"
- "TALL_GRASS"
- "FERN"
- "LARGE_FERN"
- "COBWEB"
- "OAK_LEAVES"Then create a reward profile in reward_profiles.yml:
profiles:
shears:
levels:
5:
- "enchant2 efficiency 1"
10:
- "enchant2 fortune 1"
20:
- "enchant2 efficiency 3"
30:
- "enchant2 fortune 2"Finally, add the item profile in item_profiles.yml:
profiles:
shears:
materials:
- SHEARS
trigger_profiles:
- shearing
reward_profile: shears
display_profile: default
max_level: 50profiles:
shields:
materials:
- SHIELD
trigger_profiles:
- right_click # define a custom RIGHT_CLICK trigger profile in trigger_profiles.yml
reward_profile: shields
display_profile: default
max_level: 30