Skip to content

Placeholder API Data Spell

JasperLorelai edited this page May 19, 2024 · 15 revisions

Source Code

spell-class: ".targeted.ext.PlaceholderAPIDataSpell"

Important

Since 4.0 Beta 13 if you're using this spell to store a placeholder into a variable to then use it in a message or any other similar string like that, you can instead use the %papi MS placeholder directly.

Value Supported
entity true
location false
entity_from_location false

Description:

Requires PlaceholderAPI plugin. When used it will save the value of any placeholder supported by the PlaceholderAPI plugin to a playerstring type variable. Most up-to-date list of placeholders.

Configuration:

Since 4.0 Beta 13 these options support dynamic values through numeric or string expressions.

Options Description Type Default Supports expression
variable-name Variable of playerstring type to save the placeholder value to. String true
placeholderapi-template The placeholder to save to the playerstring variable. This supports bracket placeholders and variable replacement. List of placeholders. String Only the following placeholders: %var, %castervar, %targetvar, and %playervar.
use-target-variables Boolean true true
set-target-variable Boolean false true
set-target-placeholders Target of placeholders. Boolean true true

Example:

Requires the Server PlaceholderAPI expansion. Run /tps to use.

variables:
    String:
        type: playerstring

tps:
    spell-class: ".targeted.ext.PlaceholderAPIDataSpell"
    always-granted: true
    incantations: ["/tps"]
    target-self: true
    variable-name: String
    placeholderapi-template: "%server_tps%"
    str-cast-self: "<dark_aqua>TPS<white>: <aqua>%var:String%"

Note

Since 4.0 Beta 13 you can instead do this:

tps:
    spell-class: ".instant.DummySpell"
    incantations: ["/tps"]
    always-granted: true
    str-cast-self: "<dark_aqua>TPS<white>: <aqua>%papi:server_tps%" 
Clone this wiki locally