Skip to content

Comments

GH-348 Post death command execution#348

Open
Jakubk15 wants to merge 6 commits intomasterfrom
feature/post-death-commands
Open

GH-348 Post death command execution#348
Jakubk15 wants to merge 6 commits intomasterfrom
feature/post-death-commands

Conversation

@Jakubk15
Copy link
Member

@Jakubk15 Jakubk15 added the 🆕 feature New feature or request label Feb 20, 2026
@Jakubk15 Jakubk15 changed the title Post death command execution GH-348 Post death command execution Feb 20, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Jakubk15, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant new feature enabling server administrators to configure custom commands that execute automatically upon a player's death. This enhancement provides granular control over post-death events, allowing for different commands to be run by the console, the deceased player, or their killer, with options for deferred execution and combat-tagging conditions.

Highlights

  • Post-Death Command Execution: Implemented a new feature allowing configurable commands to be executed after a player's death, offering extensive customization for server administrators.
  • Configurable Command Sources: Introduced settings to define commands that can be run by the console, the dead player, or the killer, providing flexibility in how post-death events are handled.
  • Deferred Command Execution: Added options to defer the execution of certain commands until the player respawns, enabling more dynamic post-death scenarios.
  • Combat Tagging Condition: Included a setting to restrict post-death command execution only to combat-tagged players, ensuring commands are only triggered in relevant combat situations.
  • Build System Updates: Updated build configurations to include a new dependency, EternalCore, and updated the target Minecraft version.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • buildSrc/src/main/kotlin/Versions.kt
    • Added the ETERNALCORE version constant.
  • eternalcombat-plugin/build.gradle.kts
    • Reordered import statements for better organization.
    • Updated the target Minecraft version from 1.21.10 to 1.21.11.
    • Configured the runServer task to download EternalCore as a modrinth plugin.
  • eternalcombat-plugin/src/main/java/com/eternalcode/combat/CombatPlugin.java
    • Reordered import statements for consistency.
    • Moved the java.time.Duration import to a more appropriate section.
    • Registered the new DeathCommandController to handle post-death command logic.
  • eternalcombat-plugin/src/main/java/com/eternalcode/combat/config/implementation/CommandSettings.java
    • Added consolePostDeathCommands to specify commands executed by the console after death.
    • Introduced deferConsoleAfterRespawn to control when console commands are executed.
    • Added deadPostDeathCommands for commands executed by the dead player.
    • Included deferDeadAfterRespawn to control when dead player commands are executed.
    • Added killerPostDeathCommands for commands executed by the killer.
    • Introduced onlyExecuteIfTagged to restrict command execution to tagged combat scenarios.
  • eternalcombat-plugin/src/main/java/com/eternalcode/combat/config/implementation/PluginConfig.java
    • Updated comments for the commands section to reflect the new post-death and logout command execution features.
  • eternalcombat-plugin/src/main/java/com/eternalcode/combat/fight/death/DeathCommandController.java
    • Added a new class DeathCommandController responsible for listening to player death and respawn events.
    • Implemented logic to execute configured post-death commands based on various conditions (console, dead player, killer).
    • Included functionality for deferring command execution until respawn and handling combat tag requirements.
    • Provided placeholder replacement for player and killer names in commands.
Activity
  • No human activity (comments, reviews, etc.) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request introduces post-death command execution, a feature suggested by the community. This includes adding new configuration options for console, dead player, and killer commands, along with logic to defer command execution until respawn. The changes also update dependency versions and import statements. Overall, the implementation seems to address the requested feature effectively, but there are a few areas for improvement regarding code clarity and placeholder consistency.

Comment on lines +60 to +62
if (this.config.commands.onlyExecuteIfTagged) {
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The onlyExecuteIfTagged check is performed here, but it's only for PlayerDeathEvent. If onPlayerUntag is also meant to respect this setting, the check should be moved to executeDeathCommands or duplicated in onPlayerUntag to ensure consistent behavior.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it and I wasn't able to produce any bugs, however I encourage other team members to try it nevertheless

Jakubk15 and others added 4 commits February 20, 2026 10:57
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
const val PACKETEVENTS = "2.11.1"
const val WORLDGUARD = "7.0.15-beta-01"
const val LUCKPERMS = "5.5.17"
const val ETERNALCORE = "2.0.1-SNAPSHOT+12"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what? why snapshot not latest release??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i thought snapshot = more features and more fixes. EternalCore snapshots are stable anyway

@@ -0,0 +1,169 @@
package com.eternalcode.combat.fight.death;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this class is in fight.death, why settings are in command settings?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because that class suits the purpose of the feature

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah we have settings regarding death events I think it would be more suitable there

Comment on lines +26 to +60

@Comment({
"# List of commands that will be executed from console after player death.",
"# Use {player} to represent the name of the player who died and {killer} for the killer's name (if applicable)."
})
public List<String> consolePostDeathCommands = List.of(
"broadcast {player} has died in combat!"
);

@Comment("# When this is set to true, the plugin will execute the console commands only after the dead player has respawned.")
public boolean deferConsoleAfterRespawn = false;

@Comment({
"# List of commands that will be executed from the dead player's perspective after death.",
"# Use {player} to represent the name of the player who died and {killer} for the killer's name (if applicable)."
})
public List<String> deadPostDeathCommands = List.of(
"say You have died in combat!"
);

@Comment("# When this is set to true, the plugin will execute the commands above only after the dead player has respawned.")
public boolean deferDeadAfterRespawn = true;

@Comment({
"# List of commands that will be executed from the killer's perspective after killing a player.",
"# Use {player} to represent the name of the player who was killed and {killer} for the killer's name (if applicable)."
})
public List<String> killerPostDeathCommands = List.of(
"say You have killed {player} in combat!"
);

@Comment("# When this is set to true, the plugin will only execute the post-death commands if the players were tagged")
public boolean onlyExecuteIfTagged = true;

@Comment("# The returned string when the killer is unknown")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add options - suggestions for names to be easily distinguishable:

  • onDeathInCombat
    • console
    • player
  • onAnyDeath
    • console
    • player
  • afterRespawn
    • console
    • player
  • onUntag
    • console
    • player

}
}

private void executeDeathCommands(Player deadPlayer) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like post mortem commands do not need to be stored in this method - when it's called in every listener.
code: this.pendingCommands.put(playerUUID, deferred);

const val PACKETEVENTS = "2.11.1"
const val WORLDGUARD = "7.0.15-beta-01"
const val LUCKPERMS = "5.5.17"
const val ETERNALCORE = "2.0.1-SNAPSHOT+12"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?????

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for testing 🤷

"# List of commands that will be executed from console after player death.",
"# Use {player} to represent the name of the player who died and {killer} for the killer's name (if applicable)."
})
public List<String> consolePostDeathCommands = List.of(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead of adding few fields for do it in one list?

like:

killer:say GG 
console:broadcast dupa
player:say dupa

Copy link
Member Author

@Jakubk15 Jakubk15 Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is giving me multification vibes. I think I'm leaning more towards the multiple list approach that @CitralFlo suggested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants