-
Notifications
You must be signed in to change notification settings - Fork 0
26.1.2 Smart Pickup and Inventory Distribution
This document details the chunked iterative inventory intake, capacity simulation, vanilla stack creation, and zero-NBT pollution architecture of Item Clumps for Minecraft 26.1.2.
| Property | Specification |
|---|---|
| System Name | Chunked Inventory Dispatcher |
| Target Class | net.minecraft.world.entity.item.ItemEntity |
| Inventory Limits | Strict vanilla compliance ( |
| Data Cleanliness |
|
| Pickup Loop | Chunked iteration (Math.min(count, maxStack)) |
| Statistics Tracking | Triggers vanilla Stats.ITEM_PICKED_UP.get(item)
|
In Minecraft 26.1.2, Item Clumps feeds mega-clumps into the player inventory using a chunked while-loop that breaks down large quantities into safe, vanilla-sized stacks (e.g. 64 at a time):
┌──────────────────────────────────────────────┐
│ Player Collides with Ground Clump (e.g. 500x)│
└──────────────────────┬───────────────────────┘
│
▼
┌──────────────────────────────────────────────┐
│ Pickup Validity & Target Check │
│ - pickupDelay == 0? │
│ - target == null || target == player? │
└──────────────────────┬───────────────────────┘
│ (Pass)
▼
┌──────────────────────────────────────────────┐
│ Iterative Chunked Loop │
│ toTake = Math.min(count, maxStackSize) │
│ player.getInventory().add(chunk) │
└──────────────────────┬───────────────────────┘
│
┌─────────────────┴─────────────────┐
│ │
Inventory Has Space Inventory Becomes Full
│ │
▼ ▼
┌─────────────────────────┐ ┌─────────────────────────┐
│ Entire Clump Absorbed │ │ Partial Pickup │
│ - 500 items transferred │ │ - Transferred what fits │
│ - Clump entity removed │ │ - Remaining items stay │
│ - Sound & particles play│ │ in ground clump │
└─────────────────────────┘ └─────────────────────────┘
From ItemEntityMixin.java in Minecraft 26.1.2:
@Inject(method = "playerTouch", at = @At("HEAD"), cancellable = true)
private void item_clumps$smartPickup(Player player, CallbackInfo ci) {
if (!DynamicGameRuleManager.getBoolean(this.level(), ItemClumpsFabric.ENABLE_CLUMPING) ||
this.level().isClientSide()) return;
int count = this.getItem().getCount();
if (count <= 1) return; // Allow vanilla to handle normal 1-count items
ItemStack baseItem = this.getItem().copy();
baseItem.setCount(1); // Ensure base count is 1 for simulation
if (this.pickupDelay == 0 && (this.target == null || this.target.equals(player.getUUID()))) {
int originalCount = count;
int maxStack = baseItem.getMaxStackSize();
while (count > 0) {
int toTake = Math.min(count, maxStack);
ItemStack chunk = baseItem.copy();
chunk.setCount(toTake);
player.getInventory().add(chunk);
int added = toTake - chunk.getCount();
if (added > 0) {
count -= added;
player.take(this, added);
player.awardStat(net.minecraft.stats.Stats.ITEM_PICKED_UP.get(baseItem.getItem()), added);
}
if (!chunk.isEmpty()) {
// Player inventory is full
break;
}
}
if (count != originalCount) {
ItemStack stack = this.getItem();
stack.setCount(count);
this.setItem(stack);
if (count <= 0) {
player.onItemPickup((ItemEntity) (Object) this);
}
}
ci.cancel(); // Prevent vanilla pickup interference
}
}Item Clumps is engineered with ❤️ by Dasik (Rifaditya) | Licensed under GNU General Public License v3.0 (GPL-3.0-or-later).
📌 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.
- 26.2 Hub
- 26.2 Mega-Stack Clumping
- 26.2 Smart Pickup System
- 26.2 Hopper Integration
- 26.2 Despawn Age Rules
- 26.2 Holographic Labels
- 26.2 Mod Compatibility
- 26.2 GameRules Table
- 26.2 Commands & Admin
- 26.2 Advancements
- 26.2 Configuration
- 26.2 ModVersionGuard
- 26.2 Architecture & Mixins
- 26.2 Developer Setup
- 26.2 API & Addons
- 26.2 FAQ & Diagnostics
- 26.1.2 Hub
- 26.1.2 Mega-Stack Clumping
- 26.1.2 Smart Pickup System
- 26.1.2 Hopper Integration
- 26.1.2 Despawn Age Rules
- 26.1.2 Holographic Labels
- 26.1.2 GameRules Table
- 26.1.2 Commands & Admin
- 26.1.2 Advancements
- 26.1.2 Configuration
- 26.1.2 Architecture & Mixins
- 26.1.2 Developer Setup
- 26.1.2 API & Addons
- 26.1.2 FAQ & Diagnostics