Why doesnt PlayerInteractEvent trigger?

Discussion in 'Plugin Development' started by JayAyTee, Feb 14, 2022.

Thread Status:
Not open for further replies.
  1. Offline

    JayAyTee

    So, to put it simply I'm trying to make right click detection. Thing is, it doesnt work. I have no idea why it doesnt work, but what I'm thinking is that I have forgotten some extention or implementation.

    @EventHandlerpublic
    static void onRightClick(PlayerInteractEvent event) {
    Bukkit.broadcastMessage("RightClick!"); // Debug message
    }
     
  2. Offline

    timtower Administrator Administrator Moderator

    @JayAyTee Remove the static and show your onEnable.
     
  3. Offline

    JayAyTee

    So I removed the static keyword, and I'm guessing you want to see the onEnable because of the fact that I have to register the event. But it still doesnt work

    @Overridepublic void onEnable() {

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

    }
     
  4. Offline

    timtower Administrator Administrator Moderator

    @JayAyTee Show your full code please, in a way that does not remove the enters if possible.
     
  5. Offline

    JayAyTee

    Ok nvm I managed to fix it
     
Thread Status:
Not open for further replies.

Share This Page