CombatX — Complete Minecraft Paper CombatLog Plugin Development Prompt
Build a complete Minecraft Paper CombatLog plugin named CombatX. Implement every requirement below in one project. Do not split the work into separate projects or omit features.
1. Technical Requirements
- Target Minecraft Java Edition 26.2.
- Use a compatible Paper API and the appropriate Java version.
- If the required API or version is unavailable, clearly explain the limitation. Never silently downgrade the target version or falsely claim compatibility.
- Plugin name:
CombatX - Main package:
com.combatx - Main command:
/combat - Build system: Maven.
- Provide the complete source project,
pom.xml,plugin.yml,config.yml, README, and compiled.jarif building succeeds. - Provide a ZIP of the source project if possible.
- Use real, compilable Java code. No pseudocode, unfinished placeholders, or empty implementations.
- Preserve all requirements in this prompt.
2. OP-Only Management Commands
Every /combat management command and subcommand must be restricted to server operators.
- Check
Player.isOp()on the server side for every management command. - Non-OP players must not execute management commands.
- Hide management-command TAB completions from non-OP players.
- Make the permission-denied message configurable.
- OP status must not automatically bypass combat restrictions or logout penalties.
- OP bypass must be disabled by default and configurable separately.
Required command structure:
/combat— Main help menu./combat log— CombatLog help menu./combat log item— Item-management help menu./combat log item block <item_name>— Add a valid Minecraft material to the blocked-item list./combat log item open— Open the blocked-item management GUI./combat log item cooldown <item_name> <seconds>— Set a custom cooldown for a material./combat log item cooldown reset <item_name>— Remove the custom cooldown configuration for that material only./combat cooldown <seconds>— Change the global combat-tag duration./combat reload— Safely reload configuration and persistent item settings.
Validate argument counts, material names, and numeric values. Display useful error messages for invalid input.
The global combat duration and item cooldowns must remain completely independent.
3. TAB Completion
Implement context-sensitive TAB completion:
/combat→log,cooldown,reload/combat log→item/combat log item→block,open,cooldown/combat log item block→ valid Minecraft material names/combat log item cooldown→ valid material names/combat log item cooldown reset→ materials with configured custom cooldowns/combat cooldown→ suggested duration values- After an item name in a cooldown command, suggest numeric duration values.
Suggestions must match the current command context. Non-OP players must not see management-command suggestions. Always validate commands server-side regardless of TAB completion.
4. Combat Tagging System
When one player damages another player in PvP, both the attacker and the victim must immediately enter combat.
- Default combat duration: 15 seconds.
- Track each player's combat state independently using UUIDs.
- Refresh the relevant timers after each qualifying PvP hit.
- Fighting a third player must not incorrectly clear another player's active combat state.
- Remove the combat tag when the player's timer expires.
- Handle deaths, disconnects, offline players, and server shutdown safely.
- Prevent duplicate tasks, accumulating timers, and memory leaks.
5. ActionBar Countdown
Display the remaining combat time in the ActionBar for both the attacker and the victim.
Default format:
Combat Cooldown: 15s
The countdown must update once per second: 14s, 13s, and so on.
- Each player must see their own remaining time.
- Refresh the timer and ActionBar after qualifying hits.
- Clear the message when combat ends.
- Prevent stale messages, flickering, and duplicate countdown tasks.
- The server's actual combat state must be the source of truth.
Support this configuration:
combat:
duration-seconds: 15
actionbar:
enabled: true
format: "&cCombat Cooldown: &f{time}s"
update-interval-ticks: 20
clear-on-expire: true
The /combat cooldown <seconds> command must update and persist the global duration. New combat tags must use the updated duration. Define consistent behavior for players already tagged when the duration changes.
6. Block Commands During Combat
By default, prevent players from executing other commands while they are in combat. Normal chat messages must not be blocked.
Support this configuration:
combat:
commands:
block-during-combat: true
allowlist:
- msg
- tell
- reply
Requirements:
- Compare command names case-insensitively.
- Normalize commands with or without a leading
/. - Handle aliases and namespaced command labels safely where possible.
- Allow commands listed in the configured allowlist.
- Block other commands before they execute and display a configurable message.
- OP players are subject to this restriction by default.
- An OP bypass can be enabled through a separate configuration option, disabled by default.
- The allowlist must never bypass the OP checks for
/combatmanagement commands.
7. Combat Logout Penalty — Critical Requirement
If a player hits another player and disconnects while their own combat timer is still active, the player who disconnects must die and drop their items at their last valid location.
Implement this behavior reliably. This is a core feature, not an optional suggestion.
- Apply the penalty independently to attackers and victims.
- If either player disconnects while their own combat tag is active, apply the penalty to that player.
- Handle players who disconnect immediately after hitting someone.
- Do not apply the penalty if their combat timer has already expired.
- Store the player's last valid location safely while they are online.
- Drop the player's inventory, armor, and offhand items according to the configuration.
- Do not duplicate, silently delete, or accidentally retain items that should be dropped.
- Ensure each disconnect triggers the penalty no more than once.
- Handle interactions between quit events, death events, and item-drop processing safely.
- Do not assume a normal death event will automatically occur for an offline player.
- Do not rely solely on calling
setHealth(0)or accessing an offline player unsafely. - Make sure the penalty works even if the player disconnects immediately after dealing or receiving damage.
- OPs must also receive the penalty by default unless an explicit OP-bypass setting is enabled.
Support this configuration:
combat:
logout-penalty:
enabled: true
drop-inventory: true
drop-armor: true
drop-offhand: true
message: "&cYou logged out during combat! Your items have been dropped."
Use a reliable server-side implementation that ensures the disconnecting player is treated as having died for CombatLog purposes and that the appropriate items drop at their last valid location. Avoid relying on a normal online death sequence that may not run after disconnection.
8. Blocked Items During Combat
The command /combat log item block <item_name> must add a valid Minecraft material to the blocked-item list.
- Validate material names and display clear errors.
- Prevent duplicate entries.
- Block the item only while the player is in combat.
- Outside combat, the item must work normally.
- Display a configurable message when an item is blocked.
- Handle relevant events, including right-clicking air or blocks, consumable items, and throwable items such as ender pearls.
- Handle main-hand and offhand interactions without processing the same action twice.
- Avoid blocking unrelated interactions or items unnecessarily.
- Removing an item from the blocked list must allow it to be used again, subject to any applicable cooldown.
9. Blocked-Item Management GUI
The command /combat log item open must open a GUI for managing blocked items.
- Display each blocked material using its own item icon.
- Clicking an icon removes that material from the blocked list.
- Support pagination.
- Display a configurable message when the list is empty.
- Prevent item theft, item movement, shift-clicking, dragging, hotbar swapping, and other inventory exploits.
- Use a custom
InventoryHolderor an equally reliable GUI identity mechanism. Do not identify the GUI solely by its title. - Restrict GUI access and management interactions to OP players.
- Persist changes immediately or through a reliable saving mechanism.
10. Per-Item Cooldown System
The command /combat log item cooldown <item_name> <seconds> must configure a separate cooldown for each material and each player.
- Start the cooldown only after the item has been used successfully.
- Prevent bypasses by moving items between slots, splitting stacks, or switching between main hand and offhand.
- Handle relevant usage events without counting the same action multiple times.
- Inform the player how much cooldown time remains.
- Prevent the same material from being used again until its cooldown expires.
- Check the blocked-item restriction before checking cooldowns.
- Track player cooldowns by UUID.
- Use reliable expiration timestamps or equivalent tracking.
- Persist configuration and relevant cooldown data as reliably as practical across server restarts.
The command /combat log item cooldown reset <item_name> must remove only the custom cooldown configuration for the specified material. By default, resetting a custom cooldown means that the material has no additional CombatX cooldown unless a separate default cooldown is configured.
Resetting one material must not change any other material's cooldown or the global combat duration. Do not unnecessarily clear unrelated active cooldown records.
11. Configuration and Persistence
Provide a functional config.yml covering:
- Global combat duration
- ActionBar enablement, formatting, and update interval
- Combat entry and exit messages
- Blocked-command messages and allowlists
- Logout penalty and individual item-drop settings
- OP bypass settings, disabled by default
- Blocked materials
- Per-material cooldown settings
- GUI title, page size, and empty-list message
- Permission-denied messages
- Validation errors and success messages
- Reload feedback
Every configuration option must be connected to working code. Do not include unused settings.
Use appropriate configuration loading and saving mechanisms, including saveDefaultConfig() where applicable. Reloading must not register duplicate listeners or scheduler tasks. Persist changed settings reliably.
12. Code Structure and Reliability
Use a clean, maintainable architecture. Suggested classes include:
CombatXPluginCombatCommandCombatManagerCombatListenerItemBlockManagerItemCooldownManagerBlockedItemGUIConfigManager
Class names are suggestions; the important requirement is clear separation of responsibilities.
Ensure:
- UUID-based player tracking.
- Safe handling of null references and offline players.
- Correct Paper event handling.
- Proper scheduler cleanup.
- Safe reload behavior.
- No duplicate item drops or item duplication.
- No accidental item loss during logout penalties.
- No false combat tags from unrelated damage.
- No unnecessary cancellation of unrelated gameplay interactions.
- Server-side validation for important actions.
- Consistent messages and settings across all features.
13. Build, Testing, and Delivery
Complete the project and perform the following checks:
- Build the Maven project.
- Run
mvn clean packageif the environment permits. - Fix compilation errors.
- Test all commands and OP restrictions.
- Verify TAB completion.
- Verify ActionBar countdowns for both players.
- Confirm global combat duration and item cooldowns are independent.
- Test the blocked-item GUI and inventory exploits.
- Test command restrictions during combat.
- Test combat logout penalties for both attackers and victims.
- Test disconnects immediately after dealing or receiving a hit.
- Verify that expired combat tags do not trigger logout penalties.
- Verify that item drops are not duplicated or lost.
- Verify persistence across reloads and server restarts.
Deliver:
- Complete Java source code.
pom.xml.plugin.yml.config.yml.- README and installation instructions.
- A compiled
.jarif the build succeeds. - A ZIP of the source project if possible.
Do not claim a feature has been tested unless it actually has been tested. Clearly disclose any limitations.
Final instructions: Implement every requirement in this single CombatX project. Preserve the specified Minecraft 26.2 target, verify actual API compatibility, and do not silently downgrade the version. Do not omit the CombatLog logout-death behavior. Before delivery, compare the implementation against every section above, fix missing functionality, build the plugin where possible, and provide the completed artifacts.
Should I create a new Paper plugin project for CombatX, or is this for an existing project you’d like to add to the workspace?
create a new paper plugin
I’ve started the complete CombatX implementation in the new Paper plugin project, with Minecraft 26.2 compatibility and the combat logout penalty called out as critical requirements. I’ll verify the build when the project developer finishes.
…Built CombatX with Maven targeting Minecraft Java Edition 26.2. The Paper Maven repository publishes 26.2.build.135-stable, which is set as the API dependency; the project compiler release is 25.
Implemented UUID-based combat tags and action bars, command blocking with a configurable alias allowlist and OP bypass disabled by default, OP-only management commands with hidden TAB suggestions for non-OP players, and logout drops guarded against duplicate handling. The blocked-item menu cancels all clicks and drags while open; configurable per-material cooldowns are applied after accepted uses and persisted across restarts.
Added pom.xml, plugin.yml, config.yml, README, and the Java implementation. Runtime testing was not performed. This environment does not provide a source-ZIP generation operation.
The initial CombatX build compiled against Paper 26.2, but a source review found that several requested features—especially the command hierarchy, paginated blocked-item GUI, and configurable logout-drop behavior—were incomplete. I’ve delegated a focused correction; I’ll compile the updated project once it’s finished.
Inspect the current Maven project and CombatX sources against the required command, combat, GUI, and persistence behaviors.
Replace incomplete command/config behavior and correct combat, logout penalty, blocked-item GUI, and cooldown handling.
Update documentation to match the implementation and retain the exact 26.2 target.Updated CombatX to use the required
/combatcommand hierarchy, with server-side OP checks for all management and help paths and no TAB suggestions for non-OP players. Replaced the config schema and documented its wired settings and defaults.
Implemented independent combat timers, configurable action bars and command restrictions, retiming active tags when the global duration changes, and category-specific logout drops with location fallback and duplicate handling. Reworked blocked-item management into a paginated, holder-identified GUI that only removes blocked materials and cancels inventory movement. Custom per-material cooldowns are configurable by command, tracked per player and material, and persisted separately from combat duration.
The project still targets Paper API 26.2.build.135-stable and Java 25; no version downgrade was made. Runtime testing was not performed, and no source ZIP was generated.
CombatX is implemented and compiled successfully for Paper API 26.2.build.135-stable using Java 25. The update includes the requested /combat command hierarchy, combat tagging and action bars, command restrictions, logout penalties, blocked-item GUI, and per-material cooldowns.
Runtime behavior was not tested, and a source ZIP was not generated.
No files in this session