Hytale Chest Instance Engine (CIE)
Overview
ChestInstanceEngine (CIE) is a server-side engine responsible for instantiating reward chests dynamically, based on configurable loot profiles.It was designed to work seamlessly with ArenaWavesEngine (AWE), but it can also be integrated with any custom reward source.
The engine focuses on:
- Clean architecture
- High server-side performance
- Gson/ConfigHandle-based configuration
- Instanced chest logic (per-player or shared)
- Modular reward system
Dependencies
| Name | Version | Description |
|---|---|---|
| HytaleServer | 2026.03.26-89796e57b | Core Hytale server |
Core Features
Chest Configuration System
|
Chest Array Structure
Each chest definition supports:- id → Unique identifier
- name → Display name for the chest
- description → Description for the chest
- mode → PER_PLAYER | SHARED
- expiresAt → Auto-despawn date-time (ISO-8601 UTC, e.g. "2026-12-31T23:59:59Z")
- position → Position where the chest should be spawned (x, y, z)
- rotation → Rotation of the chest in the world (x, y, z)
- world → Optional world name where the chest should be spawned
- chestItemId → Hytale item ID for the chest block model (default: Furniture_Dungeon_Chest_Legendary_Large)
- usePlayerWhitelist → When true, only players assigned via assign-profile can open the chest
- lootPools → List of named reward pools (e.g. DEFAULT, TOP_10, TOP_1)
Loot Pool Configuration
Each lootPools entry:
Code:
{
"id": "auto-uuid",
"poolName": "DEFAULT",
"items": [
{
"itemId": "Gold_Coin",
"minAmount": 200,
"maxAmount": 350,
"chance": 100
}
]
}
Each item entry supports:
- itemId → Hytale item identifier
- minAmount → Minimum quantity (>= 1)
- maxAmount → Maximum quantity (>= minAmount)
- chance → Probability percentage (0–100) that this item will be generated
Config Example
Code:
{
"chests": [
{
"Id": "awe_boss_reward_chest",
"Name": "AWE Boss Reward Chest",
"Description": "Baú único no mundo com loot individual por participante",
"Position": { "x": 120.0, "y": 64.0, "z": -45.0 },
"Rotation": { "x": 0.0, "y": 180.0, "z": 0.0 },
"Mode": "PER_PLAYER",
"World": "Overworld",
"ExpiresAt": "2026-12-31T23:59:59Z",
"ChestItemId": "Furniture_Dungeon_Chest_Legendary_Large",
"UsePlayerWhitelist": true,
"LootPools": [
{
"PoolName": "DEFAULT",
"Items": [
{ "ItemId": "Gold_Coin", "MinAmount": 200, "MaxAmount": 350, "Chance": 100 }
]
},
{
"PoolName": "TOP_10",
"Items": [
{ "ItemId": "Gold_Coin", "MinAmount": 350, "MaxAmount": 600, "Chance": 100 }
]
},
{
"PoolName": "TOP_1",
"Items": [
{ "ItemId": "Gold_Coin", "MinAmount": 800, "MaxAmount": 1200, "Chance": 100 }
]
}
]
}
]
}
Instance Modes
PER_PLAYER Mode
- Each player gets their own unique loot when they open the chest
- Items are not shared between players
- Player access is controlled by whitelist (usePlayerWhitelist)
SHARED Mode
- All players share the same chest instance
- Items are consumed by the first player to open it
Expiration System
- Instances automatically expire at expiresAt (ISO-8601 timestamp)
- Expiration is scheduled on spawn and rescheduled on plugin restart
- Background daemon runs every 5 minutes to clean up stale instances
Player Whitelist & Loot Profiles
When usePlayerWhitelist = true:
|
Integration With ArenaWavesEngine
When an arena is completed successfully:- Arena emits completion event
- /cie spawn is called with trigger + percentage
- /cie assign-profile is called per player with their profile
- Instanced chest is spawned in the world
- Each player opens and receives their own loot
- Chest expires automatically
Recommended AWE integration flow
cie spawn <chestId> {session} {completionPercentage}cie assign-profile {session} {playerId} {profile} {completionPercentage}
AWE placeholders commonly used with CIE commands
| Placeholder | Description |
|---|---|
| {session} | Unique trigger/session ID |
| {playerId} | Target player UUID |
| {profile} | Loot profile key (e.g. TOP_1, TOP_10, DEFAULT) |
| {completionPercentage} | Completion ratio (0.0–1.0) |
Commands
| Command | Description |
|---|---|
| /cie spawn <chestDefinitionId> | Spawns a chest instance using the specified definition ID |
| /cie spawn <id> [--trigger <triggerId>] | Spawns with a custom trigger ID |
| /cie spawn <id> [--trigger <id>] [--percentage <value>] | Spawns with loot percentage scaling |
| /cie spawn <id> [--trigger <id>] [--percentage <v>] [--position <x,y,z>] [--world <name>] [--expiresAt <seconds>] | Full override: position, world, expiry |
| /cie assign-profile <trigger> <player> <profile> [percentage] | Assigns a loot profile to a player for a trigger |
| /cie ui | Opens the chest definitions admin UI |
Permissions
| Permission | Description |
|---|---|
| miilhozinho.cie | Base permission for CIE commands |
| miilhozinho.cie.spawn | Permission to use spawn and assign-profile |
| miilhozinho.cie.ui.list | Permission to open the chest definitions UI (/cie ui) |
| miilhozinho.cie.ui.edit | Permission to edit chest definitions inside the UI |
🖥 Admin UI
The /cie ui command opens a full admin page with two panels:Left Panel
- Search box to filter definitions by name
- Scrollable list of all chest definitions
- "Add" button to create a new definition (requires EDIT permission)
- "Delete" button per definition row
Right Panel — 3 Tabs
General Tab
Editable fields: id, name, description, mode (dropdown), world, position (XYZ), rotation (XYZ), expiresAt, chestItemId (item picker), usePlayerWhitelist (toggle).Loot Pools Tab
Lists all loot pools for the selected definition. Each pool shows its items with itemId, minAmount, maxAmount, and chance. "Add Pool" button creates a new pool.Instances Tab
Lists all active runtime instances of the selected definition. Shows triggerId, position, expiresAt, and per-player loot profiles. "Spawn" button creates a new instance directly.
Target Audience
This engine is designed for:- Hytale mod developers
- Server owners with custom gameplay systems
- Developers using ArenaWavesEngine
- Modular gameplay system creators
Bundle Strategy
ChestInstanceEngine is designed to work perfectly as a premium bundle together with ArenaWavesEngine.Together, they provide:
- Complete arena gameplay loop
- Performance-based rewards
- Instanced chest system
- Fully configurable loot profiles
- High replayability system
