API

How to Use

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:

<repository>
  <id>jitpack.io</id>
  <url>https://jitpack.io</url>
</repository>

<dependency>
  <groupId>com.github.ajneb97</groupId>
  <artifactId>ServerVariables</artifactId>
  <version>3.0.1</version>
  <scope>provided</scope>
</dependency>

Methods

You can access the API methods with the ServerVariablesAPI class. Some examples:

StringVariableResult result = ServerVariablesAPI.getVariableValue(String variableName);
StringVariableResult result = ServerVariablesAPI.getVariableValue(String playerName,String variableName);
if(!result.isError(){
    String resultValue = result.getResultValue();
}

ServerVariablesPlayer player = ServerVariablesAPI.getPlayerByName(String playerName);
ServerVariablesPlayer player = ServerVariablesAPI.getPlayerByUUID(String uuid);

Events

Last updated