hemloji0375

Create a Minecraft Spigot 1.21.1 plugin called "CurseSMP".

Features:

  • Every 30 minutes, all online players receive one random curse.
  • The curse is announced in chat with a title and sound.
  • Random curses include:

1. Blindness (2 minutes) 2. Slowness III (2 minutes) 3. Hunger III (2 minutes) 4. Weakness II (2 minutes) 5. Mining Fatigue III (2 minutes) 6. Random lightning strikes around players (without fire damage) for 2 minutes. 7. Random mob spawn near each player every 20 seconds for 2 minutes. 8. Gravity curse: Jump Boost 250 and Slow Falling disabled for 2 minutes.

  • Do not repeat the same curse twice in a row.
  • Add commands:

/curse start /curse stop /curse force <curse> /curse reload

  • Add permissions for all commands.
  • Store settings in config.yml:

- curse interval - curse duration - enabled/disabled curses - messages

  • Use clean, optimized Java code compatible with Spigot API 1.21.1.
  • No external dependencies.
  • Include plugin.yml and default config.yml.
Kodari AI
KodariJul 19 at 1:53 pm 1

I’ll create the CurseSMP plugin — a Spigot 1.21.1 plugin that periodically applies random curses to all online players.

CurseSMP
A Spigot 1.21.1 plugin that applies random curses to all online players every configurable interval. Features 8 unique curses including potion effects, lightning strikes, mob spawns, and gravity manipulation. Commands for starting, stopping, forcing curses, and reloading config. Fully configurable via config.yml with per-curse enable/disable and customizable messages.

Here’s the plan:

  1. CurseType — enum defining all 8 curses with config keys and display names

  2. ConfigManager — loads/stores config.yml values (interval, duration, enabled curses, messages)

  3. CurseManager — core logic: scheduled task, curse selection (no repeats), active curse task management, per-curse application

  4. CurseCommand — /curse start|stop|force|reload with permission checks

  5. CurseSMP — main class, initializes managers, registers command and listener

  6. plugin.yml — metadata, commands, permissions

  7. config.yml — default configuration

Let me create all files now.

hemloji0375

Only opertor can do that commands

Kodari AI
KodariJul 19 at 1:54 pm 1

The commands are already restricted to operators only. Each permission node in plugin.yml has default: op, so only ops (or players explicitly granted the permissions) can use them. Bukkit’s built-in permission check enforces this at the command level before the executor even runs.

No changes needed — this is working as designed.

Kodari can make mistakes. Review important code before using.
Files
src
Code
7 549
src/main/java/com/cursesmp/CurseSMP.java
package com.cursesmp;

import org.bukkit.plugin.java.JavaPlugin;

public class CurseSMP extends JavaPlugin {

    private ConfigManager configManager;
    private CurseManager curseManager;

    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.curseManager = new CurseManager(this);

        CurseCommand commandExecutor = new CurseCommand(this);
        getCommand("curse").setExecutor(commandExecutor);
        getCommand("curse").setTabCompleter(commandExecutor);

        getLogger().info("CurseSMP has been enabled!");
    }

    @Override
    public void onDisable() {
        if (curseManager != null) {
            curseManager.shutdown();
        }
        getLogger().info("CurseSMP has been disabled.");
    }

    public ConfigManager getConfigManager() {
        return configManager;
    }

    public CurseManager getCurseManager() {
        return curseManager;
    }
}