-
Notifications
You must be signed in to change notification settings - Fork 0
26.2 HUD and Diagnostics
π Repository Source Disclaimer: The documentation in this Wiki reflects the current source code state in the repository, which may include recent unreleased commits or developmental features ahead of public release builds on CurseForge and Modrinth.
| Visual Infobox | Technical Parameters |
|---|---|
| Actionbar API | client.gui.hud.setOverlayMessage(Component, boolean) |
| Particle Type | net.minecraft.core.particles.ParticleTypes.ELECTRIC_SPARK |
| Particle Throttle Modulo | (entity.tickCount + entity.getId()) % 4 == 0 |
| Debug Log File | logs/ig_magnet_debug.log |
| Logger Class | net.instantgratification.magnet.MagnetDebugLogger |
When the player toggles their magnet state via keybind (\) or server command (/magnet toggle), the client HUD immediately renders an unobtrusive, non-intrusive actionbar overlay message directly above the hotbar:
-
Enabled Message:
Β§aItem Magnet: Enabled(chat.ig_magnet.enabled) -
Disabled Message:
Β§cItem Magnet: Disabled(chat.ig_magnet.disabled)
// Verified against: Hud.java (26.2+)
if (newState) {
client.gui.hud.setOverlayMessage(Component.translatable("chat.ig_magnet.enabled"), true);
} else {
client.gui.hud.setOverlayMessage(Component.translatable("chat.ig_magnet.disabled"), true);
}While items and XP orbs are actively being magnetized in flight, they emit subtle ParticleTypes.ELECTRIC_SPARK visual trails:
[Pulled Item] ---> β¨ ---> β¨ ---> β¨ ---> [Player Eye Position]
-
Source Cap: Governed by
ig:magnet_max_particle_sources(default:5), ensuring that huge piles of quarry drops do not cause particle overload. -
Frequency Staggering: Only 1 in every 4 ticks spawns particles for any individual entity, staggered across unique entity IDs:
(entity.tickCount + entity.getId()) % 4 == 0. -
Count Control: Controlled per source by
ig:magnet_particle_count(default:1).
For server administrators and modpack developers debugging line-of-sight boundaries or network packets, the mod includes a dedicated, thread-safe asynchronous file logger writing to logs/ig_magnet_debug.log:
-
Activation: Run
/magnet debug login-game. -
Format:
[yyyy-MM-dd HH:mm:ss.SSS] [Context] Message -
Log Sample:
[2026-08-22 21:50:00.124] MagnetMod: Server received packet from Alex (e7b1a234-...) enabled=true [2026-08-22 21:50:00.130] MagnetMovement: Entity 592 is now magnetized by Alex (e7b1a234-...). [2026-08-22 21:50:01.450] PlayerMixin: Server tick for Alex (e7b1a234-...) isMagnetEnabled=true
Magnet, Let me get that! β’ Developed by Dasik (Rifaditya) β’ Licensed under GNU GPLv3
Documentation reflects active repository source code. Features may precede public releases on CurseForge/Modrinth.
- π 26.2 Overview
- Gameplay Mechanics
- Administration & Config
- Technical & Development
- π 26.1.2 Overview
- Gameplay Mechanics
- Administration & Config
- Technical & Development