Michael Gayle
📎 1 file 6,236 chars
📄
pasted-code-1790642346352.txt
txt 400 lines
▶
Create a **Paper 1.21.11** plugin called **VexBotPaper** that recreates the bot management and PvP training functionality of VexBot for Paper servers

Target:
• Paper 1.21.11
• Java 21
• Server side only
• No client side mod required
• Do not require Fabric
• Do not require VexBot

The plugin should create fake player bots that appear and behave like normal players

## Core Commands

Implement:

`/vexbot create `

Creates a new persistent bot

`/vexbot remove `

Removes a bot

`/vexbot list`

Lists all active bots

`/vexbot spawn `

Spawns an existing bot

`/vexbot despawn `

Despawns a bot without deleting it

`/vexbot tp `

Teleports the command sender to a bot

`/vexbot tphere `

Teleports a bot to the command sender

`/vexbot reload`

Reloads all configuration files

## Bot Properties

Each bot must support:

• Custom username
• Custom display name
• Custom skin
• Persistent UUID
• Team
• Difficulty
• Kit
• Spawn location
• Respawn location
• Behavior
• Targeting mode

Bots should appear in the tab list and behave as closely as possible to real players using Paper's available server APIs

## Bot AI

Implement configurable AI difficulty:

`/vexbot difficulty  `

Difficulty should control:

• Reaction delay
• Target selection
• Movement decisions
• Strafing
• Distance management
• Aim tracking
• Blocking decisions
• Sprint behavior
• Jump timing
• Healing decisions
• Retreat behavior
• Target switching

Bots should be able to:

• Detect nearby players
• Select targets
• Follow targets
• Chase targets
• Retreat from targets
• Wander when no target exists
• Return to their spawn location
• Look toward nearby players
• Respawn at their configured location

Add:

`/vexbot behavior  `

## PvP Training

Add a configurable PvP training mode

`/vexbot fight  `

Makes the bot target the specified player

`/vexbot stop `

Stops the bot from fighting

`/vexbot target  `

Sets the bot's target

`/vexbot untarget `

Clears the bot's target

Allow multiple bots to fight each other or players

Bots should understand normal Minecraft combat situations and use their configured equipment appropriately

Do not add custom weapons or custom damage systems

Use normal Minecraft combat mechanics

## Kits

Create a complete kit system

`/vexbot create kit `

Creates a kit from the command sender's current inventory and equipment

The kit must save:

• Main hand
• Offhand
• Helmet
• Chestplate
• Leggings
• Boots
• Inventory slots
• Item names
• Enchantments
• Attributes
• Custom model data
• Item components
• Potion effects if applicable

Store kits persistently in `kits.yml`

Example:

`/vexbot create kit diamond`

`/vexbot create kit netherite`

`/vexbot create kit custom`

## Giving Kits

Implement:

`/vexbot givekit  `

Give a saved kit to one bot

Example:

`/vexbot givekit Bot1 diamond`

Also support:

`/vexbot teamgivekit  `

Give the selected kit to every bot on that team

Example:

`/vexbot teamgivekit red diamond`

Add:

`/vexbot kits`

Lists all saved kits

`/vexbot delete kit `

Deletes a saved kit

`/vexbot kit `

Shows the kit currently assigned to a bot

When a bot respawns, automatically restore its assigned kit

## Teams

Implement bot teams

`/vexbot team create `

`/vexbot team delete `

`/vexbot team add  `

`/vexbot team remove `

`/vexbot team list`

`/vexbot teamgivekit  `

Bots on the same team should not target each other

Bots should prioritize enemies over teammates

Integrate with Bukkit scoreboard teams where possible

Allow configurable team colors and prefixes

## Spawn Areas

Implement named bot areas

`/vexbot spawnarea create `

`/vexbot spawnarea set `

`/vexbot spawnarea delete `

`/vexbot spawnarea list`

Each area stores:

• World
• Center
• Radius
• Maximum bots
• Allowed teams
• Allowed kits

Prevent bots from wandering outside their assigned area unless configured otherwise

## Bot Respawning

Bots should automatically respawn after death

Configurable respawn delay

Example:

```yaml
respawn:
  enabled: true
  delay: 3
```

After respawning:

• Restore assigned kit
• Restore health
• Restore food
• Reset potion effects
• Return to spawn location
• Resume configured behavior

## Bot Configuration

Create `bots.yml`

Example:

```yaml
bots:
  Bot1:
    skin: Steve
    display-name: "&cBot1"
    team: red
    difficulty: expert
    kit: diamond
    behavior: fight
    spawn:
      world: world
      x: 0
      y: 100
      z: 0
```

## Permissions

`vexbot.admin`
Full access

`vexbot.create`
Create bots and kits

`vexbot.remove`
Remove bots

`vexbot.spawn`
Spawn and despawn bots

`vexbot.kit`
Create and manage kits

`vexbot.team`
Manage teams

`vexbot.fight`
Control bot combat

## Persistence

Persist:

• Bot UUID
• Bot name
• Skin
• Team
• Difficulty
• Behavior
• Kit
• Spawn location
• Target
• Configuration

Everything must survive server restarts and plugin reloads

Use UUIDs internally rather than relying only on usernames

## Configuration Files

Generate:

`config.yml`
`bots.yml`
`kits.yml`
`teams.yml`
`spawnareas.yml`

All messages must be configurable

Use MiniMessage or modern Paper text components

## Performance

The plugin must be optimized for SMP servers

Do not run expensive AI calculations every server tick

Use scheduled tasks where appropriate

Avoid unnecessary pathfinding calculations

Clean up all bot tasks when bots are removed or the plugin disables

Prevent duplicate bot entities

Prevent bots from being created multiple times after reloads

## Compatibility

Target exactly:

**Paper 1.21.11**
**Java 21**

Use modern Paper APIs where possible

Do not require Fabric

Do not require VexBot

Do not require client-side mods

The final project must compile into a `.jar` that can be placed directly into:

`/plugins`

Generate a complete Maven project containing:

`pom.xml`
`plugin.yml`
`config.yml`
`bots.yml`
`kits.yml`
`teams.yml`
`spawnareas.yml`
all Java source files
`README.md`

Include complete installation instructions and command documentation.
Kodari AI
KodariSep 29 at 12:46 am 2
VexBotPaper
A comprehensive Paper 1.21.11 plugin that recreates VexBot's bot management and PvP training functionality. Creates persistent fake player bots with custom names, skins, teams, and kits. Features configurable AI difficulty levels (easy to expert) controlling reaction time, targeting, movement, and combat decisions. Includes team system with scoreboard integration, spawn areas with radius limits, automatic respawning with kit restoration, and persistent storage across restarts. Provides full command suite for bot creation, management, kits, teams, and spawn areas. Uses modern Paper APIs with MiniMessage formatting and optimized scheduled tasks for SMP performance.
  1. Create the Java 21 Maven/Paper project and configurable resource files.

  2. Implement persistent NPC-like bots, combat/behavior scheduling, respawning, teams, spawn areas, and kits.

  3. Add the /vexbot command tree, permissions, and installation/command documentation.

Created the Java 21 / Paper 1.21.11 Maven project with persistence, kits, teams, spawn areas, respawning, commands, permissions, configuration, and installation documentation.

Platform limitation: Paper’s public API cannot create genuine fake-player entities. These bots are equipped vanilla Zombies, so they use normal mob combat and pathfinding but do not appear in the tab list or display custom player skins. Difficulty adjusts decision timing and target range; it does not implement player-only combat actions.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
README.md
Code
15 1,714
src/main/java/com/kodari/vexbot/VexBotPaper.java
package com.kodari.vexbot;

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

public final class VexBotPaper extends JavaPlugin {
    private KitManager kitManager;
    private TeamManager teamManager;
    private SpawnAreaManager spawnAreaManager;
    private BotManager botManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResource("bots.yml", false);
        saveResource("kits.yml", false);
        saveResource("teams.yml", false);
        saveResource("spawnareas.yml", false);

        kitManager = new KitManager(this);
        teamManager = new TeamManager(this);
        spawnAreaManager = new SpawnAreaManager(this);
        botManager = new BotManager(this, kitManager, teamManager, spawnAreaManager);
        Bukkit.getPluginManager().registerEvents(botManager, this);

        PluginCommand command = getCommand("vexbot");
        if (command == null) {
            getLogger().severe("The vexbot command is missing from plugin.yml.");
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }
        VexBotCommand executor = new VexBotCommand(this, botManager, kitManager, teamManager, spawnAreaManager);
        command.setExecutor(executor);
        command.setTabCompleter(executor);
        botManager.restoreActiveBots();
        botManager.startTask();
    }

    @Override
    public void onDisable() {
        if (botManager != null) {
            botManager.shutdownEntities();
        }
    }

    public KitManager getKitManager() {
        return kitManager;
    }

    public TeamManager getTeamManager() {
        return teamManager;
    }

    public SpawnAreaManager getSpawnAreaManager() {
        return spawnAreaManager;
    }

    public BotManager getBotManager() {
        return botManager;
    }
}