Solved Use UUIDs

Discussion in 'Spigot Plugin Development' started by MisterQuatsch, May 25, 2016.

  1. Hey,

    can i use a UUID without p.getUniqueId() or a UUIDFetcher?
    Becaus i want to use Bungeebridge the PacketMessagePlayer.
    So i use
    Code (Text):
    new PacketMessagePlayer(uuid, "Test").send();
    But how can i now take my uuid?
    I think something with UUID uuid = ?;
    But what do i need?

    Thanks for any help :)
     
    • Like Like x 1
  2. If your code needs a UUID to perform an action on a certain player, you need their UUID. If not you can use UUID.randomUUID() for a random UUID

    Sent from my SGH-I747M using Tapatalk
     
  3. Yea i have my uuid but i cant use it anywhere i the code? So where i must paste it and how?
    UUID: 01cba8c4ef9d4ff9aee35ba4bb38c3c8
     
  4. UUID#fromString(String) is what you're looking for

    Sent from my SGH-I747M using Tapatalk
     
    • Useful Useful x 1
  5. //EDIT
    Still get a Error:
    //EDIT 2
    My mistake: i forgot the "-"
    Code (Text):
    Caused by: java.lang.IllegalArgumentException: Invalid UUID string: 01cba8c4ef9d4ff9aee35ba4bb38c3c8
        at java.util.UUID.fromString(UUID.java:194) ~[?:1.8.0_91]
     
  6. You need the dashes in there still (-) for it to be valid.
     
  7. Yea i just sahw this post after i fixed it but sill thanks :D
     
  8. if your problem is now solved, you can mark this thread as "Solved".