#(Niklas) adjust <player.item_in_hand> durability -1

63 messages · Page 1 of 1 (latest)

plain anvil
#

how could I do that

drifting tulipBOT
#

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.

plain anvil
#
            - adjust <player.item_in_hand> durability:<player.item_in_hand.durability.sub[1]>```
round fern
#

does that not work

plain anvil
#

nope

#

also /ex narrate <player.item_in_hand.durability> is "0"

round fern
#

what item are you holding

plain anvil
#

iron_pickaxe

#

i@iron_pickaxe[display=Stollenschürfer;custom_model_data=1;script=stollenschurfer]

round fern
#

OOOH

#

suddenly remembered that durability is actually reversed in code

#

so if you want to decrease the item's durability, you have to increase it in code, and vice versa

#

so if it's full durability it'll show 0

split kite
#

!g adjust is not for items

wary stirrupBOT
#
Possible Confusion

Did you mean to search for common mistakes - the adjust command is not for items/materials/etc.?

plain anvil
#

😦

#

Ok this is way more complicated

#

And I have absolutely no clue how to do that...

#

!m durability

wary stirrupBOT
# plain anvil !m durability

Changes the durability of damageable items.

Object

ItemTag

Input

ElementTag(Number)

Tags

<ItemTag.durability> Returns the current durability (number of uses) on the item.
<ItemTag.max_durability> Returns the maximum durability (number of uses) of this item. For use wit...
<ItemTag.repairable> Returns whether the item can be repaired. If this returns true, it will enabl...

plain anvil
#

in the example it also uses an adjust?

plain anvil
#

I'm gonna smash my head against the table xD

zenith crag
#

You did this before

#

not the table but using mechanisms

zenith crag
#

read the text

plain anvil
zenith crag
#

Here you're using mechanisms

plain anvil
#

yeah

#

but not with items

#

and durability

zenith crag
#

here youre using also mechanisms

#

with adjustblock

#

so for existing items, you have to use a different command

#

and this is explained on the guide page we linked you

plain anvil
#

inventory adjust

zenith crag
#

perfect

plain anvil
#

but how can I now check in which slot the item is

zenith crag
#

its in the players item in hand right?

plain anvil
#

yeah

#

or can I do *inventory adjust slot:hand durability:<player.item_in_hand.durability.sub[1]>

zenith crag
#

so can just do slot:hand

plain anvil
#

ah ok

zenith crag
#

!lang inventory slot

wary stirrupBOT
#
Possible Confusion

Did you mean to search for inventory script containers?

zenith crag
#

!lang slot

wary stirrupBOT
# zenith crag !lang slot

Whenever a script component requires a slot ID (such as the take command, when using '- take slot:#')
you can give the slot ID input as either a number of the 1-based index (where the first slot is 1, the second is 2, etc.)
If the slot given is 'hand', for a player the held item slot will be used, for any other entity the slot will be 1.
OR you can give the following names (valid for player inventories only):
BOOTS: equivalent to 37
LEGGINGS: equivalent to 38
CHESTPLATE: equivalent to 39
HELMET: equivalent to 40
OFFHAND: equivalent to 41

Note that some common alternate spellings may be automatically accepted as well.

Group

Useful Lists

plain anvil
#

ok

#

so inventory adjust slot:hand

#

but how can I know adjust the durability

#

and sub 1 from the durability it has now

zenith crag
#

you have to add 1 to damage the tool

wary stirrupBOT
# zenith crag !rule 8
Rule 8

Don't overuse the edit/delete buttons. https://denizenscript.com/discord_rules#rule8
Use the edit button to fix typos, and the delete button to remove an accidental post shortly after posting.
Do not remove a post that pings someone, do not edit or delete a post that people have already replied to.

plain anvil
#

ok. and how can I now make that if the durability is below 1 the item breaks?

#

nwm