Error on open inventory, nothing shows up

Discussion in 'Plugin Development' started by lucasdidur, Sep 5, 2012.

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

    lucasdidur

    I tried to do this, but nothing happening.

    Code:
    Inventory i = plugin.getServer().createInventory(player, InventoryType.MERCHANT);
    player.openInventory(i);
    

    What I did wrong?
     
  2. createInventory asks for an inventory holder.
    This refers to the owner of the inventory that will be created.

    Too bad players are not merchants. You need to pass a mob that is a merchant.
    One of those NPCs. I think that's easier said than done.
     
  3. Offline

    Firefly

    This may help you, I'm not sure though.

    From the javadocs:

    owner - The holder of the inventory; can be null if there's no holder.
     
  4. Offline

    lucasdidur

    So I can't create a Merchant GUI with command? Only with Villager?
     
  5. Offline

    Firefly

    Maybe, maybe not: try setting the inventory holder to null or a Villager object you have defined previously.
     
Thread Status:
Not open for further replies.

Share This Page