Solved Variables

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!


Feb 27, 2017
How do I get the whole variable list?
For exmaple if I want to check what players have X in the variable Y.Z
Could you be more specific?

You can check the method to get a variable with this:
As Skript has 2 different ways to store the player in a variable name, with player's name or uuid, So I recommend this:
ClassInfo<Player> ci = Classes.getExactClassInfo(Player.class);
String playerName = ci.getParser().toVariableNameString(player);
//And then Skript will return the player's name or the player's uuid depending of config.
//Then you use it in your variable name like: "SomeVariableName." + playerName
Im trying to do it the opposite,
I need to scan throught the whole variables that starts with server.stat.NAME
But I cant scan through all the players, only through the variables.
Doesnt help.
This code is to get one variable,
I need to get all of them that starts with server.stat.
Read the documentation. Calling passing the name of a list variable to getVariable returns a Map which you can then iterate through.
Variables.getVariable("server.stat::*", null, false); // returns a Map<String, Object>

If you're not using list variables, the only way to do this is by getting Skript's internal variable map from Variables and iterating through it. You should not do this. Use list variables.