Villager Trade Menu

Discussion in 'Plugin Development' started by Elimnator, Nov 19, 2014.

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

    Elimnator

    How do I open a villagers trade menu via code?
     
  2. Offline

    mine-care

    I don't think there is a vilager trade inventory implementation in bukkit, but NMS does miracles :) sorry but I am not working spwith nms so I cannot help you a lot D: but the geniuses from protocol lib might be able to help =]
     
  3. Offline

    jeussa

    Try this:

    Code:java
    1.  
    2.  
    3. public static MerchantInventory createNewMerchantInventory(Player p){
    4. InventoryMerchant im = new InventoryMerchant((EntityHuman)p, null);
    5. CraftInventoryMerchant cim = new CraftInventoryMerchant(im);
    6. MerchantInventory mi = cim;
    7. return mi;
    8. }


    I'm not entirely sure if it works tho as I've never had to work with them. Remember to import a craftbukkit or spigot file into your workspace, using just the bukkit API will not work!
     
  4. Offline

    Elimnator

    jeussa
    I don't want to create n new one, I just want to open a villagers trade.

    Bump

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

    Skionz

    If I can remember correctly Funergy did this but it requires a lot of NMS knowledge.
     
  6. Offline

    pookeythekid

    Wait a minute... so you're saying building off of CraftBukkit allows you to do more than building off of Bukkit? Then... what's the point in the API-dedicated file and a file that works as both a server and API? A short while ago I switched from using craftbukkit.jar to using bukkit.jar because I heard it was bad to build off of CB (and I wasn't too sure about the legal stuff, but turns out plugins should be GPL either way in order not to break licenses; but too late for that).

    Elimnator Not to be a wannabe-moderator, but you're only supposed to bump your post every 24 hours.

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

    Elimnator

    Please only post here if you have info on the topic, thanks.
     
  8. Offline

    Funergy

    Skionz likes this.
Thread Status:
Not open for further replies.

Share This Page