#Why doesnt this work if my tool is damaged?

1 messages · Page 1 of 1 (latest)

civic quail
#

because it's a direct item comparison

#

need to check everything separately

#

or use an nbt tag

primal citrus
#

It will also work if you just check the name and not the item itself

#

If you can assure this will be the only item with that name

#

But nbt better

regal grotto
crisp ice
low niche
#

soo you want this to work if your tool is damaged?? you mean durbaily low?

low niche
#

probally like this

#
    loop all players:
        if loop-player's held item is a netherite sword named "&6Life Sword":
            if durability of loop-player's tool is not max durability of loop-player's tool:
                apply strength 2 to loop-player for 0.5 seconds```
regal grotto
#

hey i did it

#

I fixed it

nimble stag
#

Just adjust the damage event instead of doing this loop shit

regal grotto
#

Nah imma close this i fixed it

nimble stag
#

So like x2 damage

On damage:
If players tool = x:
Make attacker damage victim by x hearts or damage em twice

nimble stag
low niche
#

@civic quail why u react skull emji

civic quail
#

because he wanted to make the code work regardless of durability

low niche
#

ohh]

regal grotto
#

yeh

#

i did it tho

#

ill send the working code

#
    loop all players:
        set {_item} to loop-player's held item
        if {_item} is set:
            if name of {_item} is "&6Life Sword":
                apply strength 2 to loop-player for 10 ticks```
nimble stag
#

Imagine having 5 people on a server like that and the tps being at like 10

regal grotto
#

fr

regal grotto
civic quail
#

tps isn't gonna drop from a 10 tick periodical

#

not unless you're doing some serious looping/calculations

#

still better to just use attributes/mess with on damage for that kind of thing, but they aren't the end of the world

nimble stag
#

in my experiance (I might have been doing something wrong) with wanting an expandable server you never really want to loop all players like that every 10 ticks

civic quail
#

only time i ever do it is for an actionbar

low niche
#

action bar pmo

nimble stag
#

I dont loop every player for an action bar I more do while player is online for it but then its case by case i guess

crisp ice
#

cause can't you just do if attack'ers too lis a netherite sword named this that

#

and then apply the damage

#

correct me if im wrong btw never played around with it

regal grotto