Solved Simple plugin, yet failing to enable?

Discussion in 'Spigot Plugin Development' started by soccerplayer, May 29, 2017.

  1. For some reason this plugin keeps coming up with this error message:

    Code (Text):
    [21:48:13] [Server thread/ERROR]: Could not load 'plugins\Freeze.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: name 'Freeze!' contains invalid characters.
        at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:894) ~[spigot.jar:git-Spigot-7d78b81-775f1e1]
        at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:232) ~[spigot.jar:git-Spigot-7d78b81-775f1e1]
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:157) ~[spigot.jar:git-Spigot-7d78b81-775f1e1]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [spigot.jar:git-Spigot-7d78b81-775f1e1]
        at org.bukkit.craftbukkit.v1_11_R1.CraftServer.loadPlugins(CraftServer.java:301) [spigot.jar:git-Spigot-7d78b81-775f1e1]
        at org.bukkit.craftbukkit.v1_11_R1.CraftServer.reload(CraftServer.java:748) [spigot.jar:git-Spigot-7d78b81-775f1e1]
        at org.bukkit.Bukkit.reload(Bukkit.java:540) [spigot.jar:git-Spigot-7d78b81-775f1e1]
        at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [spigot.jar:git-Spigot-7d78b81-775f1e1]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [spigot.jar:git-Spigot-7d78b81-775f1e1]
        at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchCommand(CraftServer.java:650) [spigot.jar:git-Spigot-7d78b81-775f1e1]
        at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchServerCommand(CraftServer.java:636) [spigot.jar:git-Spigot-7d78b81-775f1e1]
        at net.minecraft.server.v1_11_R1.DedicatedServer.aM(DedicatedServer.java:437) [spigot.jar:git-Spigot-7d78b81-775f1e1]
        at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:400) [spigot.jar:git-Spigot-7d78b81-775f1e1]
        at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:675) [spigot.jar:git-Spigot-7d78b81-775f1e1]
        at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:574) [spigot.jar:git-Spigot-7d78b81-775f1e1]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
    [21:48:13] [Server thread/INFO]: [MOTD] Loading MOTD v1.2
    [21:48:13] [Server thread/INFO]: [Teleportation] Loading Teleportation v1.0
    [21:48:13] [Server thread/INFO]: [Vault] Loading Vault v1.5.6-b49
    [21:48:13] [Server thread/INFO]: [Inventories] Loading Inventories v1.0
    [21:48:13] [Server thread/INFO]: [Essentials] Loading Essentials v2.0.1-b473
    [21:48:13] [Server thread/INFO]: [Vault] Enabling Vault v1.5.6-b49
    [21:48:13] [Server thread/INFO]: [Vault] [Economy] Essentials Economy found: Waiting
    [21:48:14] [Server thread/INFO]: [Vault] [Permission] SuperPermissions loaded as backup permission system.
    [21:48:14] [Server thread/INFO]: [Vault] Enabled Version 1.5.6-b49
    [21:48:14] [Server thread/INFO]: [MOTD] Enabling MOTD v1.2
    [21:48:14] [Server thread/INFO]: MOTD1.2 has been enabled
    [21:48:14] [Server thread/INFO]: [Teleportation] Enabling Teleportation v1.0
    [21:48:14] [Server thread/INFO]: Teleportation1.0 has been enabled
    [21:48:14] [Server thread/INFO]: [Inventories] Enabling Inventories v1.0
    [21:48:14] [Server thread/INFO]: Kits1.0 has been enabled
    [21:48:14] [Server thread/INFO]: [Essentials] Enabling Essentials v2.0.1-b473
    [21:48:14] [Server thread/INFO]: [Essentials] Using 1.8.3+ BlockStateMeta provider as mob spawner provider.
    [21:48:14] [Server thread/INFO]: [Essentials] Using Reflection based provider as spawn egg provider.
    [21:48:14] [Server thread/INFO]: [Essentials] Using 1.9+ BasePotionData provider as potion meta provider.
    [21:48:14] [Server thread/INFO]: Using locale en_US
    [21:48:14] [Server thread/INFO]: [Essentials] Starting Metrics. Opt-out using the global PluginMetrics config.
    [21:48:14] [Server thread/INFO]: [Vault][Economy] Essentials Economy hooked.
    [21:48:14] [Server thread/INFO]: [Essentials] Using config file enhanced permissions.
    [21:48:14] [Server thread/INFO]: [Essentials] Permissions listed in as player-commands will be given to all users.
    [21:48:14] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
    Here is my main file followed with my plugin.yml:
    Code (Text):
    package me.vendolius.freeze;

    import java.util.ArrayList;

    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerMoveEvent;
    import org.bukkit.plugin.java.JavaPlugin;

    public class Main extends JavaPlugin implements Listener {

        ArrayList<String> frozen = new ArrayList<String>();

        @EventHandler
        public void onPlayerMove(PlayerMoveEvent e) {
            Player p = e.getPlayer();
            if (frozen.contains(p.getName())) {
                e.setTo(e.getFrom());
                p.sendMessage(ChatColor.RED + "You are frozen!" + ChatColor.AQUA + "       Mwuahahahahah");
            }
        }

        public void onEnable() {

            Bukkit.getServer().getLogger().info("Freeze" + this.getDescription().getVersion() + " has been enabled");
            Bukkit.getServer().getPluginManager().registerEvents(this, this);
        }

        public void onDisable() {
            Bukkit.getServer().getLogger().info("Freeze" + this.getDescription().getVersion() + " has been disabled");
        }

        @SuppressWarnings("deprecation")
        public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {

            if (cmd.getName().equalsIgnoreCase("freeze")) {
                if (!(sender.hasPermission("freeze.set"))) { // Permission
                    sender.sendMessage(ChatColor.RED + "You are not permitted to use this command");
                    return true;
                }

                if (args.length == 0) {
                    sender.sendMessage(ChatColor.RED + "Please specify a player!");
                    return true;
                }
                Player target = Bukkit.getServer().getPlayer(args[0]);
                if (target == null) {
                    sender.sendMessage(ChatColor.RED + "Could not find player " + args[0] + "!");
                    return true;
                }
                if (frozen.contains(target.getName())) {
                    frozen.remove(target.getName());
                    sender.sendMessage(ChatColor.GREEN + "You have unfrozen " + target.getName());
                    if (sender instanceof Player) {
                        target.sendMessage(ChatColor.GREEN + sender.getName() + " has unfrozen you!");
                    } else {
                        target.sendMessage(ChatColor.GREEN + "The Console has unfrozen you!");
                    }
                    return true;
                }
                frozen.add(target.getName());
                sender.sendMessage(ChatColor.GREEN + "You have frozen " + target);
                if (sender instanceof Player) {
                    target.sendMessage(ChatColor.AQUA + sender.getName() + " has frozen you!");
                } else {
                    target.sendMessage(ChatColor.AQUA + "The Console has frozen you!");
                }

            }

            return true;
        }

    }
     
    Code (Text):
    main: me.vendolius.freeze.Main
    name: Freeze!
    author: vendolius
    version: 1.0
    description: freezes players
    commands:
      freeze:
        description: Freezes or unfreezes players
        usage: /<command>
    permissions:
      freeze.set:
        description: Freeze or unfreezes a player
        default: op
     
  2. Try removing the "!" at the end of "Freeze!" in your plugin.yml
     
  3. Wow, after all the hours spent trying to fix this, the solution was removing an exclamation point from a description..... Thank you for the help, damn ymls are picky.
     
  4. It does state the following in the error:
    Code (Text):
    org.bukkit.plugin.InvalidDescriptionException: name 'Freeze!' contains invalid characters.
    That should be a fairly good indication that the exclamation mark is een invalid. Try reading the errors next time, they're pretty handy. They always contains some sort of message, and then a full stacktrace that traces down to exact line of code where it goes wrong. They may look like alot of useless stuff at first, but they're really handy. :p
     
    • Agree Agree x 1

  5. As I see, you've made the plugin yourself and this is not the right place to report this. Post it HERE.
     
  6. is the issue.
     
  7. MiniDigger

    Supporter

    please read the thread before replying, this issue has been solved already.
     
  8. ah my bad
     
  9. I saw that line but for some reason it didn't click, I thought it was stating that there was a description error within the Freeze plugin. I didn't know that Freeze! name was the actual problem lol
     
  10. mathhulk

    mathhulk Retired Moderator
    Retired

    Moved to Spigot Plugin Development.