mojira.dev
MC-302072

Failing to damage an entity using /damage due to disabled pvp/friendly fire prints the message "Target is invulnerable to the given damage type"

When using /damage to damage an entity and specifying another entity on the same team as the cause, if friendlyFire is disabled for that team, the message “Target is invulnerable to the given damage type" will be printed, even though the damage type was not the reason the command failed. This also affects the case where pvp is disabled and a player is specified as both the source and the target.

This also affects entities damaging themselves.

To reproduce

  1. /team add team1

  2. /team join team1 @s

  3. /team modify team1 friendlyFire false

  4. Go into survival mode if you are not already

  5. /damage @s 3 minecraft:player_attack by @s
    ❌ The message “Target is invulnerable to the given damage type” is printed

Expected behavior

The message fir friendly fire would say “Target cannot be damaged by [source] since friendly fire is disabled for their team”. The message for pvp would say “Target cannot be damaged by [source] since PVP is disabled”.

Comments 1

Thank you for your report!
After consideration, the issue is being closed as Invalid.

You have posted a feature request or a suggestion. This site is for bug reports only.
For suggestions, please visit The official Minecraft feedback site or visit the Minecraft Feedback Discord server.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

clamlol

(Unassigned)

Confirmed

(Unassigned)

1.21.8, 25w37a, 1.21.9 Release Candidate 1, 1.21.9

Retrieved