Skip to content

26.2 Commands

Rifa edited this page Aug 22, 2026 · 1 revision

πŸ’» Brigadier Commands & In-Game Diagnostics (MC 26.2)

πŸ“Œ 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.

Feature Infobox Technical Parameters
Command Class net.instantgratification.magnet.MagnetCommand
Primary Literals /magnet and /ig_magnet (Identical alias mirrors)
Registration Callback CommandRegistrationCallback.EVENT
Log Output File logs/ig_magnet_debug.log
Target Permissions Available to all players (toggle) and OP Level 2 (debug)

πŸ“– Command Tree Structure

/magnet (or /ig_magnet)
  β”œβ”€β”€ toggle
  └── debug
        └── log

πŸ› οΈ Subcommand Reference

1. /magnet toggle (or /ig_magnet toggle)

Toggles the executing player's personal magnet state on or off.

  • Usage: /magnet toggle
  • Execution: Calls ((IMagnetPlayer) player).ig_magnet$toggleMagnet().
  • Output Feedback:
    • If enabled: Β§aItem Magnet: Enabled (chat.ig_magnet.enabled)
    • If disabled: Β§cItem Magnet: Disabled (chat.ig_magnet.disabled)
  • Use Case: Allows players connecting from vanilla clients (on server-side only setups) or players without keybind access to toggle their item magnet.

2. /magnet debug (or /ig_magnet debug)

Executes an immediate in-world diagnostic sweep of the executing player and surrounding entities within 10 blocks.

  • Usage: /magnet debug
  • Output Information:
    Β§e--- Magnet Debug Info ---
    Player Name: Steve
    Player UUID: c0b59055-ec50-4653-979d-c3c92d6ca897
    Global Master Toggle: true
    Player Toggle State: true
    Range: 12
    Instant Pickup: false
    LOS Only: true
    Spectator: false
    Dead/Dying: false
    Debug File Logger: DISABLED (Toggle with /magnet debug log)
    Nearby Items (10 blocks): 3
    Nearest Item ID: 412
    PlayerVisionTracker.canSee: true
    Vanilla Raycast canSee: true
    Β§e-------------------------
    
  • Use Case: Diagnoses why an item might not be getting pulled (e.g. strict LOS obstruction, dead player state, or global GameRule overrides).

3. /magnet debug log (or /ig_magnet debug log)

Toggles persistent verbose diagnostic logging to disk.

  • Usage: /magnet debug log
  • Execution: Flips MagnetDebugLogger.enabled = !MagnetDebugLogger.enabled.
  • Output: Writes timestamped tick events, packet receptions, respawn handshakes, and LOS rejections to logs/ig_magnet_debug.log.
  • Sample Log File Entry:
    [2026-08-22 21:49:15.102] MagnetMod: Server received packet from Steve (c0b59055-...) enabled=true
    [2026-08-22 21:49:15.105] MagnetMovement: Entity 412 is now magnetized by Steve (c0b59055-...).
    

πŸ”— Related Wiki Documentation

Clone this wiki locally