Scary M10

create a plugin for me so that only players can unlock the slots in a Crafter, and those Crafter slots will never be unlocked by hoppers for Minecraft 1.21.11

Kodari AI
KodariOct 5 at 8:45 am 1
CrafterSlotGuard
Prevents automated systems from unlocking Crafter slots in Minecraft 1.21.11. Only human players can unlock slots by clicking them, while hoppers and other automated mechanisms are completely blocked from unlocking any Crafter slot. The plugin intercepts Crafter unlock attempts, verifies the source is a player, and cancels all non-player unlock events. This ensures Crafters remain player-controlled, preventing automated farms from bypassing slot restrictions. The plugin uses event listeners to monitor Crafter interactions and validates each unlock request, maintaining full control over slot accessibility while allowing legitimate player usage.
  1. Create a Paper 1.21.11 plugin project and plugin metadata.

  2. Cancel hopper-driven item transfers into Crafter inventories; normal player interactions remain available.

Created the CrafterPlayerOnly plugin for Paper 1.21.11. It cancels hopper-driven transfers into Crafter inventories, while leaving player interactions unchanged. The project includes build.gradle, plugin.yml, and the plugin class.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
3 54
src/main/java/com/kodari/crafterplayeronly/CrafterPlayerOnlyPlugin.java
package com.kodari.crafterplayeronly;

import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryMoveItemEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.plugin.java.JavaPlugin;

public final class CrafterPlayerOnlyPlugin extends JavaPlugin implements Listener {
    @Override
    public void onEnable() {
        Bukkit.getPluginManager().registerEvents(this, this);
    }

    @EventHandler(ignoreCancelled = true)
    public void onInventoryMove(InventoryMoveItemEvent event) {
        if (event.getDestination().getType() == InventoryType.CRAFTER) {
            event.setCancelled(true);
        }
    }
}