Message Dude

Discussion in 'Plugin Development' started by thedjtrollin, Jan 10, 2014.

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


    When sending a message after someone breaking a block the message sends twice? Not sure why thou....

    1. public void onBlockBreakEvent(BlockBreakEvent event) {
    2. Player player = event.getPlayer();
    3. if (!player.isOp()) {
    4. event.setCancelled(true);
    5. player.sendMessage(ChatColor.GOLD + "Vitality >"+ ChatColor.DARK_RED + " Hubby says no!");
    6. return;
    7. }
    8. else {
    9. event.setCancelled(false);
    10. return;
    11. }
    12. }

  2. Offline


    Soved I had 2 x .registerEvents(this, this); on Enable.
  3. thedjtrollin
    You need listeners. If you don't have a listener, the game will have no idea that an event happened. You can think of it like being deaf and not being able to hear a train go by 5 feet away from you (ik that's not a good example :p ). Putting in a listener and see what happens.
Thread Status:
Not open for further replies.

Share This Page