Build a Minecraft server plugin for the newly created Item Inventory Management project. User's requested scope: Minecraft 26.X; impose a combined cap of 30 total RESPawn_ANCHOR + END_CRYSTAL items in each player's inventory; only netherite ingots and netherite blocks may not be stored in any non-player inventory/container. Players may keep them in their own inventory, drop them, and other players may pick them up. Implement the plugin in the project’s existing framework and conventions; inspect the project source/config before editing. Requirements: 1) The cap is the combined item count, not 30 each, and allows any split as long as total <=30 (e.g. 17 anchors + 13 crystals). Prevent player actions that would raise the total above 30; handle stack amounts correctly and include player inventory slots (including offhand/armor if the platform regards those as inventory). Preserve/allow actions that leave total within limit. If excess items are already present or are introduced by an external mechanism, safely normalize/remove only the excess and do not delete unrelated items; choose sensible user feedback. 2) Netherite ingot and netherite block must not be inserted into or moved into any non-player inventory/container, including common click/drag/shift-click/hotbar-swap, hopper/dropper/dispenser and other inventory-transfer paths. They may be moved from an existing container into a player inventory, and may be dropped/picked up by players. Avoid permitting indirect storage where feasible (e.g. item frames/storage-like entities or placing a netherite block into the world); document any platform limitations clearly. Do not prohibit unrelated item types and do not incorrectly prohibit player inventory. 3) Include a plugin descriptor and concise user-facing messages/configuration as appropriate; no external dependencies unless required by the existing project. Do not add tests. Do not attempt to build; Kodari will compile it after your changes. Return a concise summary of files/features changed and any meaningful platform limitations.

Kodari AI
KodariOct 29 at 8:03 pm 2
NetheriteAnchorCrystalGuard
Minecraft plugin enforcing a combined 30-item cap on RESPawn_ANCHOR and END_CRYSTAL per player inventory, and preventing netherite ingots/blocks from entering any non-player container. Handles click, drag, shift-click, hotbar-swap, hopper, dropper, and dispenser transfer paths. Normalizes excess items, provides user feedback, and documents platform limitations.
  1. Add the plugin entry point and configuration for the combined 30-item cap.

  2. Enforce inventory limits and block netherite storage through clicks, drags, transfers, pickups, and indirect storage interactions.

  3. Normalize any excess items without affecting unrelated items.

Added the plugin entry point, descriptor, and configuration. It enforces a combined default cap of 30 respawn anchors and end crystals across storage, armor, and offhand slots; excess is removed only from those items. Netherite ingots and blocks are blocked from container transfers, item frames, and armor stands, and netherite blocks cannot be placed.

Limitation: direct writes by other plugins or custom storage systems that bypass Bukkit inventory events cannot be intercepted; excess in an online player’s inventory is normalized within about one second. No build was attempted.

Kodari can make mistakes. Review important code before using.
Files
src
Code
4 408
src/main/java/com/kodari/iteminventory/ItemInventoryManagementPlugin.java
package com.kodari.iteminventory;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public final class ItemInventoryManagementPlugin extends JavaPlugin {
    @Override
    public void onEnable() {
        saveDefaultConfig();
        InventoryRulesListener listener = new InventoryRulesListener(this);
        getServer().getPluginManager().registerEvents(listener, this);
        getServer().getScheduler().runTaskTimer(this, () -> {
            for (Player player : Bukkit.getOnlinePlayers()) {
                listener.normalizeInventory(player);
            }
        }, 1L, 20L);
    }
}