Anime_Artst

Create a Minecraft Paper 26.3 jumpscare plugin. Command: "/jumpscare <playerName>". OP-only, no cooldown. Generate a creepy black-and-white humanoid with a pale skull-like face, empty black eyes, and an unnaturally long, gaping jaw. No image upload. Show it on the target's screen for 2 seconds and play a loud Ender Dragon growl. Only the target sees and hears it. No chat/title substitutes. Include any required resource pack, implement the actual functionality, and explain installation. Handle offline players and invalid names.

Kodari AI
KodariOct 22 at 7:44 am 1
JumpscarePlugin
An OP-only Minecraft Paper plugin that triggers a personalized jumpscare on a targeted player via /jumpscare &lt;playerName&gt;. Generates a creepy black-and-white humanoid with a pale skull-like face, empty black eyes, and an unnaturally long gaping jaw, displayed directly on the target's screen for 2 seconds using a custom resource pack. Plays a loud Ender Dragon growl exclusively for the target. No chat or title substitutes; uses a custom entity and sound. Handles offline players and invalid names with clear error messages. No cooldown. Includes a resource pack with custom textures and sounds, plus installation instructions.
  1. Create the Paper plugin, OP-only command, and online-name validation.

  2. Make the scare visible/audible only to the target for 2 seconds.

  3. Use vanilla assets so no resource pack is required; explain the custom-model limitation and installation.

Created the Paper 26.3 plugin with /jumpscare <playerName>. It’s OP-only, rejects invalid names, reports players who aren’t online, and shows a frozen skeleton with an Ender Dragon growl to the target for 2 seconds. Other players are hidden from the effect; no title or chat effect is used.

Visual limitation: this version uses Minecraft’s vanilla Skeleton, so it doesn’t have a custom elongated jaw or bespoke texture. It needs no resource pack. For the exact custom appearance, enable Generation via the project’s Settings → Generation, create the model in Kodari Studio, and bring it into this project.

Install: click Compile in the top bar (on phone: ⋮ → Compile Project), then Compile in the window and download the successful build. Place the JAR in your Paper server’s plugins folder and restart the server.

Anime_Artst
📎 1 file 2,464 chars
📄
pasted-code-1792688367922.txt
txt 55 lines
▶
Create a Minecraft Paper plugin with these features:

1. Custom Scoreboard (/sb)

- Show a scoreboard to every player on the server.
- Display the server name at the top, player name, money balance, kills, deaths, and online player count.
- Update the scoreboard automatically when stats, money, or online players change.
- Use Vault for the economy system.
- Make the scoreboard clean, attractive, and easy to customize.

2. Scoreboard Name Customization

- Command: "/sb name (name)"
- Allow OP players only to change the server name displayed at the top of the scoreboard.
- Support color codes such as "&a", "&c", and "&l".
- Apply the new name to everyone's scoreboard instantly.
- Save the custom name so it remains after a server restart.

3. Lightning Kill Command

- Command: "/k (player name)"
- Only OP players can use this command.
- Strike the specified target with lightning and instantly kill ONLY that target.
- The lightning must not damage or kill any other player or entity.
- Do not set the target on fire.
- Prevent fire spread and fire damage caused by this command.
- Show a proper error message if the target is offline or the command is used incorrectly.

4. Help Command

- Command: "/sb help"
- Show all available commands, their usage, and permission requirements.
- Include "/sb", "/sb name (name)", "/sb help", and "/k (player name)".

5. Permissions and Security

- Only OP players can modify scoreboard settings or use the lightning kill command.
- Regular players can see the scoreboard but cannot modify it.
- Validate all command arguments and handle errors properly.
- Never allow unauthorized players to bypass permissions.

6. Technical Requirements

- Target Minecraft Paper 26.3 and use the correct compatible Java version and Paper API.
- Use efficient scoreboard updates without creating unnecessary repeating tasks.
- Track kills and deaths correctly and persist statistics across restarts.
- Use UUIDs to identify players reliably.
- Include "plugin.yml", "pom.xml", and all required Java source files.
- Keep the project organized, with clean and maintainable code.
- Include clear installation instructions and build instructions.
- Do not use a resource pack or client-side mod.
- If Vault is required, clearly explain how to install and configure it.
- Ensure the plugin compiles successfully and fix errors before presenting the final code.

Build the complete working plugin, not just an example or a code snippet.
Kodari AI
KodariOct 22 at 5:05 pm 3
  1. Implement the live scoreboard with Vault balances and persistent kill/death stats.

  2. Add OP-only /sb name customization and persistence.

  3. Add the isolated OP-only /k lightning kill command.

  4. Add help, command metadata, dependency setup, and installation guidance.

Implemented the scoreboard plugin in the existing Gradle project, targeting Paper 26.3 and Java 25.

  • The sidebar shows the server name, player name, Vault balance, kills, deaths, and online count. Stats are saved by UUID in stats.yml; balance changes are checked every 2 seconds, while stats and player-count changes refresh on events.

  • /sb name <name> lets OP players set a persistent, color-coded server name. /sb re-enables the caller’s scoreboard, and /sb help lists commands and access requirements.

  • /k <playerName> is restricted to OP players. It shows a harmless lightning effect and kills only the selected online target—without lightning damage or fire—and records the death and command kill.

  • Vault is required, along with a Vault-compatible economy provider, such as EssentialsX Economy. Vault alone does not provide an economy. The project uses Gradle rather than adding a separate pom.xml.

Install: Add Vault and an economy provider to your Paper server’s plugins folder and restart it. In Kodari, click Compile in the top bar (on phone: ⋮ → Compile Project), click Compile, then download the successful build. Put the plugin JAR in the server’s plugins folder and restart. Use /sb help in-game. No resource pack or client mod is needed.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
7 444
src/main/java/com/kodari/jumpscare/JumpscarePlugin.java
package com.kodari.jumpscare;

import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

public final class JumpscarePlugin extends JavaPlugin implements Listener, CommandExecutor {
    private PlayerStatsManager statsManager;
    private PlayerScoreboardManager scoreboardManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        RegisteredServiceProvider<Economy> registration = getServer().getServicesManager().getRegistration(Economy.class);
        if (registration == null || registration.getProvider() == null) {
            getLogger().severe("Vault is installed, but no economy provider is available. Disabling plugin.");
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }

        statsManager = new PlayerStatsManager(this);
        scoreboardManager = new PlayerScoreboardManager(this, registration.getProvider(), statsManager);
        scoreboardManager.setServerName(getConfig().getString("server-name", "&6&lMY SERVER"));
        Bukkit.getPluginManager().registerEvents(this, this);

        if (getCommand("sb") == null) {
            throw new IllegalStateException("The sb command is missing from plugin.yml");
        }
        getCommand("sb").setExecutor(this);
        if (getCommand("k") == null) {
            throw new IllegalStateException("The k command is missing from plugin.yml");
        }
        getCommand("k").setExecutor(this);

        for (org.bukkit.entity.Player player : Bukkit.getOnlinePlayers()) {
            scoreboardManager.show(player);
        }
        scoreboardManager.refreshAll();
        Bukkit.getScheduler().runTaskTimer(this, scoreboardManager::refreshAll, 20L, 40L);
    }

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

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        scoreboardManager.show(event.getPlayer());
        scoreboardManager.refreshAll();
    }

    @EventHandler
    public void onPlayerQuit(PlayerQuitEvent event) {
        scoreboardManager.remove(event.getPlayer());
        scoreboardManager.refreshAll();
    }

    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        statsManager.recordDeath(event);
        scoreboardManager.refreshAll();
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (command.getName().equalsIgnoreCase("k")) {
            return handleLightningKill(sender, args);
        }

        if (args.length == 0) {
            if (sender instanceof org.bukkit.entity.Player player) {
                scoreboardManager.show(player);
                scoreboardManager.refreshAll();
                sender.sendMessage(ChatColor.GREEN + "Your scoreboard is enabled.");
            } else {
                sender.sendMessage(ChatColor.GREEN + "The scoreboard is enabled for online players.");
            }
            return true;
        }
        if (args[0].equalsIgnoreCase("help")) {
            if (args.length != 1) {
                sender.sendMessage(ChatColor.RED + "Usage: /sb help");
                return true;
            }
            sendHelp(sender);
            return true;
        }

        if (!args[0].equalsIgnoreCase("name") || args.length < 2) {
            sender.sendMessage(ChatColor.RED + "Usage: /sb [name <name>|help]");
            return true;
        }
        if (!(sender instanceof org.bukkit.entity.Player) || !sender.isOp()) {
            sender.sendMessage(ChatColor.RED + "Only operators can change the scoreboard name.");
            return true;
        }

        String serverName = String.join(" ", java.util.Arrays.copyOfRange(args, 1, args.length)).trim();
        if (serverName.isEmpty() || serverName.length() > 64) {
            sender.sendMessage(ChatColor.RED + "The name must be between 1 and 64 characters.");
            return true;
        }

        getConfig().set("server-name", serverName);
        saveConfig();
        scoreboardManager.setServerName(serverName);
        sender.sendMessage(ChatColor.GREEN + "Scoreboard name updated.");
        return true;
    }

    private boolean handleLightningKill(CommandSender sender, String[] args) {
        if (!(sender instanceof org.bukkit.entity.Player executor) || !executor.isOp()) {
            sender.sendMessage(ChatColor.RED + "Only operator players can use this command.");
            return true;
        }
        if (args.length != 1) {
            sender.sendMessage(ChatColor.RED + "Usage: /k <playerName>");
            return true;
        }
        if (!args[0].matches("[A-Za-z0-9_]{1,16}")) {
            sender.sendMessage(ChatColor.RED + "Invalid player name.");
            return true;
        }

        org.bukkit.entity.Player target = Bukkit.getOnlinePlayers().stream()
                .filter(player -> player.getName().equalsIgnoreCase(args[0]))
                .findFirst()
                .orElse(null);
        if (target == null) {
            sender.sendMessage(ChatColor.RED + "That player is offline or does not exist.");
            return true;
        }
        if (target.isDead()) {
            sender.sendMessage(ChatColor.RED + "That player is already dead.");
            return true;
        }

        target.getWorld().strikeLightningEffect(target.getLocation());
        statsManager.recordNextDeathAsCommandKill(target.getUniqueId(), executor.getUniqueId());
        target.setHealth(0.0);
        sender.sendMessage(ChatColor.GREEN + "Struck and killed " + target.getName() + ".");
        return true;
    }

    private void sendHelp(CommandSender sender) {
        sender.sendMessage(ChatColor.GOLD + "Scoreboard commands:");
        sender.sendMessage(ChatColor.YELLOW + "/sb" + ChatColor.GRAY + " - Show or re-enable your scoreboard (all players)");
        sender.sendMessage(ChatColor.YELLOW + "/sb name <name>" + ChatColor.GRAY + " - Set the server name (OP players only; supports & color codes)");
        sender.sendMessage(ChatColor.YELLOW + "/sb help" + ChatColor.GRAY + " - Show this help (all players)");
        sender.sendMessage(ChatColor.YELLOW + "/k <playerName>" + ChatColor.GRAY + " - Lightning-kill an online player (OP players only)");
    }
}