Skript: Leftclick and Drop events trigger Bug

Created on 28 Dec 2019  路  7Comments  路  Source: SkriptLang/Skript

Description

When using "on leftclick" and "on drop" events, they both trigger if you attempt to drop an item while facing the air/sky.

Steps to Reproduce

Write a simple code like the following:

on leftclick:
    broadcast "leftclick"

on drop:
    broadcast "drop"

Hold an item then drop it WHILE facing the air/sky. You will notice that both events are triggered. Only the "on drop" event gets triggered if the user faces the block.

Expected Behavior

The code should have only triggered the "on drop" event if dropping an item, regardless if the user is facing the air or anything else.

Errors / Screenshots

No errors.

Server Information

  • Server version/platform: Spigot 1.15.1
  • Skript version: 2.4.1

Additional Context

Either this is a Bukkit/Spigot bug or something happened with the Skript internal code itself.

enhancement lowest

Most helpful comment

Ok so update:

  • Reported this to SpigotMC. md_5 quickly closed it and marked it as a duplicate of another issues.

Long story short, Bukkit's playerInteractEvent for LEFT_CLICK_AIR is just a hacky way of listening to the arm swing packet. Since 1.15 added arm swing animations for a lot of things (including dropping an item) that is why the click event is getting called. Im sure we can try find a hacky way to fix this, but its going to take a bit of work.

All 7 comments

using
paper 1.14.4 186
plugins
Skript, Sk-NBeet, skript-mirror, worldedit-bukkit-7.0.1, worldguard-bukkit-7.0.1
code

on drop:
    broadcast "drop"
on leftclick:
    broadcast "leftclick"

the behavior does not happen to me

using
paper 1.14.4 186
plugins
Skript, Sk-NBeet, skript-mirror, worldedit-bukkit-7.0.1, worldguard-bukkit-7.0.1
code

on drop:
  broadcast "drop"
on leftclick:
  broadcast "leftclick"

the behavior does not happen to me

Seems like it's because you're using paper spigot, not default spigot. Going to edit my post to clarify that I am using default spigot for the server.

using
paper 1.14.4 186
plugins
Skript, Sk-NBeet, skript-mirror, worldedit-bukkit-7.0.1, worldguard-bukkit-7.0.1
code

on drop:
    broadcast "drop"
on leftclick:
    broadcast "leftclick"

the behavior does not happen to me

Seems like it's because you're using paper spigot, not default spigot. Going to edit my post to clarify that I am using default spigot for the server.

Can you replicate this issue in Spigot 1.14.4 or Paper 1.14.4? If you can't then it's very likely a Spigot issue in 1.15.1

This is 100% a Spigot/CB issue.
I have reported it to Spigot, hopefully they will fix it soon.

Marking this as Invalid, but leaving it open until Spigot fixes the issues, this way if others notice it they can see this issue.

Ok so update:

  • Reported this to SpigotMC. md_5 quickly closed it and marked it as a duplicate of another issues.

Long story short, Bukkit's playerInteractEvent for LEFT_CLICK_AIR is just a hacky way of listening to the arm swing packet. Since 1.15 added arm swing animations for a lot of things (including dropping an item) that is why the click event is getting called. Im sure we can try find a hacky way to fix this, but its going to take a bit of work.

@ShaneBeee Could you link the issue you made here for reference?

This is the issue I created:
https://hub.spigotmc.org/jira/browse/PLUG-370

Which was closed and referenced as a duplicate of:
https://hub.spigotmc.org/jira/browse/SPIGOT-5435

Which was closed and marked as invalid

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wohahobg picture wohahobg  路  3Comments

ghost picture ghost  路  3Comments

DeagoTheDoggo picture DeagoTheDoggo  路  3Comments

Anoniempje1234 picture Anoniempje1234  路  3Comments

ghost picture ghost  路  3Comments