PlayerGameModeChangeEvent not firing

Discussion in 'Plugin Development' started by Musician101, Jan 4, 2014.

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

    Musician101

    I have a plugin that should detect when a player changes gamemode but the PlayerGameModeChangeEvent is being completely ignored. I have no idea what's wrong with the code. Said code for the event is below. And yes the listener is registered.

    Code:java
    1. @EventHandler
    2. public void onGameModeChange(PlayerGameModeChangeEvent e)
    3. {
    4. Player player = e.getPlayer();
    5. GameMode gm = e.getNewGameMode();
    6. if (!e.isCancelled())
    7. player.sendMessage("quack");
    8. }
     
  2. Offline

    xTrollxDudex

  3. Offline

    Musician101

  4. Offline

    HyrulesLegend

    Line 6 lacks of a ' { ' at the end.
     
  5. Offline

    Musician101

    Max_The_Link_Fan It doesn't. The editor likes to reset the formatting on code blocks for some reason.
     
  6. Offline

    HyrulesLegend

    Oh ok. Any stacktrace?
     
  7. Offline

    Musician101

    Max_The_Link_Fan Nope, everything compiles. The event just gets skipped or something.
     
Thread Status:
Not open for further replies.

Share This Page