Solved Villager Interact Packet?

Discussion in 'Spigot Plugin Development' started by Cerus, Jun 8, 2018.

  1. Hey,
    Although I cancelled the InteractEvent at a Villager, the TradeInventory always opens. So my question is, if there is a packet for that, which I could retrieve.
    Thanks for your help!
     
  2. Try using the PlayerInteractEntityEvent instead of the PlayerInteractAtEntityEvent if that is the case currently.
     
    • Friendly Friendly x 1
  3. Code (Java):
    @EventHandler
    public void onPlayerInteractEntity(PlayerInteractEntityEvent e) {
        if (e.getRightClicked().getType() == EntityType.VILLAGER) {
            e.setCancelled(true);
        }
    }
    This is working fine for me.
     
    • Useful Useful x 1
  4. I dont think that would be right ^^
    Yep, it worked! Thank you mate. I used the PlayerInteractAtEntityEvent, I dont know why it didnt worked :D
    Thanks for your answers.

    Solved!