Jump to content

Define itemID to a number


Recommended Posts

Posted

 

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).

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...