the promt is in this file
📄
pasted-code-1793036997637.txt
txt
480 lines
▶
# PROJECT: REALPLAYERS — COMPLETE MINECRAFT FAKE PLAYER PLUGIN
You are Kodari AI, acting as a senior Minecraft Paper plugin engineer, Java developer, AI behavior programmer, and quality assurance engineer.
Your task is to **BUILD, COMPILE, DEBUG, TEST, AND DELIVER** a complete, production-ready Minecraft plugin called **RealPlayers**.
**Do not give me a tutorial, pseudocode, an implementation plan instead of code, or an unfinished project. I want the actual working plugin.**
## 1. TARGET ENVIRONMENT
- Plugin name: RealPlayers
- Minecraft version: Java Edition 1.21.11
- Server software: Paper 1.21.11
- Java version: 21
- Language: Java
- Final output: `RealPlayers.jar`
- Installation: Drag and drop into the server's `plugins` folder.
- Configuration: Automatically generated on first startup.
- Maximum fake players: 1,000, configurable.
- Build system: Gradle.
- No paid dependencies.
- Prefer standalone implementation. If a dependency such as Citizens is necessary, explain why, ensure compatibility, and supply exact installation requirements.
The plugin must not require me to compile anything myself.
## 2. CORE CONCEPT
Create fake Minecraft players that behave as naturally as possible, rather than stationary NPCs.
They must have:
- Realistic usernames and player skins.
- Player-like models and animations.
- Movement, jumping, sprinting, crouching, and swimming.
- Equipment, inventories, health, hunger, and combat.
- Different personalities and behaviors.
- World interaction.
- Persistence across server restarts.
- Team awareness.
- Join, leave, and death messages.
- Appropriate player-list integration.
Use genuine server-side simulated players if technically feasible. Otherwise implement the closest reliable equivalent and document any unavoidable differences.
Do not claim NPCs are identical to authenticated Minecraft players if they are not.
## 3. COMMANDS
Implement:
`/fakeplayerspawn `
Examples:
`/fakeplayerspawn 10 followers good`
`/fakeplayerspawn 20 passive medium`
`/fakeplayerspawn 5 normal godly`
`/fakeplayerspawn 15 aggressive bad`
`/fakeplayerspawn 3 followers kit1`
Also implement:
`/fakeplayers kit1`
`/fakeplayers kit2`
`/fakeplayers kit3`
And so on.
Additional administration commands:
- `/fakeplayers list`
- `/fakeplayers remove `
- `/fakeplayers removeall`
- `/fakeplayers info `
- `/fakeplayers reload`
- `/fakeplayers help`
Include permissions, tab completion, validation, configurable limits, and helpful error messages.
## 4. FOUR AI PERSONALITIES
### FOLLOWERS
Followers belong to the player who spawned them.
They must:
- Follow their owner naturally.
- Walk when their owner walks.
- Sprint when their owner sprints.
- Crouch 0.2–1.0 seconds after their owner crouches.
- Jump and navigate obstacles when appropriate.
- Avoid getting stuck.
- Defend their owner when attacked.
- Attack enemies their owner attacks.
- Never deliberately attack their owner.
- Avoid attacking teammates.
- Maintain natural spacing rather than standing inside each other.
- Wander around their last location when their owner disconnects.
- Resume following when their owner reconnects.
- React appropriately when their owner changes worlds.
### PASSIVE
Passive fake players must:
- Wander around a home area.
- Look around naturally.
- Avoid dangerous situations.
- Never initiate combat.
- Run away when attacked.
- Panic when witnessing nearby player deaths.
- Run away when hearing goat horns.
- Eventually calm down and return to normal wandering.
- Avoid dangerous falls and hazardous terrain.
### NORMAL
Normal fake players must:
- Wander naturally.
- Explore their surroundings.
- Ignore unrelated deaths.
- Never initiate attacks without a reason.
- Fight back when attacked.
- Defend themselves using available equipment.
- Flee when hearing goat horns.
- Resume normal behavior after danger passes.
- Occasionally interact with the environment.
### AGGRESSIVE
Aggressive fake players must:
- Search for nearby targets.
- Attack players and other fake players outside their team.
- Be able to attack the player who spawned them.
- Never attack teammates.
- Chase targets intelligently.
- Stop chasing unreachable targets.
- Use their equipment appropriately.
- Fight using Minecraft-like combat mechanics.
- Switch targets when necessary.
- Avoid constantly spinning or attacking through walls.
## 5. GOAT HORN REACTIONS
Normal and passive fake players must react to nearby goat horn sounds.
Requirements:
- Detect goat horn usage within a configurable radius.
- Introduce a randomized human-like reaction delay.
- Turn toward or away from the sound.
- Enter a temporary panic state.
- Sprint away from the source.
- Navigate around obstacles.
- Return to their original behavior afterward.
Followers and aggressive players should not automatically panic unless configured.
## 6. REALISTIC MOVEMENT
Implement:
- Walking.
- Sprinting.
- Jumping.
- Swimming.
- Crouching.
- Head rotation.
- Looking at nearby players.
- Smooth turning.
- Pathfinding.
- Obstacle avoidance.
- Collision awareness.
- Recovery when stuck.
- Avoidance of lava, fire, dangerous drops, and drowning.
Movement should not look like instant teleportation between waypoints.
Teleportation may only be used as a carefully controlled recovery mechanism when necessary.
## 7. REALISTIC PVP
Combat must respect Minecraft mechanics as closely as the chosen architecture permits.
Implement:
- Melee attacks.
- Attack cooldowns.
- Weapon damage.
- Armor protection.
- Enchantments.
- Knockback.
- Critical hits when appropriate.
- Shields and blocking.
- Bow attacks.
- Crossbow attacks.
- Projectile aiming.
- Line-of-sight checks.
- Target selection.
- Combat spacing.
- Retreating at low health.
- Healing and food usage.
- Difficulty differences based on equipment and behavior.
Fake players must not attack through walls or hit targets outside legitimate range.
Do not implement unfair reach, impossible attack speeds, or unrealistic damage.
## 8. EQUIPMENT TIERS
Support:
**none:** No equipment.
**bad:** Weak, randomized equipment.
**medium:** Average equipment with reasonable weapons and armor.
**good:** Strong equipment with some enchantments.
**godly:** High-quality enchanted equipment.
**kitN:** Exact custom kit selected by an administrator.
Equipment must be varied where appropriate.
Actors should visibly hold their items and wear their armor.
## 9. CUSTOM KIT EDITOR
`/fakeplayers kit` must open an inventory GUI.
The administrator must be able to:
- Add weapons.
- Add armor.
- Add food.
- Add tools.
- Add shields.
- Add other items.
- Configure the offhand.
- Save the kit.
- Reopen and edit existing kits.
- Spawn actors using saved kits.
Kits must persist after server restarts.
Do not accidentally consume the administrator's real inventory.
## 10. SURVIVAL AND WORLD INTERACTIONS
Implement believable, configurable survival behavior.
Fake players should be able to:
- Eat when hungry.
- Heal when possible.
- Manage their inventory.
- Pick up appropriate dropped items.
- Equip better items.
- Break selected blocks.
- Place selected blocks.
- Open doors.
- Interact with villagers.
- Perform real villager trades when possible.
- Use tools appropriately.
- Avoid destroying protected areas.
World modifications must be disabled by default or controlled through permissions and configuration.
Respect relevant Bukkit/Paper protection events and plugin compatibility.
Never fake a trade by simply creating free items.
## 11. TEAMS
Every `/fakeplayerspawn` command creates a separate team.
Example:
`/fakeplayerspawn 10 aggressive good`
Those ten actors belong to one team.
Another spawn command creates a different team.
Requirements:
- Teammates never intentionally attack one another.
- Aggressive actors can attack other teams.
- Followers protect their owner.
- Aggressive actors do not automatically consider their creator an ally.
- Team information persists across restarts.
- Team identification is stable and unique.
## 12. SKINS AND USERNAMES
Implement:
- Unique, believable Minecraft-style usernames.
- No duplicate active names.
- Configurable skin selection.
- Multiple skin variations.
- Reliable skin loading and caching.
- Sensible fallback skins.
- No dependence on paid skin services.
Avoid impersonating real online players by default.
## 13. TAB LIST AND CHAT MESSAGES
Where technically supported, fake players should appear in the TAB player list.
Support configurable:
- Join messages.
- Leave messages.
- Death messages.
- Name formatting.
- TAB visibility.
- Team indicators.
Messages should resemble vanilla Minecraft formatting.
Do not incorrectly report fake players as real authenticated online users.
## 14. DEATH AND RESPAWNING
When a fake player dies:
- Apply proper damage rules.
- Determine the killer when possible.
- Generate an appropriate death message.
- Handle inventory drops correctly.
- Remove the fake player one server tick after death.
- Remove its TAB entry.
- Remove associated AI tasks.
- Release memory and entity references.
- Update persistent actor records.
Dead actors must not respawn unless a configurable respawn feature is enabled.
## 15. PERSISTENCE
Save and restore:
- Actor names.
- Locations.
- Worlds.
- Health.
- Inventory.
- Equipment.
- Personality.
- Team.
- Owner UUID.
- Custom kit references.
- AI state where appropriate.
- Home location.
- Configuration.
After restarting the server, surviving actors should be restored without duplication.
Handle missing worlds, corrupted records, and plugin reloads safely.
## 16. PERFORMANCE
Target support for up to 1,000 actors, but do not falsely guarantee that every server can run 1,000 simultaneously.
Implement:
- Configurable AI tick intervals.
- Reduced processing for distant actors.
- Efficient nearby-target queries.
- Spatial partitioning where useful.
- Pathfinding throttling.
- Spawn batching.
- Safe cleanup.
- Minimal unnecessary allocations.
- No blocking disk operations on the main server thread.
- No unsafe asynchronous Bukkit world operations.
- Configurable simulation distances.
- Performance diagnostics.
Stress-test the system at increasing actor counts and report measured results.
## 17. CONFIGURATION
Generate a documented `config.yml` with settings for:
- Maximum actors.
- Spawn limits.
- Detection ranges.
- Attack behavior.
- Movement speed.
- Panic duration.
- Goat horn radius.
- AI update frequency.
- World interactions.
- Block modifications.
- Trading.
- Skins.
- TAB visibility.
- Chat messages.
- Persistence.
- Debugging.
- Performance optimization.
## 18. BUILD AND TEST REQUIREMENTS
This section is mandatory.
1. Generate the complete project.
2. Resolve all dependencies.
3. Compile with Java 21.
4. Fix every compiler error.
5. Produce `RealPlayers.jar`.
6. Start a clean Paper 1.21.11 test server.
7. Verify the plugin enables successfully.
8. Test every command.
9. Test all four personalities.
10. Test combat, movement, kits, goat horns, persistence, and cleanup.
11. Test interactions with multiple fake players.
12. Test shutdown and restart.
13. Inspect errors and exceptions.
14. Fix discovered problems.
15. Rebuild the final JAR.
Never claim a test passed unless you actually ran it.
If you cannot execute a test, clearly mark it **NOT TESTED**.
## 19. NO PLACEHOLDERS
Do not use:
- Empty methods pretending to implement features.
- TODO comments as substitutes for functionality.
- Fake success messages.
- Unimplemented command handlers.
- Invented dependencies.
- Unsupported API calls.
- Code that only works in theory.
- Claims of compilation without compilation.
- Claims of testing without testing.
If a feature is technically impossible with the chosen architecture, implement the closest legitimate alternative and clearly explain the limitation.
## 20. FINAL DELIVERABLE
My required final output is:
**`RealPlayers.jar`**
It must be an actual compiled Minecraft plugin JAR, not a ZIP of Java source files.
Include a brief report showing:
- Features implemented.
- Build result.
- Tests actually performed.
- Any remaining limitations.
- Required dependencies, if any.
- Installation instructions.
The plugin must be designed for Paper 1.21.11 and Java 21.
**Do not stop after planning. Create the files, implement the systems, build the plugin, test what you can, and deliver the compiled JAR.**
If the environment lacks build or server-testing capabilities, state that explicitly rather than fabricating a successful result.
BEGIN IMPLEMENTATION NOW.
I’ll build the plugin from scratch with:
Paper 1.21.11 / Java 21 project metadata and generated configuration.
Spawn, administration, kit-editor commands, persistence, and team-aware actor AI.
A clear boundary around what Bukkit can simulate: these actors are humanoid mobs, not authenticated player entities.
Created the RealPlayers project with spawn and admin commands, four basic behavior modes, team grouping, equipment tiers, a kit editor that copies rather than consumes items, goat-horn reactions, actor persistence, and death cleanup.
Build and tests: NOT TESTED. I did not compile the project or run a Paper 1.21.11 server, so I cannot claim a successful build or deliver a verified JAR. To build RealPlayers.jar in Kodari, click Compile in the top bar, then click Compile in the window; download the JAR when the build succeeds.
Important limitations: Bukkit cannot create genuine authenticated player entities through this implementation. Actors are named zombie entities, so they do not have player skins, player models, genuine TAB entries, or authentic player animations. Their combat and movement are simplified; full player survival inventory, villager trading, and world modification are not implemented. Kit slots cover held item, armor, and offhand only. No stress test was run.
package com.kodari.realplayers;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;
public final class RealPlayersPlugin extends JavaPlugin {
private ActorManager actorManager;
@Override
public void onEnable() {
saveDefaultConfig();
actorManager = new ActorManager(this);
Bukkit.getPluginManager().registerEvents(actorManager, this);
FakePlayersCommand command = new FakePlayersCommand(this, actorManager);
PluginCommand spawnCommand = getCommand("fakeplayerspawn");
PluginCommand adminCommand = getCommand("fakeplayers");
if (spawnCommand == null || adminCommand == null) {
getLogger().severe("Commands are missing from plugin.yml; disabling.");
Bukkit.getPluginManager().disablePlugin(this);
return;
}
spawnCommand.setExecutor(command);
spawnCommand.setTabCompleter(command);
adminCommand.setExecutor(command);
adminCommand.setTabCompleter(command);
}
@Override
public void onDisable() {
if (actorManager != null) {
actorManager.shutdown();
}
}
}