APickledWalrus / skript-placeholders

Placeholder integration for Skript.
GNU General Public License v3.0
28 stars 8 forks source link

Relational Placeholders #34

Open ShaneBeee opened 2 years ago

ShaneBeee commented 2 years ago

Description

Someone on discord was talking about this, so I figured I'd suggest it. If you could please add "Relational Placeholders" that would be great

https://github.com/PlaceholderAPI/PlaceholderAPI/wiki/PlaceholderExpansion#relational-placeholders

APickledWalrus commented 1 year ago

Sure, I'll look into adding support for creating & obtaining them :)

APickledWalrus commented 2 months ago

Almost two years later, this will be coming in 1.7.0 lol

APickledWalrus commented 2 months ago

I have completed this and it will be coming in the next release. Here is an example of using it:

placeholderapi relational placeholder with the prefix "skriptplaceholders":
  if the identifier is "longer_name": # Placeholder is "%rel_skriptplaceholders_longer_name%":
    if the length of the name of the first player > the length of the name of the second player:
      set the result to the name of the first player
    else:
      set the result to the name of the second player

# Obtain it
the value of the relational placeholder "rel_skriptplaceholders_longer_name" for <some player> and <some other player>