javakonu

Fully configurable via config.yml: messages, prefixes, sounds, INVENTORY GUI sizes, INVENTORY GUI titles, filler items, slot layouts, action bars. MiniMessage support.

Commands:

/ping [player] — qol.ping /trash — qol.trash /enderchest [player] — qol.enderchest /playtime [player] — qol.playtime /grindstone — qol.grindstone /loom — qol.loom /stonecutter — qol.stonecutter /cartographytable — qol.cartography /anvil — qol.anvil /smithingtable — qol.smithing /craft — qol.craft

Every INVENTORY GUI: configurable row count, title, border/filler material. Each command independently toggle-able in config.

Kodari AI
KodariJun 30 at 3:52 am 1

I’ll create a comprehensive QoL plugin with configurable GUIs and workstation access.

QoLPlugin
A fully configurable Quality of Life plugin providing quick-access workstations, trash disposal, ping display, ender chest access, playtime tracking, and crafting table. All commands are independently toggleable with configurable GUI sizes, titles, filler items, and MiniMessage-formatted messages.

Let me create all 19 files for the project.

All 19 files created. Here’s a summary of the project structure:

Core — QoLPlugin.java with singleton access, command registration, and formatMessage() helper for config-based MiniMessage message formatting with placeholders.

GUI Framework — inventory/ package with InventoryGUI (lazy-init), InventoryButton, InventoryHandler, GUIManager, and GUIListener. The TrashGUI in impl/ accepts configurable rows (1-6), title, and border filler material with automatic void on close.

12 Commands, each independently toggleable in config.yml:

  • /ping [player] — shows ping via Spigot API, qol.ping

  • /trash — opens the configurable trash GUI, qol.trash

  • /enderchest [player] — open own or others’ ender chest, qol.enderchest / qol.enderchest.others

  • /playtime [player] — accumulated session playtime saved to playtime.yml, qol.playtime

  • /grindstone, /loom, /stonecutter, /cartographytable, /anvil, /smithingtable — open native workstations via a single reusable WorkstationCommand class, each with its own permission

  • /craft — opens workbench, qol.craft

  • /qol reload — reloads config, qol.reload

Playtime — PlaytimeManager tracks join/quit session times, stores totals in playtime.yml, auto-saves every 5 minutes, and formats as Xh Ym Zs.

Config — All messages use MiniMessage with <prefix> placeholder, each GUI has configurable rows/title/filler, every command has an enabled toggle with proper disabled handling.

javakonu

Good, make the playtime counting use this: %statistic_time_played%

Kodari AI
KodariJun 30 at 4:13 am 1

Now let me remove the save-on-disable call from QoLPlugin.java since we no longer need manual persistence

All done. PlaytimeManager now reads directly from %statistic_time_played% (Bukkit’s Statistic.PLAY_ONE_MINUTE — which is the underlying statistic):

  • No more manual tracking — no session start/stop, no onJoin/onQuit events, no playtime.yml file, no periodic save tasks

  • Authoritative source — uses the server’s native playtime statistic which persists across restarts automatically

  • Simplified — PlaytimeManager reduced from 108 lines to just 8, QoLPlugin.onDisable() is now empty since there’s nothing to persist

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
19 826
src/main/java/com/qolplugin/QoLPlugin.java
package com.qolplugin;

import com.qolplugin.commands.*;
import com.qolplugin.inventory.gui.GUIListener;
import com.qolplugin.inventory.gui.GUIManager;
import com.qolplugin.manager.PlaytimeManager;
import com.qolplugin.util.ColorUtil;
import net.kyori.adventure.text.Component;
import org.bukkit.plugin.java.JavaPlugin;

public class QoLPlugin extends JavaPlugin {
    private static QoLPlugin instance;
    private GUIManager guiManager;
    private PlaytimeManager playtimeManager;

    @Override
    public void onEnable() {
        instance = this;
        saveDefaultConfig();

        this.guiManager = new GUIManager();
        this.playtimeManager = new PlaytimeManager(this);

        getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);

        registerCommands();
        getLogger().info("QoLPlugin enabled!");
    }

    @Override
    public void onDisable() {
    }

    private void registerCommands() {
        getCommand("ping").setExecutor(new PingCommand());
        getCommand("trash").setExecutor(new TrashCommand(guiManager));
        getCommand("enderchest").setExecutor(new EnderchestCommand());
        getCommand("playtime").setExecutor(new PlaytimeCommand(playtimeManager));

        getCommand("grindstone").setExecutor(new WorkstationCommand("grindstone", "qol.grindstone",
                p -> p.openGrindstone(null, true)));
        getCommand("loom").setExecutor(new WorkstationCommand("loom", "qol.loom",
                p -> p.openLoom(null, true)));
        getCommand("stonecutter").setExecutor(new WorkstationCommand("stonecutter", "qol.stonecutter",
                p -> p.openStonecutter(null, true)));
        getCommand("cartographytable").setExecutor(new WorkstationCommand("cartographytable", "qol.cartography",
                p -> p.openCartographyTable(null, true)));
        getCommand("anvil").setExecutor(new WorkstationCommand("anvil", "qol.anvil",
                p -> p.openAnvil(null, true)));
        getCommand("smithingtable").setExecutor(new WorkstationCommand("smithingtable", "qol.smithing",
                p -> p.openSmithingTable(null, true)));

        getCommand("craft").setExecutor(new CraftCommand());
        getCommand("qol").setExecutor(new ReloadCommand());
    }

    /**
     * Format a message from config with MiniMessage and placeholder replacement.
     * Placeholders are paired as key, value, key, value, ...
     */
    public static Component formatMessage(String key, String... replacements) {
        String message = instance.getConfig().getString("messages." + key, "");
        String prefix = instance.getConfig().getString("messages.prefix", "");
        message = message.replace("<prefix>", prefix);
        for (int i = 0; i < replacements.length - 1; i += 2) {
            message = message.replace(replacements[i], replacements[i + 1]);
        }
        return ColorUtil.colorize(message);
    }

    public static QoLPlugin getInstance() {
        return instance;
    }

    public GUIManager getGuiManager() {
        return guiManager;
    }

    public PlaytimeManager getPlaytimeManager() {
        return playtimeManager;
    }
}