[SOLVED] Displaying a chest inventory to a player.

Discussion in 'Plugin Development' started by DrAgonmoray, Mar 4, 2012.

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

    DrAgonmoray

    It seems my (the) old way of doing it doesn't work anymore.
    I used to do it like this:
    PHP:
    ((CraftPlayerplayer).getHandle().a(CHEST HERE)
    Now that no longer works, for reasons I don't know.

    Could anybody help me out? Maybe bergerkiller

    Nevermind. I gotz it.
    Code:
    ((CraftPlayer) player).getHandle().openContainer(CHEST HERE)
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2016
  2. Offline

    Darkman2412

    Bukkit has a new method that can do this :)
    Code:
    Player player;
    Chest chest;
    player.showInventory(chest.getInventory());
     
    mrZcr4fter likes this.
  3. Offline

    DrAgonmoray

    neat. :O
     
    mrZcr4fter and Darkman2412 like this.
  4. For reference, the method is now
    player.openInventory(chest.getInventory());

    Sorry to bump an old thread! :)
     
Thread Status:
Not open for further replies.

Share This Page