Developer API
This page is for developers who want to integrate Matrix into their plugins.
Import Matrix as a dependency
- Download the latest Matrix jar from our web panel, if you didn't purchase Matrix, you can purchase a Trail version of it, it's free, and the jar is same as the paid version.
- Import the jar into your project
<dependencies>
<dependency>
<groupId>me.rerere.matrix</groupId>
<artifactId>Matrix</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>PATH TO THE MATRIX JAR</systemPath>
</dependency>
<!-- Other dependencies -->
</dependencies>
dependencies {
compileOnly files('PATH TO THE MATRIX JAR')
// Other dependencies
}
dependencies {
compileOnly(files("PATH TO THE MATRIX JAR"))
// Other dependencies
}
Get Matrix API instance
val api = MatrixAPIProvider.getAPI()
MatrixAPI api = MatrixAPIProvider.getAPI();
API methods
Get the current TPS value of the server
double getTPS()
Get the player's latency(ping)
int getLatency(Player player)
Set the Violation Level of a certain check of the player
void setViolations(Player player, HackType hackType, int violations)
Get the Violation Level of a certain check of the player
int getViolations(Player player, HackType hackType)
Determine whether the check is enabled
boolean isEnable(HackType hackType)
Set whether a check is enabled
void setEnable(HackType hackType, boolean enable)
Check if the player can bypass anti-cheat
boolean isBypass(Player player)
Get whether the player can see the verbose message
boolean hasVerbose(Player player)
Set whether the player can see everyone's verbose messages
void setVerbose(Player player, boolean enable)
Set whether the player can see the verbose message of a certain player
void setVerbose(Player player, boolean enable, Player target)
Reload the permission cache system
void reloadPermissionCache(Player player)
Mark this player using cheating Removed
void flag(Player player, HackType hackType, String message, String component, int vlAddd)
Allows players to temporarily bypass certain checks
void tempBypass(Player player, HackType hackType, Long milliseconds)
Register the block at this location as a "client block"
void registerClientBlock(Block blockLoc)
A client block is that the block only exists on the client side, and the server does not have this block