Skip to content

⚡ Instant Pickup Mode (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 InfoboxTechnical Parameters
System Classnet.instantgratification.magnet.mixin.PlayerMixin
Enabling GameRuleig:magnet_instant (Default: false)
Radius GameRuleig:magnet_range (Default: 12, Range: 1..64)
Injection Point@ModifyVariable(method = "aiStep", at = @At("STORE"), ordinal = 0)
Target VariablePlayer Collection Bounding Box (AABB pickupArea)

📖 Instant Pickup Overview ​

Instant Pickup Mode eliminates item travel time by expanding the player's native collection bounding box in Player.aiStep(), instantly vacuuming items into inventory with 0 flight delay.

+-----------------------------------------------------------------------------------+
|                            VANILLA PLAYER aiStep() TICK                           |
+-----------------------------------------------------------------------------------+
                                          |
                                          v
                +---------------------------------------------------+
                |   PlayerMixin.ig_magnet$expandPickupArea()        |
                |   pickupArea = pickupArea.inflate(range);         |
                +---------------------------------------------------+
                                          |
                                          v
+-----------------------------------------------------------------------------------+
|               VANILLA ItemEntity.playerTouch(Player) EXECUTION                    |
|   - Native Inventory Stacking & Partial Pickups                                   |
|   - Vanilla Pickup Animation & Sound Events                                       |
|   - Native Statistics & Advancements Triggers                                     |
|   - Full Container Overflow & Remaining Item Retention                            |
+-----------------------------------------------------------------------------------+

🧩 Architectural Implementation (PlayerMixin.java) ​

java
@ModifyVariable(
        method = "aiStep",
        at = @At(value = "STORE"),
        ordinal = 0
)
private AABB ig_magnet$expandPickupArea(AABB pickupArea) {
    Player player = (Player) (Object) this;
    if (!this.ig_magnet$isMagnetEnabled() || player.isDeadOrDying() || player.isSpectator()) {
        return pickupArea;
    }

    Level level = player.level();
    if (!level.isClientSide()) {
        if (ModGameRules.getBoolean(level, ModGameRules.MAGNET_ENABLED) && ModGameRules.getBoolean(level, ModGameRules.MAGNET_INSTANT)) {
            int range = ModGameRules.getInt(level, ModGameRules.MAGNET_RANGE);
            if (range > 0) {
                return pickupArea.inflate(range);
            }
        }
    }
    return pickupArea;
}

⚙️ Relevant Configuration & GameRules ​

GameRuleTypeDefaultDescription
ig:magnet_instantBooleanfalseEnables instant teleportation into inventory.
ig:magnet_rangeInteger12Radius in blocks for the expanded pickup area.
ig:magnet_enabledBooleantrueMaster toggle for the entire mod.

Official documentation & web portal for Dasik Igaijinn mods.