Create a "Fake" Chest

Discussion in 'Plugin Development' started by AussieBacom, May 12, 2012.

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


    I'm having a huge brain fart today and I can't figure out how to make a fake chest.

    So far I have this code:
    1. Block block = event.getClickedBlock();
    2. Chest chest = (Chest)/* Locationofchest.getBlock().getState()*/;
    3. player.openInventory(chest.getInventory());

    That allows me to open another chest from a location by clicking on a block in the PlayerInteractEvent,
    but I want to be able to create a temporary chest to say and open its inventory.

  2. Code:java
    1. Inventory inventory = plugin.getServer().createInventory(null, 54, "Temp inv");
    2. player.openInventory(inventory);

Thread Status:
Not open for further replies.

Share This Page