Solved Essentials events

Discussion in 'Plugin Development' started by bennie3211, May 13, 2016.

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

    bennie3211

    I'm trying to use the mute toggle event from essentials. Now I use this:

    Code:
    @SuppressWarnings("deprecation")
        @EventHandler(ignoreCancelled = true)
        public void onMuteChange(MuteStatusChangeEvent e) {
            OfflinePlayer p = getPlugin().getServer().getOfflinePlayer(e.getController().getName());
    
            System.out.println(p);
    
            if (p == null) {
                getPlugin().getLog().warning("The player doesn't exists!");
                return;
            }
          
            System.out.println("muting: " + e.getController().getName());
            //Do stuff with muted player
        }
    But the event never gets fired. And yes, the class implements Listener and is registered because other events in the same class works correctly (it's the NickChangeEvent from essentials that is in the same class). None of the debug messages are displayed in the chat. Anyone that can help me out with this?

    EDIT:
    The JailStatusChangeEvent from essentials has the same problem. Doesn't get called when players are jailed/unjailed D:
     
    Last edited: May 13, 2016
  2. Offline

    Zombie_Striker

    This may be part of the issue. This says to not trigger this event if it is canceled. Just keep the @EventHandler, remove the ignoreCancelled, and check if the event has been canceled.
     
  3. Offline

    bennie3211

    But the event is triggered by essentials itself, the command works when I type /nick GonnaKillYou2 testNick. Then I will get the given nickname as nickname. I will try it out, but I think it will not be the solution, or can it be that this event is cancalled even that the command is triggered? Will test it out in about 2 minutes.

    Edit: tried with the ignoreCancelled and it's still the same @Zombie_Striker.
     
    Last edited: May 13, 2016
  4. Offline

    Zombie_Striker

    @bennie3211
    Yes. All you need is for one other plugin to cancel the event and this event will stop. Figure out if any other plugins are canceling this event, and if so, figure out how to change that.

    An easy way to see if a plugin cancels the event would be to only have your plugin and essentials enabled on the server. If your event still does not work, even with it just being those two plugins, then you should submit a ticket or ask for help on the Essential's bukkit dev page.
     
  5. Offline

    bennie3211

    I tested the my own plugin and Essentials without any other plugin. Still the same effect. So I guess I have to create a ticket on the Essential's bukkit dev page.
     
Thread Status:
Not open for further replies.

Share This Page