#(JustinS) Set health

47 messages · Page 1 of 1 (latest)

stuck vigil
#

How do I set the player's health to x?

meager nimbusBOT
#

(JustinS) Set health

meager nimbusBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

left tapir
#

!m health

thorn frostBOT
# left tapir !m health
Cannot Specify Searched Mechanism

Multiple possible mechanisms: EntityTag.health, EntityTag.max_health, PlayerTag.fake_health, EntityTag.health_data, PlayerTag.health_scale, PlayerTag.scale_health, EntityTag.absorption_health, PlayerTag.fake_mount_health, PlayerTag.fake_entity_health, PlayerTag.fake_absorption_health.

#
Possible Confusion

Did you mean to search for command health?

left tapir
#

!m entitytag.health

thorn frostBOT
# left tapir !m entitytag.health

Sets the amount of health the entity has.
The entity must be living.

Object

EntityTag

Input

ElementTag(Decimal)

Tags

<EntityTag.health> Returns the current health of the entity.
<EntityTag.health_max> Returns the maximum health of the entity.

left tapir
#

if you want to change the maximum health of the player then you can use the health command

stuck vigil
# thorn frost

I get that but how do you change the health in a script, like this?

  • <player.health> = <[goal]>
#

When I do that, the player.health part gets underlined red

burnt tundra
#

!c adjust

thorn frostBOT
# burnt tundra !c adjust
Group

core

Syntax

adjust [<ObjectTag>/def:<name>|...] [<mechanism>](:<value>)

Short Description

Adjusts an object's mechanism.

Description

Many object tag types contains options and properties that need to be adjusted.
Denizen employs a mechanism interface to deal with those adjustments.
To easily accomplish this, use this command with a valid object mechanism, and sometimes accompanying value.

Specify "def:<name>" as an input to adjust a definition and automatically save the result back to the definition.

You can optionally adjust a MapTag of mechanisms to values.

To adjust an item in an inventory, use !command inventory...

burnt tundra
#

!guide

thorn frostBOT
left tapir
stuck vigil
#

👌 awesome, thanks!

left tapir
#

you need to adjust

#

i know penguin already brought up the guide, but i'm going to bring up a specific section on how the adjust command works

#

!guide the adjust command

stuck vigil
#

Hm it doesn't seem to be working. The narrate works alright, but the health doesn't get set to the goal
- adjust <player.health> <[goal]>

left tapir
#

<player.health> is a tag

#

health is the mechanism name

#

here is an example of an adjust command usage (taken from the meta):

- adjust <server.online_players> skin:Notch
#

<server.online_players> is the object being adjusted

#

skin is the mechanism

#

Notch is the new value

#

so now all the players online will have the skin of Notch

#

you can do the same with player health

stuck vigil
#

ah

#

so would it be something like - adjust <player>health:<[goal]>?

left tapir
#

almost

#

make sure there is a space between <player> and health

stuck vigil
#

Ah alight

#

Got it working, thanks!