Create custom placeholders - AlonsoAliaga/AlonsoPlus GitHub Wiki

How to create custom placeholders? (Since 0.6-BETA ✔️)

To create custom placeholders to parse follow the following format:

Placeholders:
  To-replace: "{COLOR}" #Ignore, you already have this.
  No-ranked: "%vault_prefix%" #Ignore, you already have this.
  Ranked: "%vault_prefix%" #Ignore, you already have this.
  #This is the important part for custom placeholders.
  Custom: #Create as many as you need. PLEASE, DO NOT CREATE THEM UNNECESSARILY
    Enabled: true
    another_prefix: #Example: %alonsoplus_custom_another_prefix%
      #Word that will be replaced after parsing the placeholder.
      To-replace: "{COLOR}"
      #This is the placeholder that will be returned if player is not ranked (If doesnt have the permission in "Permissions.Ranked")
      No-ranked: "%vault_prefix%"
      #This is the placeholder that will be returned and in which color will be replaced. Make sure the prefix of the rank HAS the word specified in "Placeholders.To-replace".
      Ranked: "%vault_prefix%"
    another_prefix_2: #Example: %alonsoplus_custom_another_prefix_2%
      #Word that will be replaced after parsing the placeholder.
      To-replace: "{COLOR}"
      #This is the placeholder that will be returned if player is not ranked (If doesnt have the permission in "Permissions.Ranked")
      No-ranked: "%vault_prefix%"
      #This is the placeholder that will be returned and in which color will be replaced. Make sure the prefix of the rank HAS the word specified in "Placeholders.To-replace".
      Ranked: "%vault_prefix%"

When to use this?

Let's suppose have also a suffix system in your server and you want to use there the color selected from /rankcolor by your player.
You would need to create a new custom placeholder to use it like this:

Placeholders:
  [..] #You already have this, don't copy it.
  Custom:
    Enabled: true #Of course custom placeholders must be enabled. Don't copy it again.
    colored_suffix: #New placeholder will be: %alonsoplus_custom_colored_suffix%
      To-replace: "{COLOR}" #The word replaced with the selected color.
      No-ranked: "%vault_suffix%"
      Ranked: "%vault_suffix%"

This will make that if %vault_suffix% for the player is {COLOR}[SOUL] to look like §a[SOUL] if player has that color selected.
Remember that the placeholder used (in this case %vault_suffix%) MUST include word that will be replaced, in this case {COLOR}.
If it doesnt, nothing will be replaced and placeholder will return the same as the original one.

⚠ Make sure you read everything before creating custom placeholders.