May 22, 20187 yr How can i define an item id to a number? I want to say itemId(991) = 12345; So that i can check to see if my inventory contains itemId(991) and if it does then it will add 12345 to an integer.
May 22, 20187 yr Are you asking for item id to go up or another integer? anyways could do this, basically if inventory has itemid 991 will add +1 to value so new value be 124 public int value = 123; if(getInventory().contains(991)) { value += 1; }
May 22, 20187 yr 2 hours ago, shaba123 said: How can i define an item id to a number? I want to say itemId(991) = 12345; So that i can check to see if my inventory contains itemId(991) and if it does then it will add 12345 to an integer. Like I said in the other topic you made, use a HashMap, you can use a HashMap for item IDs too. 2 hours ago, d0zza said: https://docs.oracle.com/javase/8/docs/api/java/util/HashMap.html A HashMap will allow you to link an item or String (item name) to a particular integer (item value).
Create an account or sign in to comment