Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Method to get the current durability?
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
Dr.Nickenstein

Method to get the current durability?

By Dr.Nickenstein, January 23 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

Dr.Nickenstein    0

Dr.Nickenstein

Dr.Nickenstein    0

  • Stone Miner
  • Dr.Nickenstein
  • Members
  • 0
  • 74 posts
Posted January 23

I want to get the current durability of an item, what is the method for it?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7695

diesieben07

diesieben07    7695

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7695
  • 56361 posts
Posted January 23

ItemStack#getDamage

  • Quote

Share this post


Link to post
Share on other sites

Dr.Nickenstein    0

Dr.Nickenstein

Dr.Nickenstein    0

  • Stone Miner
  • Dr.Nickenstein
  • Members
  • 0
  • 74 posts
Posted January 23
20 minutes ago, diesieben07 said:

ItemStack#getDamage

Thank you so much!

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2414

Draco18s

Draco18s    2414

  • Reality Controller
  • Draco18s
  • Members
  • 2414
  • 15995 posts
Posted January 23 (edited)

Note that it counts up towards ItemStack#getMaxDamage, so an undamaged item will return 0 out of X and a fully damaged item will be X out of X (next use breaks it).

Edited January 23 by Draco18s
  • Quote

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • samjviana
      [1.16.5] How to make EnchantedBook go to Custom ItemGroup

      By samjviana · Posted 25 minutes ago

      I making some custom emchantment, and would like them to show up on an Custom ItemGroup, but i don't know where to start, i tried looking into some classes and did some google about it, but can't find anything usefull.
    • ESCCarp
      Forge says this file does not have an app associated with it.

      By ESCCarp · Posted 1 hour ago

      i do  
    • LexManos
      forge a jar file not exe

      By LexManos · Posted 1 hour ago

      Some zip managers like to take control of the .jar file extension away from Java. Make sure you have Java installed and try running Jarfix once, then try the installer again.   Also, 1.12 is out of support, update.
    • Modder31
      forge a jar file not exe

      By Modder31 · Posted 1 hour ago

      i am unable to install jar files only exe files i would ask if you could change all the files to exe files, like the older versions i want the most recent version of 1.12.2 for a certain mod but cant cause its a jar file
    • diesieben07
      Forge says this file does not have an app associated with it.

      By diesieben07 · Posted 2 hours ago

      Make sure you have Java installed.
  • Topics

    • samjviana
      0
      [1.16.5] How to make EnchantedBook go to Custom ItemGroup

      By samjviana
      Started 25 minutes ago

    • ESCCarp
      2
      Forge says this file does not have an app associated with it.

      By ESCCarp
      Started 2 hours ago

    • Modder31
      1
      forge a jar file not exe

      By Modder31
      Started 1 hour ago

    • JaydenB14
      1
      Minecraft Unexpected error on 1.7.10 forge modded

      By JaydenB14
      Started 3 hours ago

    • Molotove_
      1
      Problem adding RAM to a Forge Server

      By Molotove_
      Started 4 hours ago

  • Who's Online (See full list)

    • redlynx
    • hammy3502
    • Ababoude
    • ReaperMF
    • samjviana
    • qSided
    • Syconn
    • Talp1
    • pomalley10
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Method to get the current durability?
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community