Solved PlayerMoveEvent?

Discussion in 'Plugin Development' started by VictoryShot, Apr 7, 2014.

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

    VictoryShot

    When I cast this:
    Code:java
    1. public void onPlayerMove(PlayerMoveEvent event) {
    2. Player p = event.getPlayer();
    3. Location loc = p.getLocation();
    4. loc.getWorld().playEffect(loc, Effect.ENDER_SIGNAL, 2004);
    5. p.sendMessage("Stahp");
    6. }


    None of it doesnt work. Any help?
     
  2. Offline

    Shadowwolf97

    Have you included the @EventHandler and registered it through the plugin manager?
     
  3. Offline

    Wolfey

    The code looks fine, but it doesn't look like you have the @EventHandler.

    And if that doesn't work, then you are not registering your events.

    And if that doesn't work, then your plugin isn't loading.

    Otherwise, I have no idea.
     
  4. Offline

    VictoryShot

    Didnt work.
     
  5. Offline

    Gater12

    VictoryShot
    "Didn't work" is quite vague. What exactly didn't work? Did it throw any errors? Or simply did nothing? I'm guessing it's "did nothing" and if it is the case, we'd like to see some code to I heck if you did something wrong.
     
  6. Offline

    VictoryShot

    Thanks I got it.

    Code:java
    1. public void onEnable() {
    2. PluginManager pm = getServer().getPluginManager();
    3. pm.registerEvents(this, this);
    4. }
     
Thread Status:
Not open for further replies.

Share This Page