Package me.kzlyth.api.warn


package me.kzlyth.api.warn
API package for warning players in Zenith-Mod.

This package contains the WarnAPI class, which provides methods to warn players manually or using templates (custom warns). All warnings are automatically recorded in the history database with a case ID.

Database Compatibility: All methods in this API are fully compatible with H2, SQLite, MySQL, and MariaDB databases. The API automatically adapts to the configured database type from the configuration file.

Features:

  • Manual warnings with custom reasons
  • Template-based warnings
  • Online and offline player warning
  • Automatic escalation support (can trigger bans, mutes, or kicks)

Important Notes:

  • All warnings are recorded in the history database (zn_history)
  • Each warning receives a unique case ID
  • Templates may support escalation (automatically triggers bans/mutes/kicks after X warnings)
  • Warnings are permanent entries (no unwarn functionality)

Example usage:


 ZenithAPI api = ZenithAPI.getInstance();
 if (api != null) {
     WarnAPI warnAPI = api.getWarnAPI();
     
     UUID playerUuid = UUID.fromString("123e4567-e89b-12d3-a456-426614174000");
     warnAPI.warn(playerUuid, "Toxic behavior").thenAccept(success -> {
         getLogger().info("Player warned. Success: " + success);
     });
 }
 
Seit:
1.2.3
Autor:
Zenith-Studios
  • Klassen
    Klasse
    Beschreibung
    Represents a warning entry in Zenith-Mod.
    API for warning players in Zenith-Mod.