How to make a String into an Object (Player)

Discussion in 'Plugin Development' started by jollie000l, Mar 4, 2014.

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

    jollie000l

    Hi,

    I'm trying to create a Chat Listener / Event, and I want the player to be able to ban someone when they chat. So if they type in: "ban Notch" it would ban Notch. But how can you get the player notch? Since when a player chats, it's a String, and I can't ban a String! So how can I turn this string into a player?

    Thanks
     
  2. Offline

    minecraft124_

    Use Bukkit.getPlayer(String) or Bukkit.getOfflinePlayer(String)
     
  3. Offline

    ImPhantom

    If this has been solved. I would recommend adding the solved tag.
     
Thread Status:
Not open for further replies.

Share This Page