Skip to main content
added 10 characters in body
Source Link
Harth
  • 179
  • 5

I'm trying to run commands on the condition that the executing player is at full health. The problem is, in this datapack, a large chunkconsiderable amount of players will not have the default Max Health attribute of 20. It can range anywhere from 6 to 40, for example.

I've tried to run a function referencing the player's Attributes data, but the issue is that the player's total value of any given attribute, including the base value and any modifiers, isn't stored anywhere, so I can't figure out how to reference just the total value.

In summary, I need a way to find out if a player's current health is equal to their maximum possible health, including all attribute modifiers. Is there a way that I can do this?

I'm trying to run commands on the condition that the executing player is at full health. The problem is, in this datapack, a large chunk of players will not have the default Max Health attribute of 20. It can range anywhere from 6 to 40, for example.

I've tried to run a function referencing the player's Attributes data, but the issue is that the player's total value of any given attribute, including the base value and any modifiers, isn't stored anywhere, so I can't figure out how to reference just the total value.

In summary, I need a way to find out if a player's current health is equal to their maximum possible health, including all attribute modifiers. Is there a way that I can do this?

I'm trying to run commands on the condition that the executing player is at full health. The problem is, in this datapack, a considerable amount of players will not have the default Max Health attribute of 20. It can range anywhere from 6 to 40, for example.

I've tried to run a function referencing the player's Attributes data, but the issue is that the player's total value of any given attribute, including the base value and any modifiers, isn't stored anywhere, so I can't figure out how to reference just the total value.

In summary, I need a way to find out if a player's current health is equal to their maximum possible health, including all attribute modifiers. Is there a way that I can do this?

Source Link
Harth
  • 179
  • 5

In Minecraft, is there a way to test if a player is at maximum health, regardless of their Max Health attribute?

I'm trying to run commands on the condition that the executing player is at full health. The problem is, in this datapack, a large chunk of players will not have the default Max Health attribute of 20. It can range anywhere from 6 to 40, for example.

I've tried to run a function referencing the player's Attributes data, but the issue is that the player's total value of any given attribute, including the base value and any modifiers, isn't stored anywhere, so I can't figure out how to reference just the total value.

In summary, I need a way to find out if a player's current health is equal to their maximum possible health, including all attribute modifiers. Is there a way that I can do this?