znsuyt

make a minecraft plugin which gives me longer crafting table gui in minecraft.. for example. if i open crafting table and then someone or something pushes me away from the crafting table the gui should not close.. it should me like 10 blocks

Kodari AI
KodariOct 16 at 3:31 pm 1
PersistentCraftingGUI
Extends the vanilla crafting table interface so it remains open when the player moves away from the block. The GUI stays active within a 10-block radius instead of closing immediately upon distance. Uses a custom GUI framework to track and manage open crafting inventories, overriding default close behavior. Players can continue crafting even when pushed or walking away from the table, with the interface closing only when the player exceeds the extended range or manually closes it. Includes configurable distance settings and automatic cleanup for disconnected players.

Created ExtendedCraftingRange. Right-clicking a crafting table opens a virtual crafting-table menu that stays open while you’re within 10 blocks of that table; it closes if you move farther away, change worlds, close it, or disconnect.

znsuyt

make again this is not compiling

Kodari AI
KodariOct 16 at 3:34 pm 1

I’ll rebuild the plugin from scratch with:

  • A virtual crafting-table inventory so moving away doesn’t trigger vanilla’s block-distance close.

  • A 10-block distance limit, with the menu closing beyond that or when changing worlds.

  • Fresh Paper and Java build configuration.

Rebuilt the plugin with fresh Paper 1.21.4 and Java 21 configuration. It opens a virtual crafting-table menu when you right-click a crafting table, keeps it open within 10 blocks, and closes it if you go farther away or change worlds.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
5 133
src/main/java/com/example/extendedcraftingrange/ExtendedCraftingRangePlugin.java
package com.example.extendedcraftingrange;

import org.bukkit.plugin.java.JavaPlugin;

public final class ExtendedCraftingRangePlugin extends JavaPlugin {
    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(new CraftingRangeListener(this), this);
    }
}