Minecraft Plugin Development

Minecraft Plugin Development

Guides the AI in building and debugging Minecraft server plugins for Paper, Spigot and Bukkit, from plugin.yml and commands to arenas, player data and config.

Skill files9 files

references/

SKILL.md273 lines
1
---
2
name: minecraft-plugin-development
3
description: 'Use this skill when building or modifying Minecraft server plugins for Paper, Spigot, or Bukkit, including plugin.yml setup, commands, listeners, schedulers, player state, team or arena systems, persistent progression, economy or profile data, configuration files, Adventure text, and version-safe API usage. Trigger for requests like "build a Minecraft plugin", "add a Paper command", "fix a Bukkit listener", "create plugin.yml", "implement a minigame mechanic", "add a perk or quest system", or "debug server plugin behavior".'
4
---
5
6
# Minecraft Plugin Development
7
8
Use this skill for Minecraft server plugin work in the Paper, Spigot, and Bukkit ecosystem.
9
10
This skill is especially useful for gameplay-heavy plugins such as combat systems, wave or boss encounters, war or team modes, arenas, kit systems, cooldown-based abilities, scoreboards, and config-driven game rules.
11
12
For grounded implementation patterns drawn from real Paper plugins, load these references as needed:
13
14
- [`references/project-patterns.md`](references/project-patterns.md) for high-level architecture patterns seen in real gameplay plugins
15
- [`references/bootstrap-registration.md`](references/bootstrap-registration.md) for `onEnable`, command wiring, listener registration, and shutdown expectations
16
- [`references/state-sessions-and-phases.md`](references/state-sessions-and-phases.md) for player session modeling, game phases, match state, and reconnect-safe logic
17
- [`references/config-data-and-async.md`](references/config-data-and-async.md) for config managers, database-backed player data, async flushes, and UI refresh tasks
18
- [`references/maps-heroes-and-feature-modules.md`](references/maps-heroes-and-feature-modules.md) for map rotation, hero or class systems, and modular feature growth
19
- [`references/minigame-instance-flow.md`](references/minigame-instance-flow.md) for arena instances, countdowns, loot refreshes, wave systems, visibility isolation, and entity-to-game ownership
20
- [`references/persistent-progression-and-events.md`](references/persistent-progression-and-events.md) for long-running PvP servers with profiles, perks, buffs, quests, economy, custom domain events, and extension registries
21
- [`references/build-test-and-runtime-validation.md`](references/build-test-and-runtime-validation.md) for Maven or Gradle packaging, shaded dependencies, generated resources, soft dependencies, config validation commands, and first-round server test plans
22
23
## Scope
24
25
- In scope: Paper, Spigot, Bukkit plugin development
26
- In scope: `plugin.yml`, commands, tab completion, listeners, schedulers, configs, permissions, Adventure text, player state, minigame flow, arena instances, map copies, loot, waves, persistent profiles, perks, buffs, quests, economy, and PvP/PvE game loops
27
- In scope: Java-based server plugin architecture, debugging, refactoring, and feature implementation
28
- Out of scope by default: Fabric mods, Forge mods, client mods, Bedrock add-ons
29
30
If the user says "Minecraft plugin" but the stack is unclear, first determine whether the project is Paper/Spigot/Bukkit or a modding stack.
31
32
## Default Working Style
33
34
When this skill triggers:
35
36
1. Identify the server API and version target.
37
2. Identify the build system and Java version.
38
3. Inspect `plugin.yml`, the main plugin class, and command or listener registration.
39
4. Map the gameplay flow before editing code:
40
- player lifecycle
41
- game phases
42
- timers and scheduled tasks
43
- team, arena, or match state
44
- config and persistence
45
5. Make the smallest coherent change that keeps registration, config, and runtime behavior aligned.
46
47
If the plugin is gameplay-heavy or stateful, read [`references/project-patterns.md`](references/project-patterns.md) and [`references/state-sessions-and-phases.md`](references/state-sessions-and-phases.md) before editing.
48
49
If the task touches arena isolation, map instances, chest or resource refills, wave spawning, route voting, spectator visibility, or game-specific chat, also read [`references/minigame-instance-flow.md`](references/minigame-instance-flow.md).
50
51
If the task touches persistent player progression, profile saves, economy rewards, perks, buffs, quests, custom combat events, or long-running shared PvP servers, also read [`references/persistent-progression-and-events.md`](references/persistent-progression-and-events.md).
52
53
If the task touches build files, `plugin.yml` metadata, shaded dependencies, generated resource output, deployment to a test server, optional plugin integrations, or release validation, also read [`references/build-test-and-runtime-validation.md`](references/build-test-and-runtime-validation.md).
54
55
## Project Discovery Checklist
56
57
Check these first when present:
58
59
- `plugin.yml`
60
- `pom.xml`, `build.gradle`, or `build.gradle.kts`
61
- the plugin main class extending `JavaPlugin`
62
- command executors and tab completers
63
- listener classes
64
- config bootstrap code for `config.yml`, messages, kits, arenas, or custom YAML files
65
- generated resource output such as `target/classes`, `build/resources`, or copied plugin jars
66
- scheduler usage through Bukkit scheduler APIs
67
- any player data, team state, arena state, or match state containers
68
69
## Core Rules
70
71
### Prefer the concrete server API in the repo
72
73
- If the project already targets Paper APIs, keep using Paper-first APIs instead of downgrading to generic Bukkit unless compatibility is explicitly required.
74
- Do not assume an API exists across all versions. Check the existing dependency and surrounding code style first.
75
76
### Keep registration in sync
77
78
When adding commands, permissions, or listeners, update the relevant registration points in the same change:
79
80
- `plugin.yml`
81
- plugin startup registration in `onEnable`
82
- any permission checks in code
83
- any related config or message keys
84
85
### Respect main-thread boundaries
86
87
- Do not touch world state, entities, inventories, scoreboards, or most Bukkit API objects from async tasks unless the API explicitly permits it.
88
- Use async tasks for external I/O, heavy computation, or database work, then switch back to the main thread before applying gameplay changes.
89
90
### Model gameplay as state, not scattered booleans
91
92
For gameplay plugins, prefer explicit state objects over duplicated flags:
93
94
- match or game phase
95
- player role or class
96
- cooldown state
97
- team membership
98
- arena assignment
99
- alive, eliminated, spectating, or queued state
100
101
When the feature affects match-heavy minigames or persistent-brawl gameplay, look for hidden state transitions first before patching symptoms.
102
103
For multi-arena plugins, isolate per-game visibility, chat recipients, scoreboards, loot, and entity ownership. Do not let one arena observe or mutate another arena by accident.
104
105
### Favor config-driven values
106
107
When the feature includes damage, cooldowns, rewards, durations, messages, map settings, or toggles:
108
109
- prefer config-backed values over hardcoding
110
- provide sensible defaults
111
- keep key names stable and readable
112
- validate or sanitize missing values
113
114
### Be careful with reload behavior
115
116
- Avoid promising safe hot reload unless the code already supports it well.
117
- On config reload, ensure in-memory caches, scheduled tasks, and gameplay state are handled consistently.
118
119
## Implementation Patterns
120
121
### Commands
122
123
For new commands:
124
125
- add the command to `plugin.yml`
126
- implement executor and tab completion when needed
127
- validate sender type before casting to `Player`
128
- separate parsing, permission checks, and gameplay logic
129
- send clear player-facing feedback for invalid usage
130
131
Minimal registration shape:
132
133
```yaml
134
commands:
135
arena:
136
description: Join or leave an arena
137
usage: /arena <join|leave>
138
```
139
140
```java
141
@Override
142
public void onEnable() {
143
ArenaCommand command = new ArenaCommand(gameService);
144
PluginCommand arena = getCommand("arena");
145
if (arena != null) {
146
arena.setExecutor(command);
147
arena.setTabCompleter(command);
148
}
149
}
150
```
151
152
### Listeners
153
154
For event listeners:
155
156
- guard early and return early
157
- check whether the current player, arena, or game phase should handle the event
158
- avoid doing expensive work in hot events such as move, damage, or interact spam
159
- centralize repeated checks where practical
160
161
### Scheduled Tasks
162
163
For timers, rounds, countdowns, cooldowns, or periodic checks:
164
165
- store task handles when cancellation matters
166
- cancel tasks on plugin disable and when a match or arena ends
167
- avoid multiple overlapping tasks for the same gameplay concern unless explicitly intended
168
- prefer one authoritative game loop over many loosely coordinated repeating tasks
169
- ensure countdown or refill tasks self-cancel when the game leaves the expected state
170
171
Main-thread handoff shape:
172
173
```java
174
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
175
PlayerData data = repository.load(playerId);
176
Bukkit.getScheduler().runTask(plugin, () -> {
177
Player player = Bukkit.getPlayer(playerId);
178
if (player != null && player.isOnline()) {
179
scoreboard.update(player, data);
180
}
181
});
182
});
183
```
184
185
### Player and Match State
186
187
For per-player or per-match state:
188
189
- define ownership clearly
190
- clean up on quit, kick, death, match end, and plugin disable
191
- avoid memory leaks from stale maps keyed by `Player`
192
- prefer `UUID` for persistent tracking unless a live player object is strictly needed
193
194
### Text and Messages
195
196
When the project uses Adventure or MiniMessage:
197
198
- follow the existing formatting approach
199
- avoid mixing legacy color codes and Adventure styles without a reason
200
- keep message templates configurable when messages are gameplay-facing
201
202
## High-Risk Areas
203
204
Pay extra attention when editing:
205
206
- damage handling and custom combat logic
207
- death, respawn, spectator, and elimination flow
208
- arena join and leave flow
209
- scoreboard or boss bar updates
210
- inventory mutation and kit distribution
211
- async database or file access
212
- economy, quest, perk, and profile mutation
213
- custom event dispatch or extension registries
214
- version-sensitive API calls
215
- shutdown and cleanup in `onDisable`
216
- cross-arena visibility, chat, and broadcast isolation
217
- map copy, unload, and folder deletion logic
218
- mob, NPC, projectile, or temporary entity ownership
219
- chest or resource refill systems
220
221
## Output Expectations
222
223
When implementing or revising plugin code:
224
225
- produce runnable Java code, not pseudo-code, unless the user asks for design only
226
- mention any required updates to `plugin.yml`, config files, build files, or resources
227
- call out version assumptions explicitly
228
- point out thread-safety or API-compatibility risks when they exist
229
- preserve the project's existing conventions and folder structure
230
231
When the requested change touches plugin startup, async data, match flow, class systems, or rotating maps, consult the matching reference file before editing.
232
233
## Validation Checklist
234
235
Before finishing, verify as many of these as the task allows:
236
237
- the command, listener, or feature is registered correctly
238
- `plugin.yml` matches the implemented behavior
239
- imports and API types match the targeted server stack
240
- scheduler usage is safe
241
- config keys referenced in code exist or have defaults
242
- state cleanup paths exist for match end, player quit, and plugin disable
243
- per-arena chat, visibility, scoreboards, and broadcasts are isolated
244
- temporary worlds, mobs, tasks, and generated resources are cleaned up
245
- there are no obvious null, cast, or lifecycle hazards
246
247
## Common Gotchas
248
249
- Casting `CommandSender` to `Player` without checking
250
- Updating Bukkit state from async tasks
251
- Forgetting to register listeners or declare commands in `plugin.yml`
252
- Using `Player` objects as long-lived map keys when `UUID` is safer
253
- Leaving repeating tasks alive after a round, arena, or plugin shutdown
254
- Hardcoding gameplay constants that should live in config
255
- Assuming Paper-only APIs in a Spigot-targeted plugin
256
- Treating reload as free even though stateful plugins often break under reload
257
- Broadcasting, showing players, or applying scoreboard changes across unrelated game instances
258
- Loading or mutating chest/container blocks before their chunks are available
259
- Forgetting to unregister spawned mobs or temporary entities from the owning game
260
- Editing generated files under `target/classes` or `build/resources` instead of source files under `src/main/resources`
261
262
## Preferred Response Shape
263
264
For substantial requests, structure work like this:
265
266
1. Current plugin context and assumptions
267
2. Gameplay or lifecycle impact
268
3. Code changes
269
4. Required registration or config updates
270
5. Validation and remaining risks
271
272
For small requests, keep the answer concise but still mention any needed `plugin.yml`, config, or lifecycle updates.
273

© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…