Solved Um help!

Discussion in 'Plugin Development' started by quack123456, Feb 9, 2015.

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

    1Rogue

    Code:
        description: Bananas
     
    Konato_K likes this.
  2. Offline

    quack123456

  3. Offline

    1Rogue

    The real question you must ask yourself is: Why not?
     
  4. Offline

    quack123456

    @1Rogue eh Good point :p maybe Ducks is better but anyways i need to know why this wont work :p
     
  5. Offline

    nverdier

  6. Offline

    Minesuchtiiii

    Try to use "return true;" and not "return false;" at the end of your code.
     
  7. Offline

    SuperOriginal

  8. Offline

    Konato_K

  9. Offline

    quack123456

    Still it doesn't work :( anyone know why
     
  10. Offline

    quack123456

  11. Offline

    quack123456

  12. Offline

    SuperOriginal

    • You still haven't fixed your logger like we've already asked you to many times
    • Your main in plugin.yml isn't pointing to the Main class, it's pointing to the package.
     
  13. Offline

    quack123456

    @SuperOriginal so what do i do im really new to this. I was watching lots of tutorials.
     
  14. Just for the sake of this thread's sanity:

    http://hastebin.com/nawofopeve.coffee

    plugin.yml:
    Code:
    name: <name of project>
    version: 1.0
    main: <name.of.package.<class>>
    author: <your name>
    description: <desc>
    
    commands:
      hi:
        description: says hi back
     
  15. Offline

    caderape

    @quack123456
    commands:
    hi:

    Put this in your yaml.

    1. public boolean onCommand(CommandSender Sender, Command cmd, String label, String[] args) {
    2. if (cmd.getname().equalsIgnoreCase("hi")) {
    3. sender.sendMessage("Hello");
    4. }
    5. return false;
    6. }
    And this in your command. test if it works
     
  16. Offline

    Ruptur

    Dont think the problem is the yaml parse
    Prettry sure you cant do this
    Code:
      if (command.equalsIgnoreCase("hi")) // Hi.HI.hI.hi {
    
    remove the comment between the '))' and '{'

    Code:
    if (command.equalsIgnoreCase("hi")) {
    
     
  17. Offline

    feff890

    @quack123456
    if (command.equalsIgnoreCase("hi")) // Hi.HI.hI.hi {
    Try removing the // as this may be blocking the {
     
  18. Offline

    quack123456

  19. Offline

    Ruptur

    @quack123456

    Code:
    name: bUkkitplugin
    version: 1.0
    main: me.kyle.bukkitplugin.(YOUR_MAIN_CLASS_NAME)
    author: Kyle
    description: Nothing :P
    commands:
      hi:
        description: says hi back
    
    In this case would be

    Code:
    name: bUkkitplugin
    version: 1.0
    main: me.kyle.bukkitplugin.BukkitPlugin
    author: Kyle
    description: Nothing :P
    commands:
      hi:
        description: says hi back
     
  20. Offline

    TGRHavoc

  21. Offline

    quack123456

    oh im stupid

    @Ruptur
    It still doesnt work
     
    Last edited by a moderator: Feb 13, 2015
  22. Offline

    Ruptur

  23. Offline

    quack123456

    @Ruptur the resource sync is the error
     
  24. Offline

    Ruptur

    @quack123456

    I feel sorry for you so i did it for you

    Code:
    
    public class Test extends JavaPlugin {
       
        // Instalising the logger
        public static final Logger log = Logger.getLogger("Minecraft");
       
        public void onEnable(){
            log.info(ChatColor.GREEN + "Plugin loaded sucessfully!");
            // Pretty self explanatory - logs this ^ message
        }
        public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
            //if the type in /hi 
            if(cmd.getName().equalsIgnoreCase("hi")){
                sender.sendMessage(ChatColor.BOLD + " " + ChatColor.LIGHT_PURPLE + "Hello there!");
                //sends a bold light pruple message to the sender - message in this case is 'Hello there!' 
            }
           
            return true;
           
        }
    }
    
    plugin.yml

    Code:
    name: Test
    version : 0.1
    main : me.ruptur.test.Test
    
    commands:
        hi:
            usage: /<command>
            description: Test command!
    
    Simple as pie
     
  25. Offline

    Konato_K

    @Ruptur Why do you need the logger?
     
  26. Offline

    Ruptur

    @Konato_K
    You don't ..
    Bukkit automatically logs successfully enables already so you don't 'need' it.
    But i believe quack wanted it (i think)
     
  27. Offline

    Konato_K

    @Ruptur That's my point, if you "fixed" it for him why would you use that bad logger instead of using the plugin's logger?
     
  28. Offline

    Ruptur

    I didn't 'fix' anything. I only did what was my interpretation of quack's dilemma. Maybe the logger wasn't good in this case but he still wanted it.
     
  29. Offline

    quack123456

    @Ruptur um i was just copying of a tutorial Just wanted to say that xD
     
  30. Offline

    Ruptur

    @quack123456
    Oh, lol >:D

    If what i posted earlier worked for you then you can set the thread as [solved]
    If you think i helped you give a like.
     
    quack123456 likes this.
Thread Status:
Not open for further replies.

Share This Page