Solved Add something to a hashmap in another class

Discussion in 'Plugin Development' started by jumbledProgram, Aug 23, 2020.

Thread Status:
Not open for further replies.
  1. i have a hashmap called infected in class a, and i want to add something to it in class b, how would i go about doing this?
     
  2. Online

    timtower Administrator Administrator Moderator

  3. How would i go about doing this?
     
  4. Online

    timtower Administrator Administrator Moderator

  5. How could i see if a value is on the hashmap? I have a player variable and i want to see if its on the hashmap
     
  6. Offline

    Strahan

    If you are looking for if they exist as a key, it's hashMapVariable.containsKey(playerVariable). If they are just in the map as a value, containsValue. As to what specifically to put, it depends on your map.
     
  7. Is there a way i can test if and certain key, say the variable i, has a certain value, say, the variable target?
     
  8. Online

    timtower Administrator Administrator Moderator

    You can get the value and compare it.
     
Thread Status:
Not open for further replies.

Share This Page