Package me.kzlyth.api.essentials


package me.kzlyth.api.essentials
API package for essentials functions in Zenith-Mod (God Mode, Fly Mode, Heal, Feed, Clear Inventory, Teleport).

This package contains the EssentialsAPI class, which provides methods to manage player essentials like god mode, fly mode, healing, feeding, clearing inventories, and teleportation. All actions support staff notifications.

Database Compatibility: This API does not directly interact with the database, but all methods are compatible with the underlying system that may use H2, SQLite, MySQL, or MariaDB databases.

Features:

  • God Mode: Enable/disable invulnerability for players
  • Fly Mode: Enable/disable flight for players
  • Heal: Restore player health, hunger, and remove fire
  • Feed: Restore player hunger and saturation
  • Clear Inventory: Clear player inventory completely
  • Teleport: Teleport players to other players or staff

Important Notes:

  • All players must be online for these operations
  • Staff notifications are automatically sent when actions are performed on other players
  • Players with bypass permissions are not affected by certain operations

Example usage:


 ZenithAPI api = ZenithAPI.getInstance();
 if (api != null) {
     EssentialsAPI essentialsAPI = api.getEssentialsAPI();
     
     UUID playerUuid = UUID.fromString("123e4567-e89b-12d3-a456-426614174000");
     UUID staffUuid = UUID.fromString("00000000-0000-0000-0000-000000000001");
     
     // Set god mode
     essentialsAPI.setGodMode(playerUuid, staffUuid, true).thenAccept(success -> {
         if (success) {
             getLogger().info("God mode enabled");
         }
     });
     
     // Heal player
     essentialsAPI.heal(playerUuid, staffUuid).thenAccept(success -> {
         if (success) {
             getLogger().info("Player healed");
         }
     });
     
     // Teleport player
     UUID destinationUuid = UUID.fromString("987e6543-e21b-12d3-a456-426614174999");
     essentialsAPI.teleport(playerUuid, destinationUuid, staffUuid).thenAccept(success -> {
         if (success) {
             getLogger().info("Player teleported");
         }
     });
 }
 
Seit:
1.2.3
Autor:
Zenith-Studios
  • Klassen
    Klasse
    Beschreibung
    API for essentials functions in Zenith-Mod (God Mode, Fly Mode, Heal, Feed, Clear Inventory, Teleport).