Solved Kill plugin

Discussion in 'Plugin Development' started by MooshViolet, Aug 1, 2016.

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

    MooshViolet

    I am creating a /kill plugin and basically it is not showing up in my server. My other commands in the plugin are, but the /kill is not. Just the essentials /kill is showing up. Here is my code for /kill:
    Code:
     if(cmd.getName().equalsIgnoreCase("kill")){
                             if(args.length == 0){
                                 p.setHealth(0);
                                 Bukkit.broadcastMessage(ChatColor.GRAY + p.getName() + " died.");
                             }
                             if(args.length == 1){
                                 if(!p.hasPermission("ne.kill")){
                                     p.sendMessage(ChatColor.GRAY + "Invalid usage. </kill>");
                                 }
                                 Player target = Bukkit.getServer().getPlayer(args[0]);
                                 target.setHealth(0);
                                 p.sendMessage(ChatColor.GRAY + "You have killed " + target.getName());
                                
                             }else{
                                 p.sendMessage(ChatColor.GRAY + "Invalid usage. </kill>");
                             }
                             return true;
                 }
    And here is my plugin.yml file:
    Code:
    name: neCore
    version: 1.0
    main: me.mooshviolet.neCore.Report
    author: MooshViolet
    description: A report plugin!
    commands:
         report:
             usage: /<command>
             description: Report a player
         reddit:
             usage: /<command>
             description: link the reddit page
         kill:
             usage: /<command>
             description: Kill yourself or a player
     
  2. Offline

    timtower Administrator Administrator Moderator

  3. Offline

    MooshViolet

    Solved by cleaning up code and making multiple classes.
     
Thread Status:
Not open for further replies.

Share This Page