mojira.dev
MC-302074

Disabled friendly fire/pvp prevents the player from damaging themselves

When a player attempts to damage themselves using a projectile (eg. arrow), explosive (eg. TNT) or the /damage command, they will fail if they are on a team with friendlyFire disabled or if /gamerule pvp is set to false.

This is very longstanding behavior and may be intended, but it does constitute a design consideration which minigame creators and others must account for, and precludes some interesting possibilities. It also allows players to use TNT for combat and excavation more fearlessly than they would otherwise be able to. While having three options for these settings (false, true and self_only) is by far the best approach, an argument could be made that allowing players to damage themselves when these settings are false would lead to more intuitive experiences compared to current behavior, to the point where the current behavior constitutes a bug.

To reproduce

  1. /gamerule pvp false

  2. Give yourself TNT and a flint and steel

  3. Switch to survival

  4. Jump in some water

  5. Place and ignite some TNT, and swim right into it as it explodes
    ❌ You take no damage

Expected behavior

You would take damage, since you were just being careless (or rather, you would have been if you had been blast fishing for real) and the pvp gamerule is only intended to disable deliberate attacks against other players.

Note

This report is a semi-clone of MC-253438, but for several reasons (misleading wording in that report, it pertaining only to arrows, moderator resolution) I opted to create a new one so that Mojang’s stance on the issue is clearly known.

Linked issues

Comments 1

An except_melee option for these settings would also be nice to have; see my Feedback Discord post here.

clamlol

(Unassigned)

Confirmed

Platform

Normal

Commands, Player

1.21.8, 25w37a

Retrieved