Help regarding item id

Discussion in 'Plugin Development' started by BlueMond416, Jun 26, 2012.

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

    BlueMond416

    I am making a plugin and am wondering if every item has it's own id. I'm not talking about the id that classifies which item is which. For example: Bob has a diamond pickaxe but Bob Jr. also has a diamond pickaxe. Bob's diamond pickaxe's special id = 0 Bob Jr.'s diamond pickaxe's special id = 1

    Edit: If so how does one get that id?
     
  2. Offline

    MrDent009

    That sounds like an interesting plugin. But I think there would be a problem when a player discards a 'special id item' from their inventory and gives it to someone else.

    I am not sure how you would do the coding for this plugin either. I'll have my friend take a look at this.

    Sorry I couldn't help you.
     
  3. Offline

    Jeff.Halbert

    you would have to listen to everything that ever enters and leaves every players inventory and save/delete them from storage. best way to store em would be in a database. when you save em to storage, give it a unique id, and when you delete on discard or death, delete the item that has that id from the database.

    (edit) i have to say though, that's going to be a VERY complicated database, not as easy as save item, delete item. what happens when a player has 10 stacks of logs? thats 640 records! how do you know which record to delete when the player places the item?
     
  4. Offline

    monster860

    Only maps have that sort of ID, and you do it through ItemStack.getDamage().
     
  5. I think you also forgot wool, log, dye, wooden plank, steps, stair
     
Thread Status:
Not open for further replies.

Share This Page