#(Niklas) adjust <player.item_in_hand> durability -1
63 messages · Page 1 of 1 (latest)
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.
- adjust <player.item_in_hand> durability:<player.item_in_hand.durability.sub[1]>```
does that not work
what item are you holding
iron_pickaxe
i@iron_pickaxe[display=Stollenschürfer;custom_model_data=1;script=stollenschurfer]
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
!g adjust is not for items
Did you mean to search for common mistakes - the adjust command is not for items/materials/etc.?
View the guide page 'Common Mistakes - The Adjust Command Is Not For Items/Materials/Etc.' at: https://guide.denizenscript.com/guides/troubleshooting/common-mistakes.html#the-adjust-command-is-not-for-items-materials-etc
😦
Ok this is way more complicated
And I have absolutely no clue how to do that...
!m durability
Changes the durability of damageable items.
ItemTag
ElementTag(Number)
<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...
in the example it also uses an adjust?
I'm gonna smash my head against the table xD
dont skim for examples
read the text
I didnt
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
inventory adjust
perfect
but how can I now check in which slot the item is
its in the players item in hand right?
yeah
or can I do *inventory adjust slot:hand durability:<player.item_in_hand.durability.sub[1]>
so can just do slot:hand
ah ok
!lang inventory slot
Did you mean to search for inventory script containers?
!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.
Useful Lists
ok
so inventory adjust slot:hand
but how can I know adjust the durability
and sub 1 from the durability it has now
you already have the correct tag
you have to add 1 to damage the tool
!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.