Method Calling

This new feature allows you to call methods on placeholders to check string properties before comparing them in conditions

after you add a placeholder, you will add a dot then the method name, and it will check that placeholders method.

placeholders:
  something:
    placeholders:
      - '%placeholder%.methodname() == something'
    output: 'something'

For example:

placeholders:
  - '%player_name%.length() == 4'        # Name is exactly 4 characters

This will check if the players name is 4 characters only, and if so it will output it, you can add multiple conditions with method calling

placeholders:
  - '%vault_eco_balance%.length(!".") == 4'     # 4 chars excluding dots

While this one will check the balance characters EXCLUDING DOTS, (as a dot IS a character) and if you want it to count ONLY dots then remove the exclamation mark !


Available Methods:

length()

None / !"chars" / "chars"

Number

length(), length(!"."), length("123")

isEmpty()

None

true/false

isEmpty() == true

contains()

"text"

true/false

contains(".") == false

startsWith()

"text"

true/false

startsWith("VIP") == true

endsWith()

"text"

true/false

endsWith("_VIP") == true

toLowerCase()

None

String

toLowerCase() == "admin"

toUpperCase()

None

String

toUpperCase() == "ADMIN"

replace()

"target","replacement"

String

replace("_"," ") != %original%

Last updated