Issue With Villager Trade

Discussion in 'Plugin Development' started by microgeek, Feb 9, 2013.

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

    microgeek

    I've been trying to make use of Villager trading to make some fort of banking/barter plugin, but have ran into an odd issue. I can get the trade to display fine(and set trades), but after completing the trade, the item that the user receives is a "ghost item" and will disappear when right clicked. I've done some debugging, and the click in the trading window is never registered in InventoryClickEvent, until you close the window(very odd).
    Not 100% my code, but this is the method that I'm using:
    http://pastebin.com/80e38yRt
    If anyone has a solution, help would be greatly appreciated.
     
  2. Offline

    Stuu

    By not 100%, how much is your code?
     
  3. Offline

    microgeek

    Building the Packet250 was not mine, but I've looked into the protocol, and everything seems to be fine.
     
  4. Offline

    Hoolean

    Looks like the code just fakes an inventory window to the player's client; it looks a bit outdated, there's probably a better way :/
     
  5. Offline

    microgeek

    I was hoping that there was an Api call somewhere, but I can't find anything. Oh well.
     
  6. Offline

    Hoolean

    microgeek likes this.
  7. Offline

    microgeek

    I guess I was going about the wrong way of doing things. Thanks for the links.

    Got it working. I just spawned a Villager, set the trade, started the trade, and removed it.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
    MrBluebear3 likes this.
  8. Offline

    Hoolean

    Great :)
     
  9. Offline

    Cybermaxke

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

Share This Page