Plugin not loading

Discussion in 'Plugin Development' started by Rocky_990, Mar 10, 2015.

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

    Rocky_990

    Hello :)

    Thanks for coming here- and maybe you'll be able to help me.
    I've been trying to follow online tutorial videos on how to make 1.7.10 Plugins for my server- but when I load them, they never seem to work. Even though I've copied the code exactly the same as the tutorial and added a correct plugin.yml, they never load onto the server and the server doesn't recognize them.

    If possible, could someone please assist me as to point me in the right direction to get my plugin to load? Thanks!
     
  2. We cant help you without your:
    Code
    plugin.yml
    Console error

    And please dont copy & paste. You can make it, but you would learn more if you try it yourself after the tutorial
     
    Rocky_990 likes this.
  3. Offline

    timtower Administrator Administrator Moderator

    Moved to plugin development.
    @Rocky_990 Please post your server log using pastebin and your code using the [code] < code here > [/code]
     
  4. @timtower *offtopick how did you make it not format the < code here > ?
     
  5. Offline

    timtower Administrator Administrator Moderator

    @FisheyLP [plain]<bb stuff here>[/plain]
     
    FisheyLP likes this.
  6. Offline

    Rocky_990

    Code:
    Code:
    package me.rocky990.testing;
    
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.entity.Player;
    
    public class main extends JavaPlugin {
    
       
        public void onEnable() {
            getLogger().info("Plugin enabled");
        }
        public void onDisable() {
            getLogger().info("Plugin disabled");
        }
       
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
            if (sender instanceof Player) {
                Player player = (Player) sender;
                if(cmd.getName().equalsIgnoreCase("hub")){
                    String hub = "spawn " + player.getName();
                    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), hub);
                    player.sendMessage(ChatColor.AQUA + "Returning to Safety!");
               
                }
            }
            return false;
        }
       
    }
    
    Plugin.yml:
    Code:
    name: Testing
    author: rocky990
    version: 1
    description: Testing plugin
    main: me.rocky990.testing.main
    commands: 
      hub
        description: Teleports to hub
    
    Server log:
    http://pastebin.com/6wcR6g6N

    Thank you for the help :)
    I'm new to Java but know a fair amount of C++ :p... Can't wait to sort this out and make my own plugins!
     
  7. Offline

    timtower Administrator Administrator Moderator

    Rocky_990 likes this.
  8. Offline

    Rocky_990

    Thank you so much!!
    It fixed it entirely.
     
  9. Offline

    nverdier

    @Rocky_990 You don't need to log enable/disable messages; Bukkit does this for you.

    But please mark your thread as solved. See this for more info.
     
Thread Status:
Not open for further replies.

Share This Page