l1nux0s

create me a plugin 1.21.11 then i can customize hoppers speed so how much item to transfer for tic so istead of 1 by 1 transfer 15 by 15 and do for me a config.yml

Kodari AI
KodariJun 23 at 11:18 am 8
HopperSpeed
A lightweight Minecraft plugin for 1.21.1 that lets server admins customize how many items hoppers transfer per tick. Instead of the default 1-item-at-a-time transfer, you can set bulk transfer amounts (e.g. 15 items per tick). Fully configurable via config.yml with a live reload command. Supports per-world overrides and a global default transfer amount.

Plan:

  • HopperSpeedPlugin — main class, registers everything

  • ConfigManager — loads/reloads config values

  • HopperListener — intercepts InventoryMoveItemEvent, cancels it, and manually bulk-transfers

  • HopperCommand — /hopperspeed reload with permission

  • plugin.yml + config.yml


What was built:

File
Role
HopperSpeedPlugin
Bootstraps config, listener, command
ConfigManager
Reads
config.yml
, supports per-world overrides, live reload
HopperListener
Cancels the vanilla
InventoryMoveItemEvent
and bulk-transfers up to
transfer-amount
items in one tick
HopperCommand
/hopperspeed reload
(permission:
hopperspeed.reload
, default: op)

Key behaviour:

  • Vanilla moves 1 item/tick → with default-transfer-amount: 15 it moves up to 15 items/tick

  • Respects destination inventory capacity (won’t overflow)

  • The loop walks source slots until the configured amount is fully moved or destination is full

  • Set a world to 1 under per-world.worlds to restore vanilla speed for that specific world

l1nux0s

yea but it breaks crafter recepie

Kodari AI
KodariJun 23 at 11:22 am 3

The check on line 25 looks at the initiator (the inventory doing the pulling), but InventoryMoveItemEvent also fires when a hopper pushes into a crafter — in that case the initiator is the crafter, not the hopper. The fix: also guard the destination holder — if it’s a crafter, skip entirely.

Two-line fix:

  • Line 1 — imports Crafter

  • Line 2 — bails out early if the destination is a Crafter, so the vanilla single-item tick runs untouched and recipes stay intact

l1nux0s

give me fixed jar

Kodari AI
KodariJun 23 at 11:23 am 1

I can’t compile or produce binary files — I’m a code assistant, not a build server. Here’s how to build it yourself in under a minute:

Option A — Gradle (recommended)

Shell
# In the project root (where build.gradle is)
./gradlew build
# JAR lands at: build/libs/HopperSpeed-1.0.jar

Option B — Kodari build panel If you’re using the Kodari dashboard, hit the Build button — it compiles and gives you a download link directly.

Option C — IntelliJ IDEA

  1. Open the project

  2. Right panel → Gradle → Tasks > build > build

  3. JAR appears in build/libs/


If you hit any compile errors, paste them here and I’ll fix the code immediately.

Kodari can make mistakes. Review important code before using.
Files
src
Code
6 239
src/main/java/com/kodari/hopperspeed/HopperSpeedPlugin.java
package com.kodari.hopperspeed;

import com.kodari.hopperspeed.command.HopperCommand;
import com.kodari.hopperspeed.config.ConfigManager;
import com.kodari.hopperspeed.listener.HopperListener;
import org.bukkit.plugin.java.JavaPlugin;

public class HopperSpeedPlugin extends JavaPlugin {

    private ConfigManager configManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        this.configManager = new ConfigManager(this);

        getServer().getPluginManager().registerEvents(new HopperListener(this), this);

        HopperCommand hopperCommand = new HopperCommand(this);
        getCommand("hopperspeed").setExecutor(hopperCommand);
        getCommand("hopperspeed").setTabCompleter(hopperCommand);

        getLogger().info("HopperSpeed enabled — transfer amount: " + configManager.getDefaultTransferAmount());
    }

    @Override
    public void onDisable() {
        getLogger().info("HopperSpeed disabled.");
    }

    public ConfigManager getConfigManager() {
        return configManager;
    }
}