Skip to content

PlaceholderAPI

dnocturne edited this page Jan 19, 2026 · 1 revision

PlaceholderAPI

Afflictions provides full PlaceholderAPI integration for use with scoreboards, TAB plugins, chat formatting, and more.

Requirements

  • PlaceholderAPI installed
  • Expansion auto-registers when PlaceholderAPI is detected

General Placeholders

Placeholder Description Example
%afflictions_count% Total active afflictions 2
%afflictions_list% Comma-separated affliction IDs vampirism, weakness
%afflictions_has_any% Has any affliction true / false

Affliction-Specific Placeholders

Replace <id> with the affliction ID (e.g., vampirism, weakness, blindness, decay).

Status

Placeholder Description Example
%afflictions_has_<id>% Has this affliction true / false
%afflictions_level_<id>% Affliction level (0 if none) 3

Display (empty if not afflicted)

Placeholder Description Example
%afflictions_<id>_name% What player "is" Vampire
%afflictions_<id>_affliction% Affliction name Vampirism
%afflictions_<id>_prefix% Chat prefix [V]
%afflictions_<id>_title% Level title Elder

Details

Placeholder Description Example
%afflictions_<id>_level% Current level 3
%afflictions_<id>_permanent% Is permanent true / false
%afflictions_<id>_duration% Duration in ms (-1 if permanent) 600000
%afflictions_<id>_contracted% Timestamp when contracted 1705680000000

Blood Placeholders (Vampirism)

Placeholder Description Example
%afflictions_vampirism_blood% Current blood level 75.5
%afflictions_vampirism_blood_max% Maximum blood 100
%afflictions_vampirism_blood_percent% Blood percentage 76

Curse Placeholders

Placeholder Description Example
%afflictions_curse_count% Number of active curses 2
%afflictions_curse_list% Comma-separated curse names Curse of Weakness, Curse of Decay

Time Placeholders

Requires online player (uses player's world).

Placeholder Description Example
%afflictions_time% Time with symbol β˜€ Day or πŸŒ• Full Moon
%afflictions_time_raw% Simple time day / night
%afflictions_moon_phase% Moon phase name Full Moon
%afflictions_moon_symbol% Moon phase symbol πŸŒ•

Moon Phases

Phase Symbol
Full Moon πŸŒ•
Waning Gibbous πŸŒ–
Last Quarter πŸŒ—
Waning Crescent 🌘
New Moon πŸŒ‘
Waxing Crescent πŸŒ’
First Quarter πŸŒ“
Waxing Gibbous πŸŒ”

Custom Data Placeholders

Access custom data stored on affliction instances:

%afflictions_data_<id>_<key>%

Example: %afflictions_data_vampirism_last_fed%


Usage Examples

TAB Plugin (TABlist)

header:
  - "&7Affliction: %afflictions_vampirism_prefix%%afflictions_vampirism_title%"

Scoreboard (FeatherBoard)

lines:
  - "&c🩸 Blood: &f%afflictions_vampirism_blood%/%afflictions_vampirism_blood_max%"
  - "&7Time: %afflictions_time%"

Chat Format (EssentialsX/LuckPerms)

%afflictions_vampirism_prefix%{displayname}: {message}

Result: [V] Steve: Hello!

Conditional Display

Show prefix only if afflicted:

%afflictions_vampirism_prefix%

Returns empty string if player is not a vampire, so it works seamlessly.

DeluxeMenus

items:
  vampire-status:
    material: REDSTONE
    display_name: "&cVampire Status"
    lore:
      - "&7Level: &f%afflictions_vampirism_level%"
      - "&7Title: &f%afflictions_vampirism_title%"
      - "&7Blood: &c%afflictions_vampirism_blood%&7/&c%afflictions_vampirism_blood_max%"
    view_requirement:
      requirements:
        is_vampire:
          type: string equals
          input: "%afflictions_has_vampirism%"
          output: "true"

Troubleshooting

Placeholders show as literal text

  1. Ensure PlaceholderAPI is installed
  2. Run /papi reload
  3. Check that Afflictions loaded: /papi list should show afflictions

Blood placeholders return 0

  • Player must be a vampire
  • Blood system must be enabled in config

Time placeholders empty

  • Requires online player
  • Offline players return empty string