Skip to main content
Hytale ships with a GameMode enum (Adventure, Creative) and a GameModeType asset system that defines permissions and interactions for each mode. If your mod changes behavior based on the current game mode - disabling PvP in Creative, unlocking build tools, restricting commands - you need to verify that mode detection and mode switching work correctly. The ChangeGameModeEvent fires when a player’s mode changes. Mods that react to mode switches (enabling fly in Creative, locking inventory in Adventure) should capture this event and verify the new mode value.

Complete Example Suite

GameMode Enum

GameModeType Asset

GameModeType is the content asset tied to each GameMode. It defines what the mode allows:

ChangeGameModeEvent

Fires when a player’s game mode changes. Key methods:

When to Test Game Modes

  • Mode-gated features - your mod enables/disables systems per mode
  • Permission checks - Creative players get different permissions than Adventure
  • Event listeners - your mod reacts to ChangeGameModeEvent
  • UI changes - different HUD elements per mode

Isolation Recommendation

Game mode tests are read-only enum and asset lookups. IsolationStrategy.NONE is sufficient unless you are modifying player state:

Next Steps

  • Players - mock player creation and game mode assignment
  • Events - event capture and cancellation patterns
  • Permissions - permission checks per game mode