Skip to content

CoreLib Actions

When EmakiLevel is enabled, it adds level and experience operation stages to the CoreLib action registry. They can be used by other module action lists, such as cooking completion, forge results, strengthen stages, skill rewards, or CoreLib pipeline templates.

NOTE

This page documents only the stages registered by EmakiLevel. CoreLib built-in stages are documented in CoreLib Actions. Current stage IDs use only the canonical names below; historical aliases are no longer registered. The old emakileveladdexp is now written level_add_exp, the others follow the same rule, and the old emakilevellevelup is now level_up.

Stage IDs

All eight stages declare REQUIRED_ENTITY, and non-player targets are skipped.

Stage IDOperationUses amount
level_add_expAdd expYes
level_set_expSet expYes
level_remove_expRemove expYes
level_add_levelAdd levelsYes
level_set_levelSet levelsYes
level_remove_levelRemove levelsYes
level_resetReset one level typeNo
level_upManually level up one typeNo

Parameters

All eight stages accept these parameters:

ParameterTypeRequiredDefaultDescription
typeSTRINGYesLevel type ID, such as main, combat, or mining.
amountEXPRESSIONNo0Experience or level amount. Plain numbers and CoreLib expressions are accepted. Level operations round this value to an integer.
reasonSTRINGNoactionAudit reason passed to the level service.

level_add_exp accepts two more:

ParameterTypeRequiredDefaultDescription
auto_upgradeBOOLEANNotrueWhether to level up automatically when the threshold is crossed.
silentBOOLEANNofalseWhether to suppress the level-up feedback.

level_reset and level_up ignore the value of amount, but still declare the parameter, so passing it is not reported as an unknown argument. auto_upgrade and silent are declared only on level_add_exp; writing them on another stage is an unknown-argument error at load time.

Which player is affected comes from the source, so there is no target parameter any more: use self for the caster, or player_by_name for a named player.

Examples

yaml
actions:
  # Add 50 main exp to yourself
  - 'self | level_add_exp type=main amount=50 reason=forge_reward'

  # Add 1 combat level to yourself
  - 'self | level_add_level type=combat amount=1 reason=boss_reward'

  # Add exp without auto level-up and without feedback
  - 'self | level_add_exp type=main amount=10 auto_upgrade=false silent=true'

  # Set mining exp for a named player
  - 'player_by_name name=PlayerName | level_set_exp type=mining amount=200 reason=admin_adjust'

  # Reset the main level type
  - 'player_by_name name=PlayerName | level_reset type=main reason=admin_reset'

  # Run one manual level-up through the level system
  - 'player_by_name name=PlayerName | level_up type=main'

  # amount as an expression
  - 'self | level_add_exp type=main amount=%var.base%*2+10'

Notes

  • amount is declared as EXPRESSION. Placeholders in the argument text are rendered before the expression is evaluated, so %var.*%, context placeholders written by the calling module, and PlaceholderAPI placeholders can all take part in the arithmetic.
  • Level operations (level_add_level, level_set_level, level_remove_level) round amount to an integer.
  • When the level service declines the operation, the stage fails with REJECTED and reports the service's reason.
  • On success the stage reports type, old_level, new_level, old_exp, new_exp, and amount, so the debug output shows the state before and after.