To use and implement the ServerVariables API, create a plugin and import ServerVariables.jar as an external jar or use maven and set the following on your pom.xml file:
You can access the API methods with the ServerVariablesAPI class.
String result =ServerVariablesAPI.getServerVariableValue(String variableName);String result =ServerVariablesAPI.getPlayerVariableValue(String playerName,String variableName);ServerVariablesPlayer player =ServerVariablesAPI.getPlayerByName(String playerName);ServerVariablesPlayer player =ServerVariablesAPI.getPlayerByUUID(String uuid);
Events
// Called when a variable changes its value.@EventHandlerpublicvoidonVariableChange(VariableChangeEvent event){Player player =event.getPlayer();Variable variable =event.getVariable();String newValue =event.getNewValue();String oldValue =event.getOldValue();}