-
Notifications
You must be signed in to change notification settings - Fork 0
26.2 API and Addon Integration
π 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.
| API Infobox | Technical Parameters |
|---|---|
| Player Interface | net.instantgratification.magnet.IMagnetPlayer |
| Entity Interface | net.instantgratification.magnet.IMagnetEntity |
| Core Movement Facade | net.instantgratification.magnet.MagnetMovement |
| GameRule API | net.dasik.social.api.gamerule.DynamicGameRuleManager |
| Vision API | net.dasik.social.api.vision.PlayerVisionTracker |
Third-party mods, server utilities, and Instant Gratification addons can interface directly with Magnet, Let me get that! to query player magnet states, trigger programmatic pulls, or bypass obstacles.
Cast any Player or ServerPlayer instance to IMagnetPlayer to query or modify magnet preferences:
package net.instantgratification.magnet;
public interface IMagnetPlayer {
boolean ig_magnet$isMagnetEnabled();
void ig_magnet$setMagnetEnabled(boolean enabled);
boolean ig_magnet$toggleMagnet();
}// Check if player has magnet active
if (((IMagnetPlayer) player).ig_magnet$isMagnetEnabled()) {
// Custom addon logic...
}
// Programmatically disable magnet (e.g. while sitting on a throne or in a minigame)
((IMagnetPlayer) player).ig_magnet$setMagnetEnabled(false);Cast any Entity instance (such as custom mob drops, projectiles, or XP orbs) to IMagnetEntity:
package net.instantgratification.magnet;
public interface IMagnetEntity {
void ig_magnet$setMagnetNoClip();
boolean ig_magnet$isMagnetNoClip();
void ig_magnet$setMagnetized();
boolean ig_magnet$isMagnetized();
}// Grant custom entity temporary 2-tick phase shifting
((IMagnetEntity) customItem).ig_magnet$setMagnetNoClip();Addon mods can manually pull entities toward any player using the built-in physics and line-of-sight engine:
public static void pull(Entity entity, Player player, boolean shouldSpawnParticles);// Pull target entity to player with particle trails
MagnetMovement.pull(specialDrop, player, 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