First coding plugin Problem

Discussion in 'Plugin Development' started by W_Midoria, Oct 6, 2019.

  1. Offline

    W_Midoria

    Code:
    [22:26:54 ERROR]: Could not load 'plugins\Die.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: name is not defined[/COLOR][/I][/B][/U]
            at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:876) ~[spigot.jar:git-Spigot-2cf50f0-8166d17]
            at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:228) ~[spigot.jar:git-Spigot-2cf50f0-8166d17]
            at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:157) ~[spigot.jar:git-Spigot-2cf50f0-8166d17]
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [spigot.jar:git-Spigot-2cf50f0-8166d17]
            at org.bukkit.craftbukkit.v1_12_R1.CraftServer.loadPlugins(CraftServer.java:305) [spigot.jar:git-Spigot-2cf50f0-8166d17]
            at org.bukkit.craftbukkit.v1_12_R1.CraftServer.reload(CraftServer.java:750) [spigot.jar:git-Spigot-2cf50f0-8166d17]
            at org.bukkit.Bukkit.reload(Bukkit.java:525) [spigot.jar:git-Spigot-2cf50f0-8166d17]
            at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:27) [spigot.jar:git-Spigot-2cf50f0-8166d17]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot.jar:git-Spigot-2cf50f0-8166d17]
            at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:648) [spigot.jar:git-Spigot-2cf50f0-8166d17]
            at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchServerCommand(CraftServer.java:634) [spigot.jar:git-Spigot-2cf50f0-8166d17]
            at net.minecraft.server.v1_12_R1.DedicatedServer.aP(DedicatedServer.java:444) [spigot.jar:git-Spigot-2cf50f0-8166d17]
            at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:407) [spigot.jar:git-Spigot-2cf50f0-8166d17]
            at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) [spigot.jar:git-Spigot-2cf50f0-8166d17]
            at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [spigot.jar:git-Spigot-2cf50f0-8166d17]
            at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]
    Caused by: java.lang.NullPointerException
            at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:869) ~[spigot.jar:git-Spigot-2cf50f0-8166d17]
            ... 15 more
    [22:26:55 INFO]: Server permissions file permissions.yml is empty, ignoring it
    Hello guys I have problem.

    Main.Java:
    Code:
    package diep;
    
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class Main extends JavaPlugin {
       
        @Override
        public void onEnable() {
            System.out.println("플러그인이 활성화 되었습니다");
        }
        @Override
        public void onDisable() {
            System.out.println("플러그인이 활성화 되었습니다");
        }
        @Override
        public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
            if(command.getName().equalsIgnoreCase("die")) {
                if(sender instanceof Player) {
                    Player p = (Player) sender;
                    p.setHealth(0);
                    p.sendMessage("DIE");
                }else { 
                    System.out.println("You need to be a player to do this command.");
                }
                return false;
            }
            if(command.getName().equalsIgnoreCase("hello")) {
                sender.sendMessage("hello");
                return false;
            }
               
            return true;
        }
    }
    plugin.yml
    Code:
    Name: Die
    version: 1.12.2
    main: diep.Main
    
    commands:
      die:
    I think that it will be good, but it is not...
    Can you help me? plz.....

    and, I'm Korean and middle school student, so I am not good at English.... Sorry.

    Just in case, I'm going to upload the pictures.
    upload_2019-10-6_22-42-28.png
     
    Last edited by a moderator: Oct 6, 2019
  2. Offline

    timtower Moderator Moderator

    @W_Midoria Name in plugin.yml needs to be name, lowercase.
     
  3. Offline

    W_Midoria

    plugin.yml

    I changed source
    Code:
    Name: die
    version: 1.12.2
    main: diep.Main
    
    commands:
      die:
    Is it right?
    But I can't
    How can I solve this problem?
     
    Last edited by a moderator: Oct 7, 2019
  4. Offline

    timtower Moderator Moderator

  5. Offline

    W_Midoria

    oh thanks.. I solved thank, so thiank you...
     

Share This Page