New to plugin dev

Discussion in 'Plugin Development' started by storek55, Feb 11, 2012.

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

    storek55

    Hello, i just watn to try how to make plugin for bukkit, already readed toutrial on wiki. But have one problem so here is it:

    Il try to make pvp script so here is first step when user type /pvp in chat.

    Code:
    package com.storek.pvp;
     
    import java.util.logging.Logger;
     
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.plugin.java.JavaPlugin;
     
    public class Pvp extends JavaPlugin {
       
        Logger log = Logger.getLogger("Minecraft");
       
        public void onEnable(){
            log.info("PVP plugin has been enabled.");
        }
       
        public void onDisable(){
            log.info("PVP plugin has been disabled.");
        }
       
        public boolean onCommand (CommandSender sender, Command cmd, String commandLabel, String[] args){
            if(cmd.getName().equalsIgnoreCase("pvp")){
                return true;
            }
            return false;
            }
    }
    
    and here is my plugin.yml

    Code:
    name: Pvp
    main: com.storek.pvp.Pvp
    version: 0.1
    description: >
                Pvp. Pvp plugin for bukkit.
    commands:
        basic:
            description: This is a demo command.
            usage: /pvp [player]
            permission: Pvp.pvp
            permission-message: You don't have
    So what i am doing wrong and this plugin.yml because server dont want to load it as it says thath plugin.yml is incorrect.
     
  2. First of all you want the command "pvp" but in the plugin.yml you say "basic" so be sure to change that. Second, I don't know if "permission" and "permission-message" are already implemented, so try to remove them as well.
    That should work then.
     
  3. Offline

    storek55

    Humm thanks. I changed to pvp and removed the permission and permission message but still invalid :S
     
  4. Offline

    TACTICALboom

    'permission:' to my knowledge, has been implemented as another way to define the nodes, I have used it successfully. But I no not, of 'permission-message:'
     
  5. Offline

    thehutch

    Yeah and also you need to implement CommandExecutor and in the onEnable put:

    this.getCommand("pvp").setExecutor(this);
     
Thread Status:
Not open for further replies.

Share This Page