📄
pasted-code-1793185392821.txt
txt
254 lines
▶
# MASTER BUILD PROMPT — PRitive MC Sword Bot Practice
You are a senior Minecraft plugin developer, PvP AI engineer, and software tester. Build a complete, installable, working plugin for my Minecraft server, **PRitive MC**.
## 1. Existing environment
- Minecraft Java Edition: 1.21.11
- Server software: Not yet confirmed; inspect the actual software before implementation.
- Server files include `server.jar`, `bukkit.yml`, `spigot.yml`, `plugins/`, `config/`, `Arenas/`, and `spawn/`.
- Existing menu plugin: DeluxeMenus.
- Target server API: Paper 1.21.11 if the server is confirmed to be Paper.
- Java: 21 for Minecraft 1.21.11.
- Build system: Maven.
- Plugin name: PRitiveBotPractice.
- Package name: `com.pritivemc.botpractice`.
Do not assume that `server.jar` means Paper. Provide a simple way to verify the server brand and version. If it is Spigot or another Bukkit-compatible fork, explain the compatibility implications before choosing dependencies.
Use the correct 1.21.11 API dependency and compile against the actual target version. Do not use Minecraft 1.21.4, 1.21.5, 1.20, or 26.x dependencies.
## 2. Core objective
Add a separate **Bot Practice** mode to my existing PRitive MC Practice server.
The player journey must be:
Practice Lobby → Existing Practice Menu → Bot Practice → Difficulty Selection → Immediate Sword PvP Match.
The player must not need another human opponent, wait in a queue, or type a command to start a normal match.
Integrate with DeluxeMenus using a separate example menu configuration. Never overwrite or replace my existing menu configuration automatically.
## 3. Difficulty selection
Create four clickable options:
**NOOB**
- Slow reactions and movement.
- Frequent attack misses.
- Weak tracking and limited strafing.
- Low combat pressure.
**NORMAL**
- Moderate reactions and attack timing.
- Basic tracking and strafing.
- Occasional combos.
**HIGH**
- Fast reactions and strong tracking.
- Effective strafing, sprint resets, and combo management.
- Punishes player mistakes.
**HACKER**
- Extremely challenging, intentionally overpowered practice opponent.
- Very fast reactions and precise tracking.
- Excellent movement and combat decisions.
- Remains a legitimate training simulation; no exploits against the server.
Each difficulty must change actual behavior and be configurable.
## 4. Genuine player-like combat bot
This is the most important technical requirement.
Do not deliver a decorative NPC, ArmorStand, stationary mob, or fake player name above an ordinary entity and claim it is a complete PvP bot.
Investigate whether a real attackable player-like bot is possible on the verified server version.
If a genuine fake player requires an NPC framework, packet library, version-specific NMS implementation, or another dependency, identify and use a suitable implementation that supports Minecraft 1.21.11.
The bot should:
- Look like a player.
- Have a configurable name, skin if supported, sword, and armor.
- Pursue and attack the player.
- Turn, strafe, and move around the arena.
- Receive damage and knockback.
- Handle health, death, and victory conditions.
- Be removed safely when the match ends.
- Respect arena boundaries.
- Support multiple independent matches.
If no reliable genuine player implementation is available, explain the limitation and implement the best honest alternative. Do not fabricate API methods or claim unsupported features work.
## 5. Sword PvP mechanics
The first release supports Sword PvP only.
Implement:
- Configurable sword and armor loadouts.
- Bot pursuit, targeting, and movement.
- Difficulty-based reaction timing.
- Attack cooldowns and combat timing.
- Damage and knockback handling.
- Health and death detection.
- Win/loss messages.
- Match timeout and cleanup.
- Safe player disconnect handling.
- Independent match sessions.
- Protection against duplicate starts and unauthorized interference.
Avoid changing global server PvP settings or affecting other practice modes.
## 6. Match lifecycle
When a player clicks a difficulty:
1. Validate that the player can start a match.
2. Find a valid configured arena.
3. Save the player's original location, inventory, armor, health, hunger, and relevant state.
4. Prepare the player for Sword PvP.
5. Spawn or initialize the correct bot implementation.
6. Equip both combatants.
7. Start the match immediately.
8. Track the combat state and outcome.
9. Detect victory, defeat, timeout, or disconnect.
10. Remove the bot and temporary entities.
11. Restore the player safely.
12. Return the player to the configured practice lobby.
Handle exceptions and interrupted matches without losing player items.
Support multiple players practicing simultaneously, with isolated match sessions and arena allocation.
## 7. Menus and visual presentation
Create a polished inventory GUI or DeluxeMenus integration with:
- Bot Practice.
- Noob.
- Normal.
- High.
- Hacker.
Use configurable icons, display names, lore, and sounds.
Each difficulty button must start the corresponding match immediately without queueing.
Show a helpful message when no arena is available or a dependency is missing.
Provide a separate DeluxeMenus YAML example and explain exactly how to connect it to my current menu. Do not assume my current menu filename or slot positions.
## 8. Arena management
Provide administrator controls for:
- Setting the lobby.
- Creating named arenas.
- Setting arena spawn positions.
- Defining arena boundaries.
- Removing arenas.
- Reloading configuration.
- Checking plugin and dependency status.
Store arena information persistently.
Validate world names and coordinates on startup. Report missing worlds and invalid arena locations instead of crashing.
Use permissions for administrative operations.
## 9. Configuration
Provide complete configuration files for:
- Plugin messages and prefix.
- Difficulty parameters.
- Bot names and skins.
- Health and equipment.
- Attack timing and reaction delays.
- Movement and tracking behavior.
- Arena and lobby settings.
- Match timeout and cleanup delay.
- Maximum simultaneous matches.
- Inventory and player-state restoration.
- Sound and GUI settings.
- Permission nodes.
- Debug logging.
Validate configuration values and provide safe defaults.
## 10. Commands
Administrative commands may include:
`/botpractice reload`
`/botpractice setlobby`
`/botpractice setarena `
`/botpractice removearena `
`/botpractice status`
Commands are for administration and recovery. The normal player experience must be menu-based.
## 11. Code quality
Use a maintainable architecture, including classes equivalent to:
- PRitiveBotPracticePlugin
- MatchManager
- MatchSession
- ArenaManager
- BotController
- Difficulty
- PlayerStateManager
- ConfigurationManager
- MenuIntegration
Include all required imports, dependencies, plugin metadata, resource files, and event handlers.
Do not leave TODOs, missing methods, placeholder implementations, or pseudocode in the claimed finished implementation.
Do not shade or bundle server API classes into the plugin JAR. Package other dependencies correctly and document installation requirements.
## 12. Testing and deliverables
Build using Maven and the correct Java 21 toolchain for Minecraft 1.21.11.
Run all tests possible in the available environment.
Verify:
- The project compiles.
- Plugin metadata is valid.
- Configuration loads.
- Menus trigger the correct actions.
- Match sessions start and terminate.
- Difficulty values affect behavior.
- Disconnect cleanup works.
- Concurrent matches remain isolated.
- The plugin does not interfere with unrelated server modes.
Do not claim runtime testing unless the plugin was actually tested on a compatible server.
Deliver:
- Complete source project.
- `pom.xml`.
- `plugin.yml`.
- All configuration files.
- Sample DeluxeMenus configuration.
- README and installation guide.
- Compiled JAR if successfully built.
- ZIP archive of the complete project if file generation is supported.
- Required dependency list and exact versions.
- Honest build and test report.
Do not overwrite my existing server files or claim a download exists unless the artifact was actually generated.
## 13. Execution instructions
Start by verifying the target server software, version, Java compatibility, and feasible real-bot architecture.
Then implement the complete feasible project in one attempt. Make reasonable engineering decisions without repeatedly asking me questions.
Prioritize compatibility, functional combat behavior, safety, and a genuinely installable plugin over an impressive-looking but nonfunctional result.
The finished project is specifically for **PRitive MC — Minecraft Java 1.21.11 — Sword Bot Practice**.
Create the Paper 1.21.11 plugin, arena/session lifecycle, admin commands, and configurable difficulty GUI.
Use an explicitly labeled zombie-based combat simulation; a real fake player cannot be verified without the server brand and a compatible NPC framework.
Add separate DeluxeMenus integration, installation guidance, and configuration; do not claim live-server verification.
Created the PRitiveBotPractice Gradle project targeting Paper API 1.21.11 and Java 21, with configurable difficulty matches, an inventory menu, arena management, admin commands, and a separate DeluxeMenus example.
The opponent is an attackable zombie-based combat simulation—not a genuine fake player or player-like NPC. The server brand could not be verified from the supplied files; README.md explains how to check it with /version before installation. No compatible server was available, so runtime testing and a compiled JAR are not claimed.
say feature and how to setup
Feature
PRitiveBotPractice adds instant Sword PvP practice from a menu: choose NOOB, NORMAL, HIGH, or HACKER and fight without waiting for another player. Difficulty changes the bot’s speed, pursuit, strafing, attack timing, hit range, damage, and miss chance.
Matches use separate arenas, restore the player’s saved state afterward, and end on victory, defeat, timeout, disconnect, or plugin shutdown. Important: the opponent is an attackable zombie-based simulation, not a genuine fake player or player-like NPC.
Setup
Verify your server with
/versionand confirm it runs Minecraft 1.21.11. The project targets Paper API 1.21.11 and Java 21; other Bukkit-compatible forks are untested.In Kodari, click Compile in the top bar (on phone: ⋮ → Compile Project), then click Compile in the window. Download the JAR when the build succeeds.
Put the JAR in your server’s
plugins/folder and restart.Stand at the location players should return to and run
/botpractice setlobby.Stand at an arena’s player spawn and run
/botpractice setarena <name>. Optionally set the bot spawn with/botpractice setarenaspawn <name> bot, and the arena radius with/botpractice setarenabounds <name> <radius>.Players can run
/botpractice menuto choose a difficulty. To link it from DeluxeMenus, usesrc/main/resources/deluxemenus/botpractice-example.ymlas a separate example and add its entry to your existing menu yourself; it won’t replace your menu configuration.
Admin commands require botpractice.admin (default: operators). Settings are in plugins/PRitiveBotPractice/config.yml; arena data is stored in arenas.yml. No live-server or runtime testing has been performed.
package com.pritivemc.botpractice;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;
public final class PRitiveBotPracticePlugin extends JavaPlugin {
private ConfigurationManager configurationManager;
private ArenaManager arenaManager;
private MatchManager matchManager;
private MenuIntegration menuIntegration;
@Override
public void onEnable() {
saveDefaultConfig();
configurationManager = new ConfigurationManager(this);
arenaManager = new ArenaManager(this);
matchManager = new MatchManager(this, arenaManager);
menuIntegration = new MenuIntegration(this, matchManager);
Bukkit.getPluginManager().registerEvents(matchManager, this);
Bukkit.getPluginManager().registerEvents(menuIntegration, this);
BotPracticeCommand command = new BotPracticeCommand(this, arenaManager, matchManager, menuIntegration);
if (getCommand("botpractice") == null) {
getLogger().severe("botpractice command is missing from plugin.yml; disabling plugin.");
Bukkit.getPluginManager().disablePlugin(this);
return;
}
getCommand("botpractice").setExecutor(command);
getCommand("botpractice").setTabCompleter(command);
getLogger().info("Enabled. Opponents are mob-based combat simulations, not fake players.");
}
@Override
public void onDisable() {
if (matchManager != null) {
matchManager.shutdown();
}
}
public ConfigurationManager getConfiguration() {
return configurationManager;
}
public ArenaManager getArenaManager() {
return arenaManager;
}
public String color(String text) {
return ChatColor.translateAlternateColorCodes('&', text);
}
}