Plugin won't load/show

Discussion in 'Plugin Development' started by Reshunboy, May 15, 2014.

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

    Reshunboy

    Hello,
    I am pretty new to coding Bukkit Plugins.
    I am working on a plugin which gives players a compass every time they join.
    I wanted to test it but nothing happened, so if you know why, please help me :3
    PS: sorry if it is a stupid mistake xD

    The code:
    Code:
    package me.Reshunboy;
     
    import java.util.ArrayList;
     
    import org.bukkit.ChatColor;
    import org.bukkit.Material;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.EventPriority;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.meta.ItemMeta;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.java.JavaPlugin;
     
    public class Main extends JavaPlugin implements Listener{
        public static Main plugin;
       
        @Override
        public void onEnable() {
            PluginManager pm = getServer().getPluginManager();
            pm.registerEvents(this, this);
        }
       
        @Override
        public void onDisable() {
           
        }
       
        @EventHandler (priority=EventPriority.HIGH)
        public void onPlayerJoin (PlayerJoinEvent e) {
           
            Player p = e.getPlayer();
           
            p.sendMessage(ChatColor.RED + "[BlockInc]" + ChatColor.AQUA +" Welcome to the server, " + p.getName());
           
            ItemStack compass = new ItemStack (Material.COMPASS);
            {
            ItemMeta itemmeta = compass.getItemMeta();
            ArrayList<String> im = new ArrayList<String>();
            itemmeta.setDisplayName(ChatColor.BOLD + "Minigames");
            itemmeta.setLore(im);
            compass.setItemMeta(itemmeta);
            p.getInventory().addItem(compass);
            }
        }
    }
    
    The plugin.yml:
    Code:
    name: CustomJoin
    main: me.Reshunboy.Main
    author: Reshunboy
    version: 1.0
    commands:
     
  2. I don't see anything wrong, do you have any errors in the console?
     
  3. Offline

    Reshunboy

    Not really, but when I do/plugins, the plugin won't show.
     
  4. Offline

    tryy3

    When you add it to the server, is the plugin a jar file and is it in the plugins folder?
     
  5. Offline

    FabeGabeMC

    remove the command line in the plugin.yml
     
  6. Offline

    Reshunboy

    Isn't working too :/

    Yes it is a .jar and in the Plugins folder

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
Thread Status:
Not open for further replies.

Share This Page