Custom Getter (UUID)

Discussion in 'BungeeCord Plugin Development' started by LarexPvP, Apr 30, 2017.

  1. Hey guys, how do u code a custom uuid getter?
    i just have:

    public void getUUID(Player p){
    p.getUniqueID;
    }

    pls help
     
  2. This declares the method with the name getUUID and one parameter of type Player. The 'void' means that the method will not return anything; you need to change that to 'UUID' (because you want the method to return the UUID of the specified player).
    Ok, two things:
    1. Player#getUniqueId() is a method, not a field, so you will need to add parentheses to make this a method call (i.e. 'p.getUniqueId();')
    2. You will need to add a return statement before this part, since this is the value that you want to return.
    Also, I assume that you're just making this method to learn java... otherwise, it's kind of redundant ;)
    I would really recommend learning some basic java before trying to code a plugin.