#Custom Health with Armor.

1 messages ยท Page 1 of 1 (latest)

brave scaffold
#

hasitem={}?

flint palm
#

for example, they equip an iron helmet and it adds +20 HP, and if they un-equip it, it removes that HP

warm juniper
#

Use a BAC to accomplish that

#

Use query.equipment_count

empty moon
#

i have an idea

#
scoreboard objectives add hpPoints dummy
scoreboard players add @a hpPoints 0
scoreboard players add @a[hasitem={item=iron_helmet,location=slot.armor.head}] hpPoints 1
effect @a[scores={hpPoints=1}] health_boost 1 0 true

scoreboard players set * hpPoints 0
#

this will only work as a function

flint palm
#

I did find a way to do it actaully, but its very long lmao

#

leme show you what i came up with

empty moon
#

okay

flint palm
empty moon
#

it's okay too

flint palm
#

the (itemUse:) thing is a script that detects when u click the item

#

it works pretty well, the downside is, it wont work if they drag the armour on

last gorge
#

/scoreboard players add @a[hasitem={item=diamond_helmet,location=slot.armor.head}] Health 20```
flint palm
last gorge
flint palm
#

its just a one-time add

last gorge
#

its constant

#

replied to the wrong msg, my bad, but it isnt one time, u can have it running aconstantly

flint palm
#

not with how the health system works in my map

#

you got Health = your current HP

#

and then HealthCap

#

the max hp

last gorge
flint palm
#

bruh...

last gorge
#

that system is compatible with ur system

#

just adjust the max health in the commands, whats the problem, i dont understand

flint palm
#

tell me how what u wrote is gonna remove the HP as soon as they un-equip the armour

#

if you set max hp to 0

#

they gona die

#

over and over

last gorge
flint palm
#

๐Ÿ’€

last gorge
#

thatll set the current health to the max health if the current health exceeds the maximum

flint palm
#

ive already got that ๐Ÿ’€

#

did you not read the post

last gorge
#

then there isnt a problem and the other system i provided above would be perfectly suitable

flint palm
#

i needed a way to give temporary HP to a player upon equipping a specific armour and then remove ONLY that bit of HP from the max amount when they take the armour off

#

and i already figured out how I can do it on my own

flint palm
#

thats still not helpful

last gorge
#

1 universal command, and then 1 command per armour type

flint palm
#

im adding stats to my world too

#

so thatd remove all the stats they gained

last gorge
flint palm
#

unless i added another score for the health stats they gain

#

either way i aint changing it now

last gorge
#

bruh, why would u ever choose to use an in optimal system over a much more optimal one

flint palm
#

cause its hard to explain to you why that wont work out well

#

its not like you have any idea of the stuff thats going on in my world

last gorge
flint palm
#

true it can, but its still not easy to just explain