๐
1 file
3,246 chars
๐
pasted-code-1780101087147.txt
txt
58 lines
โถ
pasted-code-1780101087147.txt
txt
58 lines
Here's the updated prompt with count-based random world spawning:
---
**SECTION 1 โ PROJECT OVERVIEW**
```
You are an expert Java plugin developer. Create a fully functional Minecraft plugin called "FakePlayerPlugin" using only server-side Bukkit/Paper API via NMS โ no ProtocolLib or PacketEvents. Fake NPCs must be real server-side EntityPlayer objects added to the server's player list. Target Paper 1.20.x or 1.21.x. The plugin must be async-safe, performant, and fully configurable via config.yml.
```
**SECTION 2 โ SPAWNING & MOVEMENT**
```
The plugin must:
- Read a single integer value "npc-count" from config.yml (e.g. npc-count: 10)
- On server start or /fakenpc reload, automatically spawn exactly that many fake NPCs at random valid locations across the world (or a configured world name)
- Random spawn logic: pick a random X/Z within a configurable world radius from 0,0, find the highest solid block at that position using world.getHighestBlockYAt(), and spawn the NPC there
- Ensure spawn locations are on solid ground, not in water, lava, or the void
- Each NPC then moves around independently using random nearby target locations within a configurable wander radius of their current position
- Movement uses smooth stepped teleportation on a repeating scheduler tick with configurable step speed
- NPCs idle between moves with random pause durations, occasional jumping and head rotation
```
**SECTION 3 โ CHAT & TAB LIST**
```
The fake NPCs must:
- All appear in the tab player list and count toward the real server player count via NMS player list injection
- Each have a randomized ping of 20โ80ms set on their EntityPlayer object
- Respond to real player chat after a 3โ10 second random delay with a configurable response chance percentage
- Also send unprompted random chat messages from a config.yml pool on a random timer
- Broadcast fake join messages when the plugin spawns them and fake quit messages if removed
- Pull random usernames automatically from a names list in config.yml, one per NPC
```
**SECTION 4 โ REALISM & CONFIGURATION**
```
Full config.yml options must include:
- npc-count: (integer) total number of NPCs to spawn
- world: (string) which world to spawn them in
- spawn-radius: (integer) max distance from 0,0 to pick random spawn points
- wander-radius: (integer) how far each NPC roams from its current position
- move-speed: (double) teleport step size per tick
- ping-min and ping-max: (integer) fake ping range
- chat-chance: (integer %) chance an NPC responds to player chat
- chat-delay-min and chat-delay-max: (integer seconds) response delay range
- chat-responses: (list) pool of messages NPCs can send
- npc-names: (list) pool of usernames to assign randomly
- skin-uuids: (list, optional) Mojang UUIDs to fetch skins from on startup
Commands:
- /fakenpc reload โ despawn all NPCs and respawn based on current config
- /fakenpc list โ show all active fake NPCs and their locations
- /fakenpc remove โ manually remove one NPC
On plugin disable, all fake players must be cleanly removed from the player list and world. Use reflection-based NMS access for version compatibility.
```
---
Just set `npc-count` in the config and the plugin handles everything else automatically.
Kodari can make mistakes. Review important code before using.
Files
No files in this session
Code