Install Plugin

Installing HytaleMetrics is specific for Plugin Developer who want to collect data about the servers active and using your plugins. This is not required if you are a Server Owner, only for Plugin Developers.

Plugin Collection Features

- Collects anonymous usage statistics for your plugins
- Privacy-focused with server-side opt-out
- Easy to integrate with Maven

Privacy

- All data collected is **anonymous**
- Server owners can opt-out at any time
- No personal or identifying information is collected
- Data is used solely for statistics and analytics

What Data is Collected?

- Game version
- Java version
- OS information
- CPU core count
- Player count
- Online mode status
- Plugin Version

Add Repository

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

Add Dependency

<dependencies>
    <dependency>
        <groupId>com.github.hytalecore</groupId>
        <artifactId>hytalemetrics-plugin</artifactId>
        <version>v1.0.1</version>
        <scope>compile</scope>
    </dependency>
</dependencies>

Shade and Relocate

IMPORTANT: You must shade and relocate the library into your plugin!

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>3.2.4</version>
            <configuration>
                <relocations>
                    <relocation>
                        <pattern>hytalemetricsplugin</pattern>
                        <!-- Replace [your.plugin.package.metrics] with your plugin's package! -->
                        <shadedPattern>your.plugin.package.metrics</shadedPattern>
                    </relocation>
                </relocations>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

Usage

import org.unknown.plugin.java.JavaPlugin;
import hytalemetricsplugin.unknown.Metrics;
public class YourPlugin extends JavaPlugin {
    @Override
    public void onEnable() {
        // Get your plugin ID from https://hytalemetrics.net/plugins
        String pluginId = "12345"; // Replace with your actual plugin ID
        Metrics metrics = new Metrics(this, pluginId);
    }
}

Configuration

The library creates a config file at `plugins/hytalemetrics-config.yml`:


# HytaleMetrics Configuration
# Learn more at: https://hytalemetrics.net
#
# Set to false to disable metrics collection
enabled: true
#
# Unique server identifier (auto-generated)
serverUuid: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
#
# Debug options
logFailedRequests: false
logDataSent: false
logResponseStatus: false

Building from Source

git clone https://github.com/hytalecore/hytalemetrics-plugin.git
cd hytalemetrics-plugin
mvn clean install

The compiled JAR will be in `target/hytalemetrics-plugin-1.0.0.jar`