probada125

Create a Minecraft Java Edition plugin for a Spigot/Paper server (latest version).

The plugin should automatically spawn and connect a fake player bot to the server when the server starts.

Bot behavior requirements:

  • The bot must stay within an 8x8 block area from its spawn location.
  • The bot must continuously crouch (sneak) and never stop crouching.
  • While crouching, the bot should keep jumping repeatedly.
  • The bot should move in a circular pattern inside the 8x8 area.
  • The bot must not leave the defined area.
  • Every 15 minutes, the bot should send a chat message: "I love this smp"

Additional requirements:

  • The plugin must work on the latest Spigot or Paper version.
  • The bot should automatically rejoin if kicked or disconnected.
  • Provide clean and well-documented Java code.
  • Include the plugin.yml file.
  • Do not use any paid external dependencies.
Kodari AI
KodariFeb 27 at 8:23 am 13,557 (v2)

I’ll create a plugin that spawns a fake player bot using Citizens API. This is the most practical approach for creating a realistic bot that can perform complex behaviors on a Spigot/Paper server.

FakePlayerBot
Automatically spawns a fake player bot NPC that continuously crouches and jumps while moving in a circular pattern within an 8x8 block area. The bot sends periodic chat messages and respawns if removed. Uses Citizens API for NPC management with custom AI behaviors for realistic bot simulation.

I’ll create a comprehensive plugin using Citizens API to spawn a realistic fake player bot with all the requested behaviors.

Summary

I’ve created FakePlayerBot - a complete plugin that spawns a realistic fake player bot using Citizens API with all requested features:

✨ Features Implemented:

  1. Automatic Bot Spawning - Bot spawns 2 seconds after server start

  2. Continuous Crouching - Bot stays in sneak mode at all times

  3. Continuous Jumping - Bot jumps every 0.5 seconds while crouching

  4. Circular Movement - Bot moves in a perfect circle within the 8x8 area

  5. Boundary Enforcement - Bot never leaves the defined area

  6. Periodic Chat - Sends “I love this smp” every 15 minutes

  7. Auto-Respawn - Automatically respawns if killed or removed

🎮 Commands:

  • /fakebot spawn - Manually spawn the bot

  • /fakebot respawn - Force respawn the bot

  • /fakebot remove - Remove the bot

  • /fakebot reload - Reload configuration

⚙️ Configuration:

All behaviors are customizable in config.yml:

  • Bot name and skin

  • Spawn location (world, x, y, z)

  • Area size (default 8x8)

  • Movement speed

  • Chat message and interval

  • Auto-respawn settings

📋 Setup Instructions:

  1. Install Citizens plugin (required dependency)

  2. Place this plugin in your plugins folder

  3. Start/restart the server

  4. Configure spawn location in config.yml

  5. Reload with /fakebot reload

The bot will appear as a player NPC that continuously crouches, jumps, and moves in a circular pattern while staying within bounds!

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
10 846
src/main/java/dev/antiopabuse/antiopabuse/AntiOpAbusePlugin.java
/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  org.bukkit.ChatColor
 *  org.bukkit.command.Command
 *  org.bukkit.command.CommandExecutor
 *  org.bukkit.command.CommandSender
 *  org.bukkit.event.Listener
 *  org.bukkit.plugin.Plugin
 *  org.bukkit.plugin.java.JavaPlugin
 *  org.bukkit.scheduler.BukkitRunnable
 */
package dev.antiopabuse.antiopabuse;

import dev.antiopabuse.antiopabuse.CreativeLogListener;
import dev.antiopabuse.antiopabuse.LogHistory;
import dev.antiopabuse.antiopabuse.RelayAppender;
import dev.antiopabuse.antiopabuse.WebhookDispatcher;
import java.util.List;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.event.Listener;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;

public final class AntiOpAbusePlugin
extends JavaPlugin
implements CommandExecutor {
    private WebhookDispatcher dispatcher;
    private RelayAppender appender;
    private LogHistory history;

    public void onLoad() {
        this.saveDefaultConfig();
    }

    public void onEnable() {
        this.reloadConfig();
        String webhookUrl = this.getConfig().getString("webhook-url", "");
        boolean codeBlock = this.getConfig().getBoolean("send-as-codeblock", true);
        boolean commandsOnly = this.getConfig().getBoolean("commands-only", false);
        if (webhookUrl.isBlank() || webhookUrl.equals("DISCORD_WEBHOOK_HERE")) {
            this.getLogger().severe("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557");
            this.getLogger().severe("\u2551  AntiOpAbuse: webhook-url is not configured!     \u2551");
            this.getLogger().severe("\u2551  Edit plugins/AntiOpAbuse/config.yml             \u2551");
            this.getLogger().severe("\u255a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255d");
        }
        this.history = new LogHistory();
        this.dispatcher = new WebhookDispatcher(webhookUrl, codeBlock, this.getLogger());
        RelayAppender.removeExisting();
        this.appender = new RelayAppender(this.dispatcher, this.history, this.getLogger(), commandsOnly);
        this.appender.install();
        this.getServer().getPluginManager().registerEvents((Listener)new CreativeLogListener(this.dispatcher, this.getLogger()), (Plugin)this);
        this.getServer().getPluginManager().registerEvents((Listener)new AbuseListener(), (Plugin)this);
        this.getCommand("antiopabuse").setExecutor((CommandExecutor)this);
        this.getLogger().info("AntiOpAbuse v" + this.getDescription().getVersion() + " enabled \u2014 forwarding console to Discord." + (commandsOnly ? " [commands-only mode]" : ""));
        if (this.dispatcher.isConfigured()) {
            new BukkitRunnable(){

                public void run() {
                    AntiOpAbusePlugin.this.dispatcher.dispatch("\ud83d\udfe2 Server started \u2014 " + AntiOpAbusePlugin.this.getServer().getVersion());
                }
            }.runTaskLater((Plugin)this, 60L);
        }
    }

    public void onDisable() {
        if (this.dispatcher != null && this.dispatcher.isConfigured()) {
            this.dispatcher.dispatchNow("\ud83d\udd34 Server stopped.");
        }
        if (this.appender != null) {
            this.appender.uninstall();
        }
        if (this.dispatcher != null) {
            this.dispatcher.shutdown();
        }
        this.getLogger().info("AntiOpAbuse disabled.");
    }

    public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) {
        if (!command.getName().equalsIgnoreCase("antiopabuse")) {
            return false;
        }
        if (args.length > 0 && args[0].equalsIgnoreCase("logs")) {
            List<LogHistory.Entry> entries = this.history.snapshot();
            sender.sendMessage(String.valueOf(ChatColor.GOLD) + "\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501 " + String.valueOf(ChatColor.YELLOW) + "AntiOpAbuse Logs" + String.valueOf(ChatColor.GOLD) + " \u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501");
            if (entries.isEmpty()) {
                sender.sendMessage(String.valueOf(ChatColor.GRAY) + "No logs yet \u2014 nothing suspicious has happened.");
                sender.sendMessage(String.valueOf(ChatColor.GOLD) + "\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501");
                return true;
            }
            for (LogHistory.Entry entry : entries) {
                String line = entry.line();
                ChatColor color = line.contains("[CREATIVE]") ? ChatColor.AQUA : (line.toLowerCase().contains("/op ") || line.toLowerCase().contains("/deop") ? ChatColor.RED : ChatColor.WHITE);
                sender.sendMessage(String.valueOf(ChatColor.DARK_GRAY) + "[" + entry.timestamp() + "] " + String.valueOf(color) + line);
            }
            sender.sendMessage(String.valueOf(ChatColor.GOLD) + "\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501");
            sender.sendMessage(String.valueOf(ChatColor.GRAY) + "Showing " + entries.size() + "/50 most recent entries.");
            return true;
        }
        if (!sender.isOp()) {
            sender.sendMessage(String.valueOf(ChatColor.RED) + "You must be an operator to use this command.");
            return true;
        }
        if (args.length == 0) {
            sender.sendMessage(String.valueOf(ChatColor.GOLD) + "AntiOpAbuse " + String.valueOf(ChatColor.GRAY) + "v" + this.getDescription().getVersion());
            sender.sendMessage(String.valueOf(ChatColor.GRAY) + "Usage: " + String.valueOf(ChatColor.WHITE) + "/antiopabuse logs    " + String.valueOf(ChatColor.GRAY) + "- view last 50 logs (all players)");
            sender.sendMessage(String.valueOf(ChatColor.GRAY) + "Usage: " + String.valueOf(ChatColor.WHITE) + "/antiopabuse webhook " + String.valueOf(ChatColor.GRAY) + "- test the Discord webhook");
            sender.sendMessage(String.valueOf(ChatColor.GRAY) + "Usage: " + String.valueOf(ChatColor.WHITE) + "/antiopabuse reload  " + String.valueOf(ChatColor.GRAY) + "- reload config");
            return true;
        }
        switch (args[0].toLowerCase()) {
            case "webhook": {
            sender.sendMessage(String.valueOf(ChatColor.GRAY) + "[AntiOpAbuse] Testing webhook, please wait...");
            new BukkitRunnable() {
                @Override
                public void run() {
                    final String result = dispatcher.testWebhook();
                    new BukkitRunnable() {
                        @Override
                        public void run() {
                            sender.sendMessage(String.valueOf(ChatColor.GRAY) + "[AntiOpAbuse] " + result);
                        }
                    }.runTask(AntiOpAbusePlugin.this);
                }
            }.runTaskAsynchronously(AntiOpAbusePlugin.this);
            break;
        }
            case "reload": {
                this.reloadConfig();
                String newUrl = this.getConfig().getString("webhook-url", "");
                boolean newCb = this.getConfig().getBoolean("send-as-codeblock", true);
                boolean newCommandsOnly = this.getConfig().getBoolean("commands-only", false);
                this.dispatcher.updateSettings(newUrl, newCb);
                this.appender.setCommandsOnly(newCommandsOnly);
                sender.sendMessage(String.valueOf(ChatColor.GRAY) + "[AntiOpAbuse] " + String.valueOf(ChatColor.GREEN) + "Config reloaded." + (String)(newCommandsOnly ? String.valueOf(ChatColor.GRAY) + " (commands-only mode ON)" : ""));
                break;
            }
            default: {
                sender.sendMessage(String.valueOf(ChatColor.RED) + "Unknown sub-command. Use: logs | webhook | reload");
            }
        }
        return true;
    }
}