Skip to content

Developer API

This page is for developers who want to integrate Matrix into their plugins.

Import Matrix as a dependency

  1. 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.
  2. Import the jar into your project
xml
<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>
groovy
dependencies {
    compileOnly files('PATH TO THE MATRIX JAR')

    // Other dependencies
}
kotlin
dependencies {
    compileOnly(files("PATH TO THE MATRIX JAR"))

    // Other dependencies
}

Get Matrix API instance

kotlin
val api = MatrixAPIProvider.getAPI()
java
MatrixAPI api = MatrixAPIProvider.getAPI();

API methods

Get the current TPS value of the server

java
double getTPS()

Get the player's latency(ping)

java
int getLatency(Player player)

Set the Violation Level of a certain check of the player

java
void setViolations(Player player, HackType hackType, int violations)

Get the Violation Level of a certain check of the player

java
int getViolations(Player player, HackType hackType)

Determine whether the check is enabled

java
boolean isEnable(HackType hackType)

Set whether a check is enabled

java
void setEnable(HackType hackType, boolean enable)

Check if the player can bypass anti-cheat

java
boolean isBypass(Player player)

Get whether the player can see the verbose message

java
boolean hasVerbose(Player player)

Set whether the player can see everyone's verbose messages

java
void setVerbose(Player player, boolean enable)

Set whether the player can see the verbose message of a certain player

java
void setVerbose(Player player, boolean enable, Player target)

Reload the permission cache system

java
void reloadPermissionCache(Player player)

Mark this player using cheating Removed

java
void flag(Player player, HackType hackType, String message, String component, int vlAddd)

Allows players to temporarily bypass certain checks

java
void tempBypass(Player player, HackType hackType, Long milliseconds)

Register the block at this location as a "client block"

java
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

Сделано с ❤️ от RE