Solved Detecting Villager trade event

Discussion in 'Plugin Development' started by TwistedMexi, Oct 8, 2012.

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

    TwistedMexi

    Has anyone figured out how to detect these events yet? I need to detect when a trade window is opened, and preferably when a user attempts to put an item in the sell block. All I've been able to find so far is replacing villager entities.
     
  2. Offline

    Deleted user

    Excuse me if I'm wrong however.. would PlayerInteractEvent not work? :)
     
  3. Offline

    ZeusAllMighty11

    Actually it wouldn't, because all that would do is allow the user to cancel trading at all...



    What you want is InventoryClickEvent
     
    TwistedMexi likes this.
  4. Offline

    Deleted user

    Well it depends on what he's wanting to do, my method could work in some scenarios.
     
  5. Offline

    ZeusAllMighty11





     
  6. Offline

    TwistedMexi

    Not to pick a side, but yes InventoryClickEvent is what I needed in this instance, and then checked for type of MERCHANT on the click event's RawSlot.

    The goal here was to disable trading of written books if a special character was in the title (brought on by another part of my plug-in that in any other case would allow duping of emeralds) I've got it sorted out with these tips and some help from others, thanks to you both.
     
  7. Offline

    Deleted user

    I didn't full read his post :p
     
Thread Status:
Not open for further replies.

Share This Page