-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Minor
-
None
-
Affects Version/s: None
If you teleport the player while he uses an item in hand by right-clicking a block, the PlayerInteractEvent will fire twice, once as RIGHT_CLICK_BLOCK and once as RIGHT_CLICK_AIR.
However, if he right-clicks the air from the start, it will only fire once.
It will also fire once if the player is facing a block at the location he is telporting to.
Demonstration: https://github.com/McDjuady/Mc-Interact-TP-Spike
This Plugin teleports the player to spawn once he uses an Ender Eye and also reduces the ammount of the eyes by one.
- Build the Plugin and drop it into your server
- Get some EnderEyes
- Make sure you don't face any blocks at your spawn location
- Use the eye without clicking a block => 1 Eye consumed
- Use the eye by clicking a block => 2 Eyes consumed
- Place some blocks infront of the spawn so that you face them once teleported there
- Use the eye by clicking a block => 1 Eye consumed
All of this is done with only the Main Hand being passed to the listener