_e3rq

i want you to make me a plugin that makes timers for people like /settime rcq3 3 weeks and i want a great gui and i want a notifecation system so when the timer sets off it says rent is up and i want a timers history and a config for them

Kodari AI
KodariOct 3 at 4:12 pm 1
RentTimerSystem
A Minecraft plugin that manages timed rental periods for players. Admins can set timers via /settime command with flexible durations (seconds to weeks). Features a comprehensive GUI showing active timers, expired rentals, and player status. Includes a notification system that alerts players when their rent expires with customizable messages. Maintains a complete timer history log for auditing past rentals. All timers, notifications, and settings are stored in a config file for easy management. Supports multiple timers per player and provides clear visual indicators for active, expiring, and expired rentals.
  1. Add /settime and /deltime commands with human-readable durations and saved timer data.

  2. Add /timers GUI with active timers, history, and page navigation.

  3. Configure expiry notifications, history limits, messages, and menu titles.

Created the RentTimers plugin.

  • /settime rcq3 3 weeks creates or resets a timer. Durations support weeks, days, hours, minutes, and seconds.

  • /timers opens a paginated GUI for active timers; use /timers history or the menu toggle to view history.

  • When a timer expires, the configurable notification defaults to “Rent is up!” and broadcasts to the server.

  • /deltime <name> removes a timer. Timer data and history are saved across restarts.

  • config.yml controls notifications, message text, history size, and GUI titles.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
10 647
src/main/java/com/kodari/renttimers/RentTimersPlugin.java
package com.kodari.renttimers;

import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class RentTimersPlugin extends JavaPlugin {
    private TimerManager timerManager;
    private TimerMenu timerMenu;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        timerManager = new TimerManager(this);
        timerMenu = new TimerMenu(this, timerManager);

        getServer().getPluginManager().registerEvents(timerMenu, this);
        TimerCommand commandExecutor = new TimerCommand(this, timerManager, timerMenu);
        registerCommand("settime", commandExecutor);
        registerCommand("deltime", commandExecutor);
        registerCommand("timers", commandExecutor);

        getServer().getScheduler().runTaskTimer(this, timerManager::processExpired, 20L, 20L);
    }

    @Override
    public void onDisable() {
        if (timerManager != null) {
            timerManager.save();
        }
    }

    private void registerCommand(String name, TimerCommand executor) {
        PluginCommand command = getCommand(name);
        if (command != null) {
            command.setExecutor(executor);
            command.setTabCompleter(executor);
        }
    }
}