Compatibility
Minecraft: Java Edition
1.21.8
Platforms
Supported environments
Creators
Details
Licensed ARR
Published 3 weeks ago
Updated 4 weeks ago
Direction HUD
Overview
The Direction HUD mod displays the player's current facing direction (North, South, East, West, etc.) on the top left corner of the screen. The HUD can be toggled on and off using commands, and the state is saved between game sessions.
Features
- Shows cardinal direction (N, S, E, W) and intercardinal directions (NE, NW, SE, SW)
- Toggle HUD visibility with commands:
/direction on
and/direction off
- Configuration is saved between game sessions
- Clean, minimalist display in the top left corner
How It Works
-
Initialization:
- The mod loads the configuration from the config file
- Commands are registered to toggle the HUD
-
Direction Calculation:
- The HUD renderer calculates the player's facing direction based on their yaw angle
- The direction is determined by dividing the 360-degree circle into 8 segments (45 degrees each)
-
Rendering:
- If the HUD is enabled, the direction is displayed on the top left corner of the screen
- The text is rendered with a semi-transparent background for better visibility
-
Command Handling:
/direction on
enables the HUD and saves the configuration/direction off
disables the HUD and saves the configuration
Configuration
The mod uses a simple properties file stored in the config directory:
<config_dir>/direction-hud.properties
This file contains a single property enabled
which can be true
or false
.