Solved Get Player's inventory, the one from E key

Discussion in 'Plugin Development' started by paully104, May 8, 2014.

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

    paully104

    Having an issue figuring out what inventory the e key one is. In my plugin im in a custom inventory thats going to send items to the players default inventory. When i try to do events to listen to the default inventory opening nothing triggers. Is the e key backpack not able to trigger events?
     
  2. Offline

    Zethariel

    Bukkit.getPlayer(player).getInventory
     
  3. Offline

    paully104

    Found the source of my error, however im still working on resolving it. In my class i'm basically grabbing the metadata of an item which is set to the players name and converting that to a string then converting that string to a Player. When I input it into Bukkit.getPlayer(insertdata) it is returning null. The value of the string is paully104 to start. Any idea of how to go about this?

    Nevermind turns out when i was transferring the metadata i forgot to grab the display names and thats why everything wasn't working lol. Changed to solved!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
  4. Offline

    Zethariel

    If it returns null, that usually means that the player isn't there. If you're looking to check for even offline players, use Bukkit.getOfflinePlayer(name);
     
Thread Status:
Not open for further replies.

Share This Page