bukxy / hytale-gateway
Access data using the java plugin
Requires
- php: ^8.2
This package is not auto-updated.
Last update: 2026-04-17 17:29:41 UTC
README
A Laravel package to query Hytale servers and retrieve real-time server information (online status, map, players, etc.).
✅ Tested with Laravel 12
✅ Multi-server support
✅ Configurable
✅ Frontend-friendly response
✨ Features
- 🔌 Query Hytale servers via UDP
- 🌍 Multiple servers support
- 🟢 Online / 🔴 Offline detection
- 📊 Players, map, hostname
- 🎮 Perfect for dashboards & server owner
⚠️ Prerequisites (Required) (Tested with hytale-simple-query-1.0.0.jar)
Before using this package, you must install and run the Hytale query server.
This package does not work alone, it communicates with an external Java .jar that exposes the Hytale server data via UDP.
✅ Required: Hytale Simple Query
You must install Hytale Simple Query and follow its documentation before continuing:
👉 Hytale Simple Query (Java server) 🔗 https://github.com/Yamiru/Hytale-Simple-query/tree/main
🖼️ Screenshots
📦 Installation
- Require the package via Composer:
composer require bukxy/hytale-gateway - Publish the configuration file:
php artisan vendor:publish --tag=hytale-gateway-config(This will create:config/hytale-gateway.php)
Copie the config file to add your servers
php artisan vendor:publish --tag=hytale-gateway-config
🧠 Usage
Controller example (Laravel)
<?php namespace App\Http\Controllers; use Bukxy\HytaleGateway\HytaleGatewayQuery; use Illuminate\Http\Request; class ServerInfoController extends Controller { public function show() { $hytaleServerInfo = new HytaleGatewayQuery('default'); $serverInfo = $hytaleServerInfo->resultQuery(); return view('show', compact('serverInfo')); } }
Returned data structure (Server Offline 🔴)
[ "is_online" => false, "hostname" => "Hytale Server", "maxplayers" => 0, "numplayers" => 0, "map" => "Unknown" ]
Returned data structure (Server Online 🟢)
[ "is_online" => true, "hostname" => "Hytale Server", "hostip" => "0.0.0.0", "plugins" => "HytaleQuery", "numplayers" => "0", "tps" => "20.00", "gametype" => "HYTALE", "maxplayers" => "100", "hostport" => "5533", "version" => "1.0.0", "map" => "world", "game_id" => "HYTALE" ]
🎨 Frontend Example (php)
<div class="hytale-card"> <div class="hytale-header"> <span class="status <?= $serverInfo['is_online'] ? 'online' : 'offline' ?>"></span> <h3><?= $serverInfo['hostname'] ?></h3> </div> <div class="hytale-body"> <div class="row"> <span class="label">Map</span> <span class="value"><?= $serverInfo['map'] ?></span> </div> <div class="row"> <span class="label">Players</span> <span class="value"><?= $serverInfo['numplayers'] ?> / <?= $serverInfo['maxplayers'] ?></span> </div> </div> </div>
🎮 Base CSS (Hytale-style UI)
.hytale-card { width: 340px; background: linear-gradient(180deg, #0b1220, #141c33); border: 1px solid rgba(120,180,255,.25); border-radius: 14px; padding: 16px; font-family: "Segoe UI", system-ui, sans-serif; color: #e5ecff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.03), 0 15px 40px rgba(0,0,0,.6); position: relative; } .hytale-card::before { content: ""; position: absolute; inset: 0; border-radius: 14px; background: radial-gradient(circle at top, rgba(120,180,255,.15), transparent 60%); pointer-events: none; } .hytale-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; } .hytale-header h3 { margin: 0; font-size: 1.1rem; letter-spacing: .5px; color: #9dd1ff; text-shadow: 0 0 8px rgba(120,180,255,.5); } .status { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 8px currentColor; } .status.online { background: #22c55e; color: #22c55e; } .status.offline { background: #ef4444; color: #ef4444; } .hytale-body { background: rgba(10,15,30,.6); border-radius: 10px; padding: 12px; } .hytale-body .row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.06); } .hytale-body .row:last-child { border-bottom: none; } .label { font-size: .85rem; color: #aab4d6; text-transform: uppercase; letter-spacing: .08em; } .value { font-weight: 600; color: #ffffff; }
🛠 Requirements
- PHP ≥ 8.2
- Laravel ≥ 12
- ext-sockets enabled