Naman Kumar Gupta

Create a Complete Minecraft Plugin: DailyOrBan Act as an expert Minecraft Java plugin developer. Create a complete, working Minecraft plugin named DailyOrBan for Paper/Spigot servers.

  1. Plugin concept

Every player receives exactly ONE daily task. They must complete it within 24 hours of the task being assigned.

If the player completes the task before the deadline, they survive and become eligible for their next daily task.

If the player fails to complete the task within 24 hours, the plugin automatically bans them for 24 hours.

There are no money rewards, economy integrations, or external plugin dependencies.

The system must work automatically without requiring an administrator to assign tasks manually.

  1. Technical requirements

Language: Java API: Paper/Spigot Build system: Maven Plugin name: DailyOrBan Main class: com.naman.dailyorban.DailyOrBan Plugin version: 1.0.0 Use a configurable Minecraft API version compatible with the selected server version.

Provide a complete pom.xml, plugin.yml, Java source files, and configuration files.

Do not use pseudocode, placeholders, or missing methods. Generate complete source code that compiles.

If the server version is unknown, ask me for it before generating version-specific code.

  1. Daily task system

Create a pool of configurable tasks, such as:

Break 32 stone blocks.

Collect 16 oak logs.

Kill 5 zombies.

Harvest 16 wheat.

Craft 8 bread.

Mine 5 coal ores.

Requirements:

Assign one random, valid task to each eligible player.

Track progress automatically using Minecraft events.

Display task name, required amount, current progress, and remaining time.

Do not count unrelated blocks, items, mobs, or actions.

Prevent duplicate task assignment during the same task cycle.

Validate task completion server-side.

Once completed, do not assign another task immediately. Assign the next task according to the configured daily cycle.

Make task definitions editable in config.yml.

  1. Deadline and automatic banning

Give every assigned task a deadline exactly 24 hours after its assignment timestamp.

Save the assignment timestamp and deadline.

Check expired tasks automatically, including after server restarts.

When the deadline expires without completion, issue a 24-hour ban.

Store the ban expiry timestamp so restarts do not reset the ban duration.

Display a clear reason when a player is banned.

Notify players of their task and remaining time.

Use persistent storage so a player cannot escape the deadline by logging out or restarting the server.

Ensure the task is checked and the ban is applied exactly once.

Avoid scheduling one repeating task per player when a single central scheduler can handle deadline checks.

  1. Persistence

Use SQLite or another reliable local persistent database.

Persist:

Player UUID and last known name.

Current task identifier.

Required task amount and progress.

Assignment timestamp and deadline.

Task completion status.

Ban expiry timestamp and ban status.

Requirements:

Survive server restarts and crashes.

Use UUIDs as player identifiers, not usernames.

Handle offline players.

Use safe database access and close resources properly.

Avoid losing progress during normal shutdown.

Prevent duplicate assignments and duplicate bans.

  1. Commands

Implement the following commands. /daily Shows:

Current task.

Progress, such as 12/32.

Time remaining in hours, minutes, and seconds.

Whether the task is completed. /dailyadmin status <player> Shows the player's task, progress, deadline, and ban status. /dailyadmin assign <player> Assigns a new task to a player only when appropriate. Do not silently overwrite an existing task. /dailyadmin complete <player> Marks the current task complete and prevents a deadline ban for that task. /dailyadmin reset <player> Resets the player's current task and assigns a fresh 24-hour deadline after confirmation or an explicit administrative action. /dailyadmin unban <player> Removes the DailyOrBan ban and updates the plugin's stored ban status. /dailyadmin reload Reloads configuration safely without losing player progress or changing existing deadlines.

Include proper tab completion and meaningful error messages.

  1. Permissions

Implement: dailyorban.use — access to /daily. dailyorban.admin — access to all administrative commands.

Default ordinary player access to /daily should be enabled. Administrative access must be restricted to operators or explicitly authorized staff.

  1. Configuration

Create a complete config.yml containing:

Task pool and task amounts.

Task assignment settings.

Task deadline duration, default 24 hours.

Ban duration, default 24 hours.

Message customization.

Deadline-check interval.

Database settings where appropriate.

Time zone or deadline-related settings where applicable.

Do not reset active players' deadlines when configuration is reloaded.

  1. Important edge cases

Handle:

Players logging out before their deadline.

Players remaining offline past their deadline.

Server restarts and crashes.

Players completing tasks just before the deadline.

Players reconnecting after their ban expires.

Duplicate event processing.

Invalid or disabled tasks.

Missing permissions.

Administrator intervention.

Database errors.

Players attempting to manipulate progress.

Use a consistent time source and clearly define how deadlines are compared. Ensure task completion and deadline processing cannot both produce contradictory outcomes.

Use a proper persistent ban mechanism that survives restarts. Make sure the ban expires after 24 hours and that the player can rejoin after expiry, even if the server was offline when the ban should have ended.

  1. Deliverables

Provide:

The complete project directory structure.

Every Java source file in full.

Complete pom.xml.

Complete plugin.yml.

Complete config.yml.

Database initialization and persistence implementation.

Beginner-friendly build instructions using Maven.

Instructions for importing the project into IntelliJ IDEA or Eclipse.

Instructions for building the plugin JAR.

Instructions for installing it into the server's plugins folder.

A testing checklist covering task assignment, progress tracking, completion, missed deadlines, restarts, and ban expiry.

A list of commands and permissions.

Explain where each file belongs. If you have access to a coding environment, create the complete project and build it. Otherwise, provide all source files needed to build it locally.

Do not claim the plugin works unless you have successfully compiled and tested it. Fix compilation errors before presenting the final result.

Start by confirming the target Minecraft/Paper/Spigot version, then build the complete project.

Kodari AI
KodariOct 20 at 7:36 am 1
DailyOrBan
Automated daily task system that assigns each player one random task with a 24-hour deadline. Tracks progress through Bukkit events, persists assignments and bans in SQLite, and automatically bans players who fail their deadline for a configurable 24-hour period. Features a GUI command interface showing progress and remaining time, admin commands for managing tasks and bans, configurable task pool and durations, and full restart-safe persistence ensuring players cannot escape deadlines by disconnecting.

What Minecraft server version should DailyOrBan target—for example, Paper 1.21.4 or Spigot 1.20.4?

Naman Kumar Gupta

Let's continue

Kodari AI
KodariOct 20 at 7:40 am 1

What Minecraft server version should DailyOrBan target—for example, Paper 1.21.4 or Spigot 1.20.4?

Naman Kumar Gupta

Latest

Kodari AI
KodariOct 20 at 7:40 am 1

Which Minecraft server version should DailyOrBan target, and should it support Paper, Spigot, or both? For example: “Paper 1.21.4” or “Spigot 1.20.4.”

Naman Kumar Gupta

Paper 26.1

Kodari AI
KodariOct 20 at 7:55 am 2
  1. Build the Paper 26.1 Maven project and persistent SQLite-backed task/banning core.

  2. Add configurable tasks, automatic progress/deadline handling, commands, permissions, and messages.

  3. Include project/import/install guidance and a testing checklist; the environment does not provide local Maven compilation.

Created the DailyOrBan Paper 26.1 Maven project with the plugin entry point com.naman.dailyorban.DailyOrBan.

Included pom.xml, plugin.yml, config.yml, all Java source files, SQLite persistence, configurable task types and cycle settings, /daily and /dailyadmin commands, permissions, and project/import/testing guidance in README.md. Progress is saved as it occurs; task deadlines are preserved on reload and restart, and ban expiry is stored so downtime does not extend a ban.

Verification: I have not compiled the project or tested it on a Paper 26.1 server, so I can’t claim it works yet. To compile it in Kodari, click Compile in the desktop top bar (or ⋮ → Compile Project on phone), then Compile in the build window. Download the JAR if the build succeeds.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
README.md
Code
12 1,205
src/main/java/com/naman/dailyorban/DailyOrBan.java
package com.naman.dailyorban;

import com.naman.dailyorban.command.DailyAdminCommand;
import com.naman.dailyorban.command.DailyCommand;
import com.naman.dailyorban.listener.TaskListener;
import com.naman.dailyorban.storage.SQLiteStore;
import com.naman.dailyorban.task.TaskManager;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

import java.nio.file.Files;
import java.nio.file.Path;

public final class DailyOrBan extends JavaPlugin {
    private SQLiteStore store;
    private TaskManager taskManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        try {
            Path dataFolder = getDataFolder().toPath();
            Files.createDirectories(dataFolder);
            String databaseFile = getConfig().getString("database.file", "dailyorban.db");
            Path databasePath = dataFolder.resolve(databaseFile).normalize();
            if (!databasePath.startsWith(dataFolder.normalize())) {
                throw new IllegalArgumentException("database.file must stay inside the plugin data folder");
            }
            store = new SQLiteStore(databasePath);
            taskManager = new TaskManager(this, store);
            taskManager.loadPersistentStates();
            taskManager.tick();

            getServer().getPluginManager().registerEvents(new TaskListener(this, taskManager), this);
            registerCommand("daily", new DailyCommand(this, taskManager));
            registerCommand("dailyadmin", new DailyAdminCommand(this, taskManager));

            long interval = Math.max(1L, getConfig().getLong("deadline-check-interval-ticks", 20L));
            getServer().getScheduler().runTaskTimer(this, taskManager::tick, 1L, interval);
        } catch (Exception exception) {
            getLogger().severe("DailyOrBan could not start: " + exception.getMessage());
            exception.printStackTrace();
            getServer().getPluginManager().disablePlugin(this);
        }
    }

    @Override
    public void onDisable() {
        if (store != null) {
            try {
                store.close();
            } catch (Exception exception) {
                getLogger().severe("Could not close the DailyOrBan database: " + exception.getMessage());
            }
        }
    }

    private void registerCommand(String name, org.bukkit.command.CommandExecutor executor) {
        PluginCommand command = getCommand(name);
        if (command == null) {
            throw new IllegalStateException("Command /" + name + " is missing from plugin.yml");
        }
        command.setExecutor(executor);
        if (executor instanceof org.bukkit.command.TabCompleter completer) {
            command.setTabCompleter(completer);
        }
    }

    public TaskManager getTaskManager() {
        return taskManager;
    }
}