Skip to content

Lukarbonite/AutoPickup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

49 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Auto Pickup for Fabric

FabricMinecraftLicense

Auto Pickup is a highly configurable server-side Fabric mod that automates the collection of items and experience orbs. It features session tracking, a multi-tier permission system, and extensive mod compatibility to ensure drops are attributed to the correct players, even when using high-speed mining mods or engaging in group combat.


โœจ Features

Core Functionality

  • ๐ŸŽ’ Seamless Collection: Items from broken blocks and mob kills are instantly added to your inventory
  • โญ Smart Experience Handling: Experience is cached and applied after a short delay, ensuring tools take durability damage before Mending activates
  • ๐Ÿš€ Lag-Free: Prevents item and experience orb entities from spawning, reducing server load
  • ๐Ÿ“ฆ Overflow Protection: If your inventory is full, items safely drop at your feet
  • ๐Ÿ”ง Granular Control: Toggle individual features independently via commands or config GUI

Advanced Features

  • ๐Ÿ‘ฅ Mob Loot Splitting: Share mob drops and XP with nearby players who participated in the kill
  • ๐ŸŽฎ Per-Player Permissions: Server admins can override settings for specific players
  • ๐Ÿ’พ Client Profiles: Automatic per-server/world configuration profiles for seamless server switching
  • ๐Ÿ”Œ Extensive Mod Compatibility: Works automatically with VeinMiner, TreeHarvester, Traveler's Backpack, and more

One-Block Mining


โš™๏ธ Configuration

Auto Pickup uses a flexible three-tier permission system:

  1. Server Defaults - Global fallback settings
  2. Admin Overrides - Per-player forced settings (highest priority)
  3. Client Preferences - Individual player choices (only if server allows)

๐Ÿ–ฅ๏ธ Mod Menu Integration (Client)

If you have Mod Menu and YetAnotherConfigLib (YACL) installed, you can configure your personal preferences via the Mods menu.

Settings available:

  • Master Toggle
  • Block Item Pickup
  • Block Experience Pickup
  • Mob Loot Pickup
  • Mob Experience Pickup
  • Split Mob Loot (share drops with nearby attackers)
  • Split Mob XP (share experience with nearby attackers)

Note: Your client settings only apply if the server admin has enabled the corresponding "Allow" setting for that feature.

YACL Menu


๐Ÿ“œ Commands (Server Admin)

Server operators (OP Level 2+) can manage global defaults and player overrides using /autopickup.

Global Configuration

Command Description Default
/autopickup Display current configuration status -
/autopickup master <true|false> Master toggle - disables mod entirely if false true
/autopickup blocks <true|false> Auto-pickup items from broken blocks true
/autopickup blockxp <true|false> Auto-pickup experience from broken blocks true
/autopickup mobloot <true|false> Auto-pickup loot from killed mobs false
/autopickup mobxp <true|false> Auto-pickup experience from killed mobs false
/autopickup splitmobloot <true|false> Share mob loot among nearby attackers false
/autopickup splitmobxp <true|false> Share mob XP among nearby attackers false

Client Control Allowances

These commands determine whether players can override server defaults with their client settings.

Command Description Default
/autopickup allow master <true|false> Allow clients to toggle master switch false
/autopickup allow blocks <true|false> Allow clients to toggle block item pickup false
/autopickup allow blockxp <true|false> Allow clients to toggle block XP pickup false
/autopickup allow mobloot <true|false> Allow clients to toggle mob loot pickup false
/autopickup allow mobxp <true|false> Allow clients to toggle mob XP pickup false
/autopickup allow splitmobloot <true|false> Allow clients to toggle mob loot splitting false
/autopickup allow splitmobxp <true|false> Allow clients to toggle mob XP splitting false

Per-Player Overrides

Force specific settings for individual players (overrides both server defaults and client preferences).

Command Description
/autopickup override <player> master <true|false|default> Override player's master toggle
/autopickup override <player> blocks <true|false|default> Override player's block pickup
/autopickup override <player> blockxp <true|false|default> Override player's block XP
/autopickup override <player> mobloot <true|false|default> Override player's mob loot
/autopickup override <player> mobxp <true|false|default> Override player's mob XP
/autopickup override <player> splitmobloot <true|false|default> Override player's loot splitting
/autopickup override <player> splitmobxp <true|false|default> Override player's XP splitting
/autopickup override <player> clear Remove all overrides for a player

Use default to remove a specific override while keeping others.


๐Ÿ“‚ Configuration Files

Server Config: config/AutoPickup/global_config.json

{
  "autoPickup": true,
  "autoPickupBlocks": true,
  "autoPickupBlockXp": true,
  "autoPickupMobLoot": false,
  "autoPickupMobXp": false,
  "autoPickupSplitMobLoot": false,
  "autoPickupSplitMobXp": false,
  "allowMaster": false,
  "allowBlocks": false,
  "allowBlockXp": false,
  "allowMobLoot": false,
  "allowMobXp": false,
  "allowSplitMobLoot": false,
  "allowSplitMobXp": false
}

Client Config: config/AutoPickup/client_default.toml (or per-server profiles in presets/)

# AutoPickup Client Configuration
master = true
blocks = true
blockXp = true
mobLoot = false
mobXp = false
splitMobLoot = false
splitMobXp = false

Player Overrides: config/AutoPickup/player_overrides.json

{
  "player-uuid-here": {
    "overrideMaster": true,
    "overrideBlocks": null,
    ...
  }
}

๐Ÿ“ฆ Installation

Client & Server

  1. Install Fabric Loader
  2. Download Fabric API and place in mods/
  3. Download Auto Pickup from the releases page
  4. Place auto-pickup-x.x.x.jar in your mods/ folder

Optional But Recommended Client Dependencies

  • Mod Menu - Access config screen in-game
  • YetAnotherConfigLib (YACL) - Required for config GUI (fallback notice shown if missing)

โœ… Compatibility

Auto Pickup hooks into core Minecraft mechanics and works seamlessly with most mods out of the box.

๐Ÿ”ง Explicitly Supported Mods

Mod Status Notes
VeinMiner โœ… Full All vein blocks picked up instantly with XP
TreeHarvester โœ… Full Logs/leaves collected; saplings auto-replanted if enabled
Traveler's Backpack โœ… Full Items route to backpack filter first (1.21.9+ with Auto Pickup upgrade)
General Block Breakers โœ… Compatible Any mod using vanilla break hooks

๐Ÿ“‹ Technical Details

Auto Pickup intercepts drops at these injection points:

  • Block.dropStacks() - Primary block drop handling
  • ServerWorld.spawnEntity() - Item entity spawning
  • LivingEntity.dropLoot() - Mob loot generation
  • Block.dropExperience() - Block XP orbs
  • LivingEntity.dropExperience() - Mob XP orbs

This broad compatibility means most mods work automatically without explicit support.

MultiBlock Mining


๐ŸŽฎ Mob Loot Splitting

When Split Mob Loot or Split Mob XP is enabled, rewards from mob kills are shared among participants:

How It Works

  1. Damage Tracking: The mod tracks the last 10 unique players who damaged each mob
  2. Eligibility Check: On mob death, only players who:
    • Are online and not spectating
    • Have Master enabled
    • Have the specific Mob Pickup feature enabled
    • Have the specific Split feature enabled
    • Are in the same world as the killer
  3. Distribution:
    • Items are split evenly; the killer receives any remainder
    • Experience is split evenly; the killer receives any remainder
    • Items that don't fit in inventories are dropped at the mob's location

Example

Player A (killer), B, and C all damaged a zombie. Settings:

  • Player A: Master โœ…, Mob Loot โœ…, Split Mob Loot โœ…
  • Player B: Master โœ…, Mob Loot โœ…, Split Mob Loot โœ…
  • Player C: Master โœ…, Mob Loot โœ…, Split Mob Loot โŒ

Result: Only A and B receive split loot. Player C gets nothing because they disabled splitting.


๐Ÿ‘ฉโ€๐Ÿ’ป Developer API

Adding as a Dependency

Gradle:

dependencies {
    modCompileOnly files("libs/auto-pickup-x.x.x.jar")
}

Using the API

import com.lukarbonite.autopickup.AutoPickupApi;
import net.fabricmc.loader.api.FabricLoader;

public class QuestRewards {
    
    public void giveReward(PlayerEntity player, List<ItemStack> items, int xp) {
        if (!FabricLoader.getInstance().isModLoaded("auto-pickup")) {
            // Fallback: manual drops
            items.forEach(stack -> player.dropItem(stack, false));
            player.addExperience(xp);
            return;
        }
        
        // Auto Pickup handles:
        // - Inventory insertion
        // - Traveler's Backpack routing
        // - Config checks (Master, Blocks, etc.)
        List<ItemStack> remaining = AutoPickupApi.tryPickup(player, items);
        
        // Drop items that didn't fit
        remaining.forEach(stack -> player.dropItem(stack, false));
        
        // Auto Pickup handles:
        // - Mending calculations
        // - Config checks
        AutoPickupApi.tryPickupBlockExperience(player, xp);
    }
    
    // For mob-related rewards
    public void giveMobReward(PlayerEntity player, List<ItemStack> loot, int xp) {
        List<ItemStack> remaining = AutoPickupApi.tryPickupFromMob(player, loot);
        remaining.forEach(stack -> player.dropItem(stack, false));
        
        AutoPickupApi.tryPickupMobExperience(player, xp);
    }
}

API Methods

Method Description
tryPickup(PlayerEntity, List<ItemStack>) Pickup items from blocks (respects Master + Blocks settings)
tryPickupFromMob(PlayerEntity, List<ItemStack>) Pickup items from mobs (respects Master + MobLoot settings)
tryPickupBlockExperience(PlayerEntity, int) Give block XP (respects Master + BlockXP settings)
tryPickupMobExperience(PlayerEntity, int) Give mob XP (respects Master + MobXP settings)
isMasterEnabled(PlayerEntity) Check if auto-pickup is enabled for player
isBlocksEnabled(PlayerEntity) Check block item pickup setting
isBlockXpEnabled(PlayerEntity) Check block XP pickup setting
isMobLootEnabled(PlayerEntity) Check mob loot pickup setting
isMobXpEnabled(PlayerEntity) Check mob XP pickup setting

Note: All try* methods return lists of items that could not be picked up (full inventory).


๐Ÿ“œ License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).

You are free to:

  • โœ… Use in modpacks
  • โœ… Modify for personal use
  • โœ… Distribute modified versions (must also be AGPL-3.0)

See the LICENSE file for full details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages