How to convert/parse String to a Player?

Discussion in 'Plugin Development' started by 1jmw11, Apr 24, 2014.

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

    1jmw11

    I am trying to take a part of a string from an items lore as to convert it into a player as for more or less storage.

    It works kind of like this:
    1. Player A runs command to receive Item B with lore with Player A's name and/or UUID
    2. Player C runs command to receive Item B with lore with Player C's name and/or UUID
    3. Player A uses Item B to store items or see their stats or something player specific
    4. Player C takes Player A's Item B and uses it to access the stuff specific to Player A
    As to make it less confusing suppose that the player specific thing is an ender chest for example.
     
  2. Offline

    BillyBobJoe168

    Well, to convert a string to a player, do getServer().getPlayer(stirngname); For your items, you could just set the lore in the command (I think?) with the player name. Also, for the clicking the item part, for the lore, just make a for loop that loops through all online players. Inside this loop, just check if the lore contains the online player. If so, just show that online player's stats.
     
Thread Status:
Not open for further replies.

Share This Page