-
Notifications
You must be signed in to change notification settings - Fork 0
26.1.2 Commands
Rifa edited this page Aug 22, 2026
·
1 revision
π 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) |
| Subcommands | toggle |
| Network Sync | ServerPlayNetworking.send(player, new MagnetTogglePayload(newState)) |
Toggles the executing player's item magnet state on or off.
-
Command Syntax:
/magnet toggle -
Execution Logic:
private static int toggleMagnet(CommandSourceStack source) throws CommandSyntaxException { ServerPlayer player = source.getPlayerOrException(); boolean newState = MagnetPlayerState.toggleMagnet(player); if (newState) { source.sendSuccess(() -> Component.translatable("chat.ig_magnet.enabled"), false); } else { source.sendSuccess(() -> Component.translatable("chat.ig_magnet.disabled"), false); } if (ServerPlayNetworking.canSend(player, MagnetTogglePayload.TYPE)) { ServerPlayNetworking.send(player, new MagnetTogglePayload(newState)); } return 1; }
- Vanilla Client Compatibility: Enables players on vanilla clients connecting to a fabric server to toggle their magnet without requiring client mod installation.
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