Custom Placeholders

Custom placeholders let you reuse a value, a math expression, or a conditional lookup, and share data between plugins. You define them in one file and reference them as %libreforge_<id>%, with full PlaceholderAPI support. This page covers creating one, naming it, and the three kinds of placeholder you can build.

Quick start

  1. Open the placeholders.yml file in /plugins/libreforge.

  2. Add a placeholder under placeholders: with an id and a value.

  3. Run /libreforge reload.

  4. Reference it anywhere as %libreforge_<id>% and confirm it resolves to your value.

Naming and IDs

Each placeholder needs an id. You reference it as %libreforge_<id>%, so a placeholder with id: example_placeholder is used as %libreforge_example_placeholder%.

The structure of a placeholder

PartWhat it controls
Static valueA fixed text or number
Expression valueA math expression resolved on use
Conditional valueA value chosen by conditions, with a default
placeholders:
  - id: "example_placeholder" # === Static value ===
    value: "This is an example placeholder!" # The value returned

  - id: "example_expression_placeholder" # === Expression value ===
    value: "%level% * 2" # Math expressions are fully supported

  - id: "conditional_placeholder" # === Conditional value ===
    default: 5 # Optional; the value when no conditions match
    values:
      - conditions: # Full condition system support
          - id: has_permission
            args:
              permission: "ecomc.rank.netherite"
        value: 20
      - conditions:
          - id: has_permission
            args:
              permission: "ecomc.rank.diamond"
        value: 10

Static value

The simplest placeholder returns a fixed string or number.

- id: "example_placeholder"
  value: "This is an example placeholder!" # Returned as-is

Expression value

A value can be a math expression, resolved each time the placeholder is read.

- id: "example_expression_placeholder"
  value: "%level% * 2" # Math expressions are fully supported

Conditional value

Use values to return different results based on conditions, with an optional default for when none match. The first matching entry wins.

- id: "conditional_placeholder"
  default: 5 # Optional; used when no conditions match
  values:
    - conditions:
        - id: has_permission
          args:
            permission: "ecomc.rank.netherite"
      value: 20
    - conditions:
        - id: has_permission
          args:
            permission: "ecomc.rank.diamond"
      value: 10

Where to go next

  • Conditions: Configuring a Condition for conditional placeholder values.

  • Arguments: Custom Arguments to reuse effect logic, not just values.

  • Points: The Points System for per-player data you can read in placeholders.