PlayerInteractEvent - A solution or impossible?

Discussion in 'Plugin Development' started by 0ct0berBkkitPlgins, Mar 16, 2018.

Thread Status:
Not open for further replies.
  1. PlayerInteractEvent doesn't seem to fire when right-clicking air with nothing in your hand. The javadoc states: "This event will fire as cancelled if the vanilla behavior is to do nothing (e.g interacting with air)", but it doesn't seem to fire at all in this case. I've heard that this might be a Bukkit issue or that it is a Minecraft client issue, and I tend to think the latter, but does anyone know definitively which is the case?

    I'd like to know if there's any way I can do something on right-clicking air with fists, without adding a mod.
     
  2. @0ct0berBkkitPlgins
    check if e.getAction() == Action.RIGHT_CLICK_AIR and then check if the players hand is null
     
  3. The problem is it doesn't seem to run at all, as I had said. I'm using no checks, only sending a test message- the event literally doesn't run when you right click air with nothing in your hand. If you want, you can try it yourself and see.
     
  4. Offline

    Zombie_Striker

    @0ct0berBkkitPlgins
    There are some items that do nothing on right clicking air. The client does not send interact packets with items that do not do anything in the base game, an empty hand being one of them. I'm not sure if there is any way to fix this. You may need to give them an item to do what you want.
     
    MightyOne likes this.
Thread Status:
Not open for further replies.

Share This Page