_
📎 1 file 4,071 chars
📄
pasted-code-1784566541275.txt
txt 217 lines
▶
Create a high-quality Minecraft Paper plugin for Java 1.21.11.

Plugin name: RoleSMP
Package: me.rolesmp
Language: English
Code quality: Clean, optimized, async where possible, no memory leaks, no deprecated API.

========================
MAIN SYSTEM
========================

This plugin is an admin tool for SMP events.

Only players with permission:

rolesmp.admin

can use any plugin commands.

No INVENTORY GUI is needed.

========================
ROLE SYSTEM
========================

Command:

/rolesmp:setrole  

Example:

/rolesmp:setrole Steve SecretAssassin

This command DOES NOT save any role.

It is ONLY used to privately inform the selected player about their role for the SMP event.

The plugin MUST NOT store roles in any file.

The plugin MUST NOT remember roles after a restart.

The plugin MUST NOT assign metadata, scoreboard teams, permissions, prefixes, suffixes, or any hidden role.

Immediately after the admin uses the command:

ONLY THAT PLAYER receives:

TITLE

Title:
§6YOU HAVE BEEN CHOSEN

Subtitle:
§eYour role: §a

and also receives this Tellraw message:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━
§6You have been chosen!
§7Your role is:
§a
§7Keep this information secret.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Nobody else on the server can see these messages.

The admin receives:

"Role notification sent successfully."

========================
ABILITY SYSTEM
========================

Admin command:

/rolesmp:ability unlock  

Example:

/rolesmp:ability unlock Steve SculkAttack

This permanently unlocks an ability for the player.

Abilities are stored in abilities.yml.

Players keep unlocked abilities after restarting the server.

Admin command:

/rolesmp:ability remove  

Removes the unlocked ability.

Command:

/rolesmp:ability list 

Shows all unlocked abilities.

========================
PLAYER COMMAND
========================

Players can use:

/ability

If they have only one unlocked ability,
it activates immediately.

If they have multiple unlocked abilities,
the plugin currently activates the first unlocked ability.

========================
ABILITY API
========================

Create an internal Ability API.

Every ability is its own Java class.

Abstract class:

Ability

Methods:

getName()

getCooldown()

activate(Player player)

This allows developers to easily create new abilities later.

========================
DEFAULT ABILITY
========================

Implement one example ability:

SculkAttack

When the player uses:

/ability

and owns SculkAttack:

• Play the Warden Sonic Boom sound.
• Spawn Sonic Boom particles.
• Fire a Sonic Boom attack in the direction the player is looking.
• Range: 20 blocks.
• Damage: 16 HP (8 hearts).
• Apply knockback similar to the Warden.
• Ignore armor protection as closely as possible to the vanilla Warden attack.
• Cooldown: 20 seconds.
• If on cooldown, show the remaining cooldown.

========================
CONFIG
========================

config.yml

allow-cooldown-message: true

default-language: EN

========================
PERMISSIONS
========================

rolesmp.admin

rolesmp.use

========================
FILES
========================

config.yml

abilities.yml

plugin.yml

========================
TAB COMPLETION
========================

Implement full tab completion for every command.

========================
RELOAD
========================

Command:

/rolesmp reload

Safely reloads config.yml and abilities.yml without restarting the server.

========================
REQUIREMENTS
========================

• Minecraft Paper 1.21.11 only.
• No external dependencies.
• No NMS unless absolutely necessary.
• Clean package structure.
• Well-commented code.
• Efficient.
• Null-safe.
• No console errors.
• Ready to compile immediately using Maven or Gradle.
Kodari AI
KodariJul 20 at 4:58 pm 19
RoleSMP
RoleSMP provides private event-role notifications and persistent player abilities for Minecraft SMP events. Administrators can discreetly inform players of temporary event roles, manage permanent ability unlocks, view player ability lists, and reload configuration safely. Players activate their unlocked abilities through a simple command, with built-in cooldown handling and a Warden-inspired SculkAttack ability.
_

add an nuke ability that has 6 minute cooldown and when you use it a nukeshot (from unstable smp) lands down breaking everything its like when you use it lots of tnt rain down for 20 seconds. add domain expansion ability. add an ability that is passive and its name is combohit that you dont have to turn on bcs it works like when you 3 hit combo someone every hit turns into critical one and you deal 30% mode damage and it cancels in your combo gets broken (someone hits you). add a traicer ability that shows only for you where players are (shows you a laser from particles like a compass and only you can see it and it disappears after 15 seconds

Kodari AI
KodariJul 20 at 5:06 pm 21
  1. Add Nuke with persistent unlock support, a six-minute cooldown, and a 20-second TNT barrage.

  2. Add DomainExpansion as a separate activatable ability.

  3. Add passive ComboHit combat tracking with the requested combo rules.

  4. Add Tracer, visible only to its owner for 15 seconds.

DomainExpansion has no specified gameplay effect, so it will create a short-lived visual domain that damages and slows nearby opponents; the other abilities follow the stated behavior.

Implemented the new abilities:

  1. Nuke — six-minute cooldown; launches a 20-second TNT rain barrage that destroys terrain according to server explosion/protection rules.

  2. DomainExpansion — 15-second visual domain that damages and slows nearby opponents, with a 90-second cooldown.

  3. ComboHit — passive ability; after three consecutive hits on the same player, attacks deal 30% extra damage with critical-hit visuals. The combo resets when its owner is hit.

  4. Tracer — 15-second, owner-only particle compass lines pointing toward players in the same world, with a 45-second cooldown.

All four are registered in the existing ability system, persist through abilities.yml, and are available through the existing admin unlock command and tab completion.

_

add an nuke ability that has 6 minute cooldown and when you use it a nukeshot (from unstable smp) lands down breaking everything its like when you use it lots of tnt rain down for 20 seconds. add domain expansion ability. add an ability that is passive and its name is combohit that you dont have to turn on bcs it works like when you 3 hit combo someone every hit turns into critical one and you deal 30% mode damage and it cancels in your combo gets broken (someone hits you). add a traicer ability that shows only for you where players are (shows you a laser from particles like a compass and only you can see it and it disappears after 15 seconds

Kodari AI
KodariJul 21 at 9:54 am 8
  1. Add the six-minute Nuke ability with a 20-second destructive TNT barrage.

  2. Add DomainExpansion as an activatable ability.

  3. Add the passive ComboHit listener and damage behavior.

  4. Add the 15-second owner-only Tracer particle compass.

These abilities are already implemented and registered:

  • Nuke — 6-minute cooldown with a 20-second TNT barrage: ability/Nuke.java

  • DomainExpansion — activatable domain effect: ability/DomainExpansion.java

  • ComboHit — passive 3-hit critical combo, +30% damage, resets when hit: ability/ComboHitListener.java

  • Tracer — owner-only particle tracking for 15 seconds: ability/Tracer.java

They are registered in RoleSMPPlugin and available through the existing /rolesmp:ability unlock <player> <ability> command.

_

add a /abilityuse command that lets normal players use ability if they have one unlocked by the admin. make sure every ability has a good quality

Kodari AI
KodariJul 21 at 9:57 am 8
  1. Register /abilityuse as the player-facing activation command, using the existing permission and unlock checks.

  2. Review the current ability implementations and correct any behavior that conflicts with their intended gameplay.

/abilityuse will activate the first unlocked non-passive ability, matching the existing /ability selection behavior; passive abilities such as ComboHit remain active automatically when unlocked.

Added /abilityuse.

  • Normal players with rolesmp.use can run /abilityuse.

  • It activates their first unlocked non-passive ability with the existing cooldown handling.

  • Players without unlocked abilities receive the appropriate message.

  • Passive abilities, including ComboHit, continue working automatically once unlocked.

  • Registered the command in plugin.yml with permission and usage metadata.

_

add more particles to the abilities. add when someones is getting set a role he hears a sound

Kodari AI
KodariJul 21 at 10:05 am 10
  1. Add a private confirmation sound when a player receives an event-role notification.

  2. Enhance the visual particle effects for each active ability.

  1. Role notifications now play a private completion sound for the selected player.

  2. Enhanced particles across all abilities:

    • SculkAttack: added sculk-soul particles along the sonic beam.

    • Nuke: added ash, explosion, smoke, and flame effects.

    • DomainExpansion: added dragon-breath and reverse-portal domain visuals.

    • ComboHit: added sweep and electric-spark critical effects.

    • Tracer: added electric sparks to each owner-only tracking laser.

_

i want you to fix the nuke and make it work i want it to create tnt falling from the sky and i want them to actually spawn

Kodari AI
KodariJul 21 at 10:31 am 7

Fixed Nuke so it now spawns real falling TNTPrimed entities:

  • Launches 3 TNT blocks every half second for 20 seconds.

  • Spawns them 30–42 blocks above the terrain in an 18-block impact radius.

  • Forces the target chunks loaded before spawning.

  • Applies downward velocity so the TNT visibly falls from the sky.

  • TNT now has a larger explosion yield and enough fuse time to reach the ground.

_

fix the domain expansion i want it to be just like in the anime, when you use it it creates a ball around you and ppl in it cant leave it until it disappears after 20 seconds. fix tracer and just make it show in the chat coords of the nearest player and make them glow for 120 seconds. make the sculk ability deal 50% damage and make it's cooldown 2 minutes. think twice

Kodari AI
KodariJul 21 at 10:39 am 16
  1. Rework DomainExpansion into a 20-second containment sphere that prevents entities inside from escaping.

  2. Replace Tracer particles with nearest-player coordinates and a 120-second glow.

  3. Set SculkAttack to 50% damage and a two-minute cooldown.

  • Domain Expansion: now creates a complete 10-block spherical boundary for 20 seconds. Players inside—or who enter it—cannot walk, fly, or teleport outside until it ends.

  • Tracer: now finds the nearest player in your world, sends their coordinates and distance in chat, and makes them glow for 120 seconds.

  • SculkAttack: cooldown is now 2 minutes and its blast damages a target for 50% of their maximum health.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
15 1,180
src/main/java/me/rolesmp/RoleSMPPlugin.java
package me.rolesmp;

import me.rolesmp.ability.AbilityManager;
import me.rolesmp.ability.ComboHitListener;
import me.rolesmp.ability.DomainExpansion;
import me.rolesmp.ability.Nuke;
import me.rolesmp.ability.SculkAttack;
import me.rolesmp.ability.Tracer;
import me.rolesmp.command.RoleSMPCommand;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.util.Objects;

public final class RoleSMPPlugin extends JavaPlugin {
    private AbilityManager abilityManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        File abilitiesFile = new File(getDataFolder(), "abilities.yml");
        if (!abilitiesFile.exists()) {
            saveResource("abilities.yml", false);
        }

        abilityManager = new AbilityManager(this, abilitiesFile);
        abilityManager.registerAbility(new SculkAttack());
        abilityManager.registerAbility(new Nuke(this));
        DomainExpansion domainExpansion = new DomainExpansion(this);
        abilityManager.registerAbility(domainExpansion);
        abilityManager.registerAbility(new Tracer(this));
        ComboHitListener comboHitListener = new ComboHitListener(this);
        abilityManager.registerAbility(comboHitListener);
        getServer().getPluginManager().registerEvents(domainExpansion, this);
        getServer().getPluginManager().registerEvents(comboHitListener, this);
        abilityManager.load();

        RoleSMPCommand commandHandler = new RoleSMPCommand(this);
        registerCommand("rolesmp", commandHandler);
        registerCommand("setrole", commandHandler);
        registerCommand("ability", commandHandler);
        registerCommand("abilityuse", commandHandler);
    }

    @Override
    public void onDisable() {
        if (abilityManager != null) {
            abilityManager.shutdown();
        }
    }

    public AbilityManager getAbilityManager() {
        return abilityManager;
    }

    public void reloadPluginData() {
        reloadConfig();
        abilityManager.reload();
    }

    private void registerCommand(String name, RoleSMPCommand commandHandler) {
        PluginCommand command = Objects.requireNonNull(getCommand(name), "Missing command declaration: " + name);
        command.setExecutor(commandHandler);
        command.setTabCompleter(commandHandler);
    }
}