Pocketmine-mp: Right clicking a block calls both RIGHT_CLICK_BLOCK and RIGHT_CLICK_AIR

Created on 23 Oct 2017  路  2Comments  路  Source: pmmp/PocketMine-MP

Issue description


It might be a client sided bug.
I have a Listener listening to the PlayerInteractEvent.
When left clicking the air, i get the correct type.
When left clicking a block (in any gamemode), nothing happens
When right clicking the air, i get the correct type.
When right clicking a block i receive the event twice, once RIGHT_CLICK_BLOCK and once RIGHT_CLICK_AIR

I am not entirely sure if the client is joking around in this case, or the server.

  • Expected result: What were you expecting to happen?
  • Actual result: What actually happened?

Steps to reproduce the issue

  1. Code below
  2. Execution described above

OS and versions

  • PocketMine-MP: PocketMine-MP 1.7dev 3.0.0-ALPHA9 [REDACTED]
  • PHP: 7.2.0RC4
  • Server OS: Windows Server 2012 R2
  • Game version: PE/Win10 (delete as appropriate) v1.2.3

Plugins

  • Test on a clean server without plugins: is the issue reproducible without any plugins loaded?

If the issue is not reproducible without plugins:

  • Have you asked for help on our forums before creating an issue?
  • Can you provide sample, minimal reproducing code for the issue? If so, paste it in the bottom section
  • Paste your list of plugins here (use the 'plugins' command in PocketMine-MP)

selfmade plugin including only the listener:

    public function onInteract(PlayerInteractEvent $event){
        var_dump($event->getAction());
    }

Crashdump, backtrace or other files

  • Do not paste crashdumps into an issue - please use our Crash Archive at https://crash.pmmp.io for submitting crash reports to not spam the issue tracker. Add links to your reports in the Crash Archive here.
  • Please use gist or anything else to add other files and add links here

  • ...

Client Won't fix

Most helpful comment

I know this is an old issue, but since GitHub decided to stuff it in my face -

In 4.0, PlayerInteractEvent will no longer fire for the so-called "right click air" action (which is actually an activate-item action). You'll be required to handle PlayerItemUseEvent to intercept item-activations instead.

All 2 comments

Yes, this is a client-sided bug, it's been around as long as I can remember (0.14 at least).

I know this is an old issue, but since GitHub decided to stuff it in my face -

In 4.0, PlayerInteractEvent will no longer fire for the so-called "right click air" action (which is actually an activate-item action). You'll be required to handle PlayerItemUseEvent to intercept item-activations instead.

Was this page helpful?
0 / 5 - 0 ratings