Skip to content

fix: evaluate friendly-fire bypass on the attacker - #772

Merged
darbyjack merged 1 commit into
masterfrom
fix/attacker-friendly-fire-permissions
Jul 12, 2026
Merged

fix: evaluate friendly-fire bypass on the attacker#772
darbyjack merged 1 commit into
masterfrom
fix/attacker-friendly-fire-permissions

Conversation

@darbyjack

Copy link
Copy Markdown
Member

Summary

Evaluate guild and ally friendly-fire bypass permissions on the player causing damage rather than the player receiving it.

Root cause

The melee, projectile, and flame-arrow handlers checked guilds.ffa.guild and guilds.ffa.ally on the victim. Because operators implicitly have all permissions, attacks against an operator bypassed friendly-fire protection while the operator's return attacks remained blocked.

Changes

  • check melee friendly-fire bypass permissions on the attacker
  • check projectile friendly-fire bypass permissions on the shooter
  • check flame-arrow friendly-fire bypass permissions on the shooter
  • apply the same correction to both guild-member and allied-player checks
  • retain the existing harmful splash-potion behavior, which already checks the shooter

Validation

  • verified the branch contains one commit and modifies only EntityListener.java
  • reviewed the generated diff: six victim permission checks now consistently use the attacker, with no unrelated changes

Fixes #689

@darbyjack
darbyjack marked this pull request as ready for review July 12, 2026 02:19
@darbyjack
darbyjack merged commit a1750a1 into master Jul 12, 2026
1 check passed
@darbyjack
darbyjack deleted the fix/attacker-friendly-fire-permissions branch July 12, 2026 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Player hitting bug

1 participant