DecentSoftware-eu / DecentHolograms

A lightweight but powerful hologram plugin with many features and configuration options.
https://www.spigotmc.org/resources/96927/
GNU General Public License v3.0
211 stars 101 forks source link

HologramClickEvent not called when clicking a hologram #122

Closed Luncaaa closed 1 year ago

Luncaaa commented 1 year ago

Just making sure

Reproduction

  1. Create a plugin with DecentHolograms as a dependency
  2. Create a hologram
  3. Create a listener for the HologramClickEvent
  4. Click the hologram created in step 3 and nothing will happen (no errors and the event is not called)

This is a simple event listener I created which does not work: Listener class

public class Test implements Listener {
    @EventHandler
    public void onHologramClick(HologramClickEvent event) {
        Bukkit.getLogger().info("Hologram clicked");
    }
}

Main class:

getServer().getPluginManager().registerEvents(new Test(), this);

Solution

No response

Server Version

Paper 1.19.3 #446

Client Version

1.19.3

Plugin Version

2.7.12

Log

https://pastebin.com/LVK4gqK1

Andre601 commented 1 year ago

My best guess here why the click event no longer works, is that the fix for removing the hitbox, which caused you to not be able to interact with blocks/NPCs below the hologram, makes it impossible to click a hologram, because there's no longer a hitbox to click...

If that's the case, then we have an interesting issue here where you either re-add the hitboxes, making the old issues with NPCs and blocks appear again, or not re-add them, causing the issues you encounter. :/

Luncaaa commented 1 year ago

Would it be possible to add an option in the config file which allows you to enable or disable the hitboxes?

d0by1 commented 1 year ago

Hello, this has been fixed in version 2.8.1. The event now also detects clicks on holograms without actions, it was actually a bug and it wasn't intended behaviour. Thanks for reporting it!