mastervortexz

make a mod that takes away the entire pickup delay so i pick up items with no delay

Kodari AI
KodariYesterday at 1:00 am 1
InstantItemPickup
Removes the item pickup delay in Minecraft, allowing players to collect dropped items instantly with zero cooldown. The mod intercepts the item entity's pickup cooldown timer and sets it to zero, ensuring items are collected immediately upon contact. Compatible with Fabric 1.26.2, lightweight with no configuration required, and works seamlessly in both single-player and multiplayer environments.
  • Remove the delay at the player pickup check, including for items loaded from saved worlds.

  • Keep vanilla inventory and ownership checks intact.

Created Instant Pickup for Fabric 26.2. Players can pick up items without waiting, including items normally marked as never pickupable.

Install it on the server for multiplayer; vanilla inventory and ownership restrictions still apply.

mastervortexz

can you make it so it picks it up with no delay right as the item is droped

Kodari AI
KodariYesterday at 1:07 am 2
  • Pick up newly spawned items immediately when a player is within pickup range.

  • Preserve vanilla inventory and ownership checks.

Items are now picked up as soon as they spawn within your normal pickup range. This includes items you drop yourself, so you may immediately pick them back up.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
7 131
src/main/java/com/kodari/instantpickup/mixin/ServerLevelMixin.java
package com.kodari.instantpickup.mixin;

import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.phys.AABB;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(ServerLevel.class)
public abstract class ServerLevelMixin {
    @Inject(method = "addFreshEntity", at = @At("RETURN"))
    private void instantPickup$pickupOnSpawn(Entity entity, CallbackInfoReturnable<Boolean> cir) {
        if (!cir.getReturnValue() || !(entity instanceof ItemEntity item) || item.isRemoved()) {
            return;
        }

        ServerLevel level = (ServerLevel) (Object) this;
        AABB itemBounds = item.getBoundingBox();
        for (Player player : level.getEntitiesOfClass(Player.class, itemBounds.inflate(2.0))) {
            AABB pickupArea;
            if (player.isPassenger() && !player.getVehicle().isRemoved()) {
                pickupArea = player.getBoundingBox().minmax(player.getVehicle().getBoundingBox()).inflate(1.0, 0.0, 1.0);
            } else {
                pickupArea = player.getBoundingBox().inflate(1.0, 0.5, 1.0);
            }
            if (pickupArea.intersects(itemBounds)) {
                item.playerTouch(player);
                if (item.isRemoved()) {
                    break;
                }
            }
        }
    }
}