Durability not working

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

SoMuchWessel

Active Member
Apr 3, 2017
147
3
18
46
Hey guys,

I have a problem with removing durability from items.

I have tried multiple things like:
Code:
add 1 to the data value of held item
Code:
set held item's durability to (held item's durability - 1)
Code:
remove 1 from held item's durability

But none of those seems to work like i want it.
I want that if you mine stone, it will remove 2 durability from the pickaxe instead of 1.

Can you guys help?
 
Use player's tool instead of held item
So test
Remove 2 from the data value of player's tool

Uhm and if you want to use held item test
Player's held item's durability
Not held item's durability
You have to specifiy who is the helder of the item
 
Use player's tool instead of held item
So test
Remove 2 from the data value of player's tool

Uhm and if you want to use held item test
Player's held item's durability
Not held item's durability
You have to specifiy who is the helder of the item

When i use
Code:
Remove 2 from the data value of player's tool

It will get this result:
Before mining: 270:0
After mining: 270:-4
 
Before: 270:0
After: 270:1
(Like how it is with vanilla minecraft mechanics)

And then if i change the 1 to the 2, it will be:
Before: 270:0
After: 270:2
I think the problem is that when you mine:
ordinary decrease + added decrease
So you have to test and change the numbers
 
When you mine there is a default decrement of the durability.. so if you add +(-2), it would be default decrement +(-2)

i tried it with a command:

Code:
command /test:
    trigger:
        add 1 to player's held item's durability

And this seems to work...
But now it the question how i will do it when you mine a stone..
 
Status
Not open for further replies.