1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Durability not working

Discussion in 'Skript' started by SoMuchWessel, Jun 9, 2019.

Tags:
Thread Status:
Not open for further replies.
  1. SoMuchWessel

    SoMuchWessel Active Member

    Joined:
    Apr 3, 2017
    Messages:
    147
    Likes Received:
    2
    Hey guys,

    I have a problem with removing durability from items.

    I have tried multiple things like:
    Code (Text):
    1. add 1 to the data value of held item
    Code (Text):
    1. set held item's durability to (held item's durability - 1)
    Code (Text):
    1. 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?
     
  2. BowYard

    BowYard Member

    Joined:
    Nov 2, 2017
    Messages:
    45
    Likes Received:
    0
    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
     
  3. SoMuchWessel

    SoMuchWessel Active Member

    Joined:
    Apr 3, 2017
    Messages:
    147
    Likes Received:
    2
    When i use
    Code (Text):
    1. Remove 2 from the data value of player's tool
    It will get this result:
    Before mining: 270:0
    After mining: 270:-4
     
  4. BowYard

    BowYard Member

    Joined:
    Nov 2, 2017
    Messages:
    45
    Likes Received:
    0
    Test
    Remove 2 from Player's held item's durability
     
  5. SoMuchWessel

    SoMuchWessel Active Member

    Joined:
    Apr 3, 2017
    Messages:
    147
    Likes Received:
    2
    Before: 270:0
    After: 270:-4
     
  6. BowYard

    BowYard Member

    Joined:
    Nov 2, 2017
    Messages:
    45
    Likes Received:
    0
    And what should be the output like?
     
  7. SoMuchWessel

    SoMuchWessel Active Member

    Joined:
    Apr 3, 2017
    Messages:
    147
    Likes Received:
    2
    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
     
  8. BowYard

    BowYard Member

    Joined:
    Nov 2, 2017
    Messages:
    45
    Likes Received:
    0
    I think the problem is that when you mine:
    ordinary decrease + added decrease
    So you have to test and change the numbers
     
  9. SoMuchWessel

    SoMuchWessel Active Member

    Joined:
    Apr 3, 2017
    Messages:
    147
    Likes Received:
    2
    How do you mean?
     
  10. BowYard

    BowYard Member

    Joined:
    Nov 2, 2017
    Messages:
    45
    Likes Received:
    0
    When you mine there is a default decrement of the durability.. so if you add +(-2), it would be default decrement +(-2)
     
  11. SoMuchWessel

    SoMuchWessel Active Member

    Joined:
    Apr 3, 2017
    Messages:
    147
    Likes Received:
    2
    i tried it with a command:

    Code (Text):
    1. command /test:
    2.     trigger:
    3.         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..
     
Thread Status:
Not open for further replies.

Share This Page

Loading...