Get Item Name From ID

Discussion in 'Plugin Development' started by xXxAdmanxXx, Jul 19, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    xXxAdmanxXx

    Hello,

    I'm currently developing, along with my friend, our first plugin. We wanted to add an extra few features before release. I was wondering if there was a way we can get an item name from an ID stored in... lets say... String MyItemName. Is there any way we can get the ID from MyItemName and output with the name of that ID?

    Thanks for all your help!
    ~Ad-man
     
  2. Offline

    Acrobot

    Material.getMaterial(MyItemName).getId()
    or, if your item name isn't full item name:
    Material.matchMaterial(MyItemName).getId()
     
    mrZcr4fter likes this.
  3. Offline

    xXxAdmanxXx

    Thanks man, that's a big help :D
     
Thread Status:
Not open for further replies.

Share This Page