1. Welcome to LilyPad. Download the project, explore the forums, and create your own LilyPad network.


    If you use the software and enjoy it or have a question, or would like to contribute to the future of the software directly or through resources, please sign up and join our little community.

Bukkit plugin help...

Discussion in 'Programming' started by 123isme1, Dec 14, 2013.

  1. 123isme1

    123isme1 New Member

    Does anything seem wrong? It simply does nothing, no errors, and if I do /pl it is green...
    NOTE: thanks to @sgtcaze for the video @

    Code (text):
    package com.MC123isme1.MC123Greeting;

    import org.bukkit.ChatColor;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.java.JavaPlugin;

    public class Main extends JavaPlugin implements Listener {

        public void onEnable(){
            PluginManager pm = getServer().getPluginManager();
            pm.registerEvents(new Main(), this);
        }

        @EventHandler
        public void onPlayerJoin(PlayerJoinEvent event){
            Player p = event.getPlayer();
            event.setJoinMessage(ChatColor.GOLD + p.getPlayerListName() + "has joined the game!");
            p.sendMessage(ChatColor.ITALIC + "Welcome to the game," + p.getPlayerListName() + "!!");
        }

    }
    Last edited by a moderator: Dec 14, 2013
  2. The_Zip

    The_Zip Active Member Resource Contributor

    • Useful Useful x 1
  3. 123isme1

    123isme1 New Member

  4. 123isme1

    123isme1 New Member

    Part of the problem may be that I have two Java build paths :/ (one that doesn't even exist)
  5. sgtcaze

    sgtcaze Member Resource Contributor

    Register your events as pm.registerEvents(this, this)
    • Agree Agree x 2
    • Winner Winner x 1
  6. 123isme1

    123isme1 New Member

    YESSSSSSSS IT WORKED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Any way to make the messages configurable in config.yml?
    EDIT: The reason I am so excited is because this is my first plugin.
    EDIT: Any way to add a second ColorCode besides Italic?
  7. The_Zip

    The_Zip Active Member Resource Contributor

    A video might be the best thing if you are learning Java, which it sounds like you are doing. I don't know a good one, or maybe someone else does. But, the way I learned, and the most informative way is reading, in which you should check out http://wiki.bukkit.org/Configuration_API_Reference .
    • Like Like x 1
  8. 123isme1

    123isme1 New Member

    I will look into that, thanks!
  9. 123isme1

    123isme1 New Member

    Two plugins down, one to go. (Wow, three plugins in a matter of hours)
  10. 123isme1

    123isme1 New Member

    Done, done, and done. (All are on BukkitDev)

Share This Page