[1.6.4] Get Item ID

Discussion in 'Plugin Development' started by davidp027, Nov 19, 2014.

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

    davidp027

    I've been using this method because I can't find the right way to get items id's and the way I do it now is deprecated so I was wondering what's the right way to do it. Here's what i'm using now wich stops working sometimes[...]:
    Code:java
    1. Integer invitemid = (int)e.getPlayer().getItemInHand().getTypeId();
    2. Integer invitemdata = (int)e.getPlayer().getItemInHand().getDurability();
    3. String invitem = invitemid + ":" + invitemdata;
    4.  
     
  2. Offline

    Skionz

    davidp027 Its deprecated because there is no such thing as item id's for 1.8. Bukkit isn't updating any time soon so it should be fine although if you really want to use ids you could hardcode a list of materials and their item ids or something similar to that.
     
  3. Offline

    davidp027

    Oh I won't do that as my plugin is for a FeedTheBeast server and I would have to make a list of 16744 items xD
     
  4. Offline

    Skionz

    Ah well I don't really think it matters if it is deprecated since Bukkit isn't updating any time soon.
     
Thread Status:
Not open for further replies.

Share This Page