Solved How to get UUID from command

Discussion in 'Plugin Development' started by kampai, Jul 1, 2016.

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

    kampai

    I have a hashmap, that stores a integer and a uuid, the hashmap is called diamonds.
    When I do diamonds.get(player.getUniqueID())) { on a commandsender, it does not work.
    I can an error
     
  2. Offline

    Jakeeeee

    If it stores <Integer, UUID>, you're saying a uuid is an integer, which it is not an integer. Also show the code so we can help you further.

    Hint: <Key, Value>
     
  3. Offline

    kampai

    @Jakeeeee
    Alright sorry, this is the line where i get an error from.
    And then this is the hashmap
     
    Last edited: Jul 1, 2016
  4. Offline

    Jakeeeee

    Can you please show us the whole entire class? What is 'oredata' is it a class? Did you define it properly?
     
  5. Offline

    kampai

    Last edited: Jul 1, 2016
  6. Offline

    Jakeeeee

    You never defined the class 'OreData' so of course it will throw a NullPointerException. When the onEnable function is tiggered, register(define) the class (OreData).
     
  7. Offline

    kampai

    @Jakeeeee
    I thought I did on this line
    Code:
            Bukkit.getServer().getPluginManager().registerEvents(new OreData(), this);
    
     
  8. Offline

    Jakeeeee

    All that line did was basically tell the server that there is an event in there.
    This make be helpful, look at the very beginning. Here
     
  9. Offline

    kampai

    Okay so I see now, thanks, now when I'm getting the data using /ores instead of telling me the current value of the hashmap it just tells me null

    EDIT: NEVERMIND I FIXED IT THANKS!
     
Thread Status:
Not open for further replies.

Share This Page