mojira.dev
MC-179940

Player's attributes reset back to default values upon respawning

The Bug

When you modify your attributes and then die, all attributes reset back to the default values.

How to reproduce

  1. Change your max health attribute: /attribute @s generic.max_health base set 10

  2. Die in any way

  3. Respawn

  4. Check your max health: /attribute @s generic.max_health base get
    -> ❌ Max health is 20 it should be 10

Expected behavior

The base values aren't changed back to default values on respawning, but kept as they were. Modifiers are only lost if the effect/item that grants said modifier is lost.

Notes

This is potentially also the cause for MC-181604. Considering returning from the end is for most part just respawning.

Linked issues

MC-179831 Problem with the attribute command MC-179984 Respawning after modifying base max_health attribute leaves HP at 20 MC-180102 /Atrribute command bug MC-180128 attributes reseted after death or not applying MC-180147 command MC-180437 Attribute command isn't permanent MC-180517 Attributes are lost on death in 20w17a MC-181415 Attribute minecraft:generic.max_health resets everytime you die MC-183311 Attributes not retained after death MC-184526 Attributes applied to a player using the attribute command are reset upon death MC-191962 Attributes don't work after death MC-195046 attribute bug MC-195047 Attribute generic max health bug MC-197762 Player's max health doesn't render correctly right after respawning MC-245886 attribute change to players is not kept after respawn MC-267485 Armor Bars don't get displayed after death using the attribute generic.armor MC-267527 Players lose attributes after dying

Attachments

Comments

lapppy

Confirmed

lapppy

Affects version 20w18a.

migrated

Affects version 20w19a.

migrated

A small work around involves setting up a scoreboard command and some redstone-related geeks (I have already set that in place in my Hogwarts map, I'll release it Wednesday.) It's kinda hard to explain, but you could try something like for one command block.

 

Just warning you, cheats need to be enabled if you don't have them already...

 

But for now, here are the steps:

 

Steps to workaround:

  1. Create scoreboard: /scoreboard objectives add deaths deathCount

  2. One command block set to repeating and always active - do /execute if entity @a[scores={death=1..} in one.

  3. Place a comparator with the subtract torch further away from the repeating command block. (Do this on three sides).

  4. Place an impulse needs-redstone command block with the attribute command to reset the attribute command.

  5. Place a second command block with immediate regeneration for a specified time, or perhaps instant health.

  6. For the unused comaprator, place a few repeaters all set to max (no less than five), and place a command block to reset the deathCount score.

lapppy

Affects 1.16 Prerelease 1

migrated

affects generic.attack_damage

(1.16 pre-4)

Squid Eevee

Affects 1.16 Release Candidate 1 and affects all attributes, not just max health.

migrated

also in 1.16.1

as above, this is for all attributes, not just health!

migrated

Attribute minecraft:generic.movement_speed also resets when relogging.

_BOBE

Shouldn't the Mojang Priority be set to important?

SunCat

this is something Mojang decides

Avoma

Can confirm in 20w51a.

Avoma

Can confirm in 21w03a.

Avoma

Can confirm in 21w06a.

Avoma

Can confirm in 1.16.5 and 21w08b.

Avoma

Can confirm in 21w15a.

Avoma

Can confirm in 21w16a.

migrated

Confirmed in 1.17.

migrated

also they act really weird when coming back from the end... is it related to this ticket?

Avoma

Can confirm in 1.17.1. @unknown, that issue is MC-181604.

Avoma

Can confirm in 1.18.1.

Avoma

Can confirm in 1.18.2.

clamlol

Affects 22w19a.

Avoma

Can confirm in 1.19.

migrated

Can confirm in 1.19.3 and when using "modifier add"

migrated

Can confirm 1.20.1

TheUnknownOne

Can confirm, 1.20.3 Release Candidate 1

migrated

Seeing as this report has not been updated by the creator since it's creation (and has only created 1 other report in the last couple years, no other activity), and needs to be modified (affects all attributes, as already stated back in 2020!), I'd like to request ownership of this report.

migrated

Confirmed in 24w09a / 24w10a.

I tried "/attribute @s minecraft:generic.scale base set .25" you are now the 1/4 the size of normal players.

Died and size returns to default after death. would like not to have to type this every single time a player dies.

Immodial

Probably a controversial opinion given that this was reported as a bug, but I actually kinda like this? It's a lot easier having all the attributes be removed on death, since removing all attributes on death requires all their UUIDs/original bases, rather than just needing their values to restore them after the player respawns.

[Mod] turbo

Tommy Wallberg

Confirmed

Platform

Low

Commands

death, health

20w17a, 20w18a, 20w19a, 20w20b, 1.16 Release Candidate 1, ..., 23w51b, 24w07a, 24w09a, 1.20.5, 1.20.6

24w20a

Retrieved