promotional bannermobile promotional banner

Inventory Manager API

Inventory Manager API allows you to save/load inventories, extending inventory functionalities

InventoryManagerAPI

A Hytale server plugin that provides a powerful API for managing player inventories with persistent save/load functionality.

Now support PostgreSQL!

Purpose

InventoryManagerAPI solves the common problem of inventory persistence in Hytale servers. Whether you're building minigames that need to save/restore player inventories, creating custom gamemodes with inventory presets, or developing plugins that require temporary inventory storage, this API provides a clean, modular solution.

What It Does

  • Save player inventories to persistent storage (JSON files)
  • Restore inventories on demand with full item data preservation
  • Multiple storage modes for different use cases:
    • UUID-based - Simple player-specific storage
    • UUID + Suffix - Multiple named variants per player (e.g., kit_pvp, kit_builder)
    • Custom names - Shared/global inventory presets accessible to any player

Features

For Server Administrators

  • Built-in commands for manual inventory management
  • Configurable behavior (clear inventory on save, delete inventory file on load)
  • Persistent configuration with in-game modification

For Plugin Developers

  • Clean API accessible via InventoryManagerAPIPlugin.get().getInventoryStorageManager()
  • Async operations using CompletableFuture for non-blocking I/O
  • Strategy pattern allows custom storage backends
  • Full inventory support: hotbar, storage, backpack, armor, and utility slots

Commands

Command Description
/invm save Save your current inventory
/invm load Restore a saved inventory
/invm list List available saved inventories
/invm config view View current configuration
/invm config set <key> <value> Modify configuration
/invm config save Save configuration to disk
/invm config reload Reload configuration from disk

Command Options

Save/Load options:

  • --suffix <name> - Use player-specific named variant
  • --name <name> - Use shared/global inventory name
  • --clear true|false - Override clear-on-save setting
  • --delete true|false - Override delete-on-load setting
  • --player <name> - apply operation on another player

List options:

  • --name - Show custom-named inventories
  • --suffix - Show suffix-based inventories
  • --uuid <player> - Filter by specific player

Configuration

The configuration file is located at mods/DjCtavia.InventoryManagerAPI/InventoryManagerAPI.json.

General Settings

Setting Default Description
StorageDirectory mods/.../inventories Where inventory files are stored (JSON storage only)
ClearInventoryOnSave true Clear player inventory after saving
DeleteFileOnLoad true Delete inventory file after restoring
StorageType Json Storage backend to use (Json or PostgreSQL)

PostgreSQL Settings

These settings are only used when StorageType is set to PostgreSQL.

Setting Default Description
Host localhost PostgreSQL server hostname
Port 5432 PostgreSQL server port
Database postgres Database name
Username postgres Database username
Password (empty) Database password
TableName inventories Table name for storing inventories

Example Configurations

JSON Storage (Default)

{
    "StorageDirectory": "mods/DjCtavia.InventoryManagerAPI/inventories",
    "ClearInventoryOnSave": true,
    "DeleteFileOnLoad": true,
    "StorageType": "Json",
    "PostgreSQL": {
        "Host": "localhost",
        "Port": 5432,
        "Database": "postgres",
        "Username": "postgres",
        "Password": "",
        "TableName": "inventories"
    }
}

PostgreSQL Storage

{
    "StorageDirectory": "mods/DjCtavia.InventoryManagerAPI/inventories",
    "ClearInventoryOnSave": true,
    "DeleteFileOnLoad": true,
    "StorageType": "PostgreSQL",
    "PostgreSQL": {
        "Host": "localhost",
        "Port": 5432,
        "Database": "hytale_server",
        "Username": "postgres",
        "Password": "your_password",
        "TableName": "inventories"
    }
}

API Usage

// Get the manager
InventoryStorageManager manager = InventoryManagerAPIPlugin.get().getInventoryStorageManager();

// Save inventory by UUID
manager.saveInventory(playerUUID, inventory);

// Save with a suffix (e.g., for different game modes)
manager.saveInventoryWithSuffix(playerUUID, inventory, "arena");

// Save as a named preset (shared across players)
manager.saveInventoryByName("starter_kit", inventory);

// Restore inventory
manager.restoreInventory(playerRef, store);

// Restore with suffix
manager.restoreInventory(playerRef, store, "arena", null);

// Restore from named preset
manager.restoreInventoryByName(playerRef, store, "starter_kit", null);

// List available inventories
List<String> namedInventories = manager.listNamedInventories();
List<String> playerInventories = manager.listSuffixInventories(playerUUID);

The Inventory Manager API Team

profile avatar
  • 2
    Followers
  • 2
    Projects
  • 772
    Downloads

More from DjCtavia

  • Less Sleepers project image

    Less Sleepers

    • 440
    • Mods

    Configure how many players must sleep to skip the night. Supports percentage-based or fixed count rules, per-world settings, and optional chat notifications showing sleep progress.

    • 440
    • January 15, 2026
    • Mods
    • +3
  • Less Sleepers project image

    Less Sleepers

    • 440
    • Mods

    Configure how many players must sleep to skip the night. Supports percentage-based or fixed count rules, per-world settings, and optional chat notifications showing sleep progress.

    • 440
    • January 15, 2026
    • Mods
    • +3