HyperProtect-Mixin is a generic server protection hook framework for Hytale. It uses Hyxin mixins to inject 23 interceptors providing 20 protection hooks across building, combat, items, entities, containers, transport, commands, and logging.
Any mod can register hook handlers to control these actions — no compile-time dependency needed.
- HyperProtect-Mixin loads as an early plugin (
earlyplugins/) - It creates a shared
AtomicReferenceArray<Object>(24)stored inSystem.getProperties()under"hyperprotect.bridge" - Mixins inject protection checkpoints into server code
- Your mod places hook objects at specific slot indices in the bridge array
- When a protected action occurs, the mixin calls your handler via cached MethodHandles
Check if the mixin plugin is loaded:
boolean loaded = "true".equals(System.getProperty("hyperprotect.bridge.active"));Check individual interceptor availability:
boolean hasBlockBreak = "true".equals(System.getProperty("hyperprotect.intercept.block_break"));
boolean hasPortal = "true".equals(System.getProperty("hyperprotect.intercept.portal_entry"));The bridge array uses fixed integer indices for each hook:
| Index | Name | Description |
|---|---|---|
| 0 | block_break |
Block harvesting and item pickup |
| 1 | explosion |
Explosion block damage |
| 2 | fire_spread |
Fire fluid spreading |
| 3 | builder_tools |
Builder tool paste |
| 4 | item_pickup |
Proximity item pickup |
| 5 | death_drop |
Death inventory drops |
| 6 | durability |
Item durability loss |
| 7 | container_access |
Crafting/container access |
| 8 | mob_spawn |
NPC/mob spawning |
| 9 | teleporter |
Teleporter block use |
| 10 | portal |
Portal and instance access |
| 11 | command |
Command execution |
| 12 | interaction_log |
Desync log suppression |
| 13 | spawn_ready |
Boolean flag: spawn hook initialized |
| 14 | spawn_allow_startup |
Boolean flag: allow spawns during startup |
| 15 | format_handle |
Reserved: cached ChatFormatter MethodHandle |
| 16 | entity_damage |
Player-initiated entity damage (PvP) |
| 17 | container_open |
Storage container opening |
| 18 | block_place |
Block placement |
| 19 | hammer |
Hammer block cycling (variant rotation) |
| 20 | use |
Block state changes and interactions |
| 21 | seat |
Block seating (chairs, benches) |
| 22 | respawn |
Player respawn location override (value hook) |
Note: The bridge array has 24 elements (indices 0-23). Indices 0-22 are named slots. Index 23 is reserved for future use. Indices 13, 14, and 15 are utility slots (boolean flags and cached MethodHandle), not consumer hooks.
All hooks (except boolean ones) return int verdicts:
| Value | Meaning | Behavior |
|---|---|---|
0 |
ALLOW | Action proceeds normally |
1 |
DENY_WITH_MESSAGE | Action blocked; mixin calls fetch*DenyReason() and sends message to player |
2 |
DENY_SILENT | Action blocked, no message |
3 |
DENY_MOD_HANDLES | Action blocked, consumer mod handles its own messaging |
| negative/unknown | ALLOW | Fail-open safety |
public class MyProtectionHook {
// Block break hook — return verdict int
public int evaluate(UUID playerUuid, String worldName, int x, int y, int z) {
if (isProtectedArea(worldName, x, y, z)) {
return 1; // DENY_WITH_MESSAGE
}
return 0; // ALLOW
}
// Called when verdict is 1 (DENY_WITH_MESSAGE)
public String fetchDenyReason(UUID playerUuid, String worldName, int x, int y, int z) {
return "&redYou cannot break blocks in this area!";
}
}@SuppressWarnings("unchecked")
AtomicReferenceArray<Object> bridge = (AtomicReferenceArray<Object>)
System.getProperties().get("hyperprotect.bridge");bridge.set(0, new MyProtectionHook()); // Slot 0 = block_breakThat's it! The block break interceptor will now call your evaluate() method before every block break.
- hooks.md — Full hook reference (all 20 hooks with method signatures)
- patterns.md — Integration patterns (bypass, fail-open, messages)
- feature-detection.md — Checking which interceptors are loaded
- examples.md — Complete working examples