Dropping an item also calls the on click event
friyes opened this issue ยท 6 comments
Skript/Server Version
[19:08:42 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[19:08:42 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[19:08:42 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[19:08:42 INFO]: [Skript] Server Version: 1.20.6-137-bd5867a (MC: 1.20.6)
[19:08:42 INFO]: [Skript] Skript Version: 2.8.6 (skriptlang-github)
[19:08:42 INFO]: [Skript] Installed Skript Addons:
[19:08:42 INFO]: [Skript] - skript-placeholders v1.6.0 (https://github.com/APickledWalrus/skript-placeholders)
[19:08:42 INFO]: [Skript] - skript-particle v1.3.1 (https://github.com/sovdeeth/skript-particle)
[19:08:42 INFO]: [Skript] - DiSky v4.17.2
[19:08:42 INFO]: [Skript] - skript-reflect v2.4 (https://github.com/SkriptLang/skript-reflect)
[19:08:42 INFO]: [Skript] - SkBee v3.5.3 (https://github.com/ShaneBeee/SkBee)
[19:08:42 INFO]: [Skript] - SkJson v3.0.91
[19:08:42 INFO]: [Skript] Installed dependencies:
[19:08:42 INFO]: [Skript] - Vault v1.7.3-b131
[19:08:42 INFO]: [Skript] - WorldGuard v7.0.10+d9424b1
Bug Description
Dropping an item also calls the on click
event when you aren't looking at any block.
on drop:
broadcast "dropped"
on click:
broadcast "interacted"
Expected Behavior
Only the drop event was called.
Steps to Reproduce
- Upload and reload the script.
- Get an item.
- Run
/tp ~ 300 ~
. - Look up.
- Throw the item.
- Observe that both "dropped" and "interacted" are sent.
Errors or Screenshots
No response
Other
No response
Agreement
- I have read the guidelines above and affirm I am following them with this report.
Dropping something is a PHYSICAL
(click type) interaction, and click technically listens for interactions.
but the paper interaction event doesn't actually do this
import:
org.bukkit.event.player.PlayerDropItemEvent
org.bukkit.event.player.PlayerInteractEvent
on PlayerDropItemEvent:
broadcast "java dropped"
on PlayerInteractEvent:
broadcast "java interacted"
on drop:
broadcast "skript dropped"
on click:
broadcast "skript interacted"
depends on all your tested events, skript uses a bunch for single events at times
Skript/src/main/java/ch/njol/skript/events/EvtClick.java
Lines 60 to 64 in 0355df1
So this is intended behavior?
In a way yes, was the something they initially planed? No, I'm sure the person who made this in 2014 didn't know this meant the Minecraft behavior of arm swinging when you drop would cause left click to occure.