How to make a messaging plugin?

Discussion in 'Plugin Development' started by The_Punkster, Jun 21, 2014.

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

    The_Punkster

    Hey, so I'm trying to make a plugin that sends the player a message when they go in a certain world.

    Currently, this code does absolutely nothing, any idea why? I'm sorta new to this.

    Code:java
    1. public class Main extends JavaPlugin implements Listener{
    2.  
    3. @Override
    4. public void onDisable() {
    5.  
    6. }
    7.  
    8. @Override
    9. public void onEnable() {
    10. Bukkit.getPluginManager().registerEvents(this,this);
    11. }
    12.  
    13. public void onWorldChange(PlayerChangedWorldEvent event){
    14.  
    15. String world = event.getPlayer().getWorld().getName();
    16. Player p = event.getPlayer();
    17.  
    18. if (world.equalsIgnoreCase("pvp")) {
    19. p.sendMessage("###########################");
    20. p.sendMessage("Type /kits to start off!");
    21. }
    22. }
    23. }
    24.  
     
  2. Offline

    Gater12

    The_Punkster
    Your forgot your @EventHandler annotation above your event method.
     
  3. Offline

    The_Punkster

    Oh lawd. Did not see that! Thank-you. Gater12
     
Thread Status:
Not open for further replies.

Share This Page