user2980718
user2980718

Reputation: 1

Error at Minecraft Plugin

I've an error when I'm launching my minecraft server. The external library I'm using for the plugin is the recommended build craftbukkit-1.6.4-R2.0. I'm using the craftbukkit-1.6.4-R2.0 to launch the server and as the external library in eclipse(java).

This is some of the error that I'm receiving:

Could not load 'plugins\Test.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.ClassNotFoundException: me.Bench3.youtube.Youtube
    at org.bukkit.plugin.java.javaPluginloader.LoadPlugin(JavaPluginLoader.java:184)

and it continues.

Does anyone around here know how to fix this problem?

My code to the plugin is:

package me.Bench3.youtube;

import java.util.logging.Logger;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;

public class Youtube extends JavaPlugin{
    public final Logger logger = Logger.getLogger("Minecraft");
    public static Youtube plugin;

@Override
public void onDisable(){
    PluginDescriptionFile pdfFile = this.getDescription();
    this.logger.info(pdfFile.getName() + " Has been disabled!");
}

@Override
public void onEnable(){
    PluginDescriptionFile pdfFile = this.getDescription();
    this.logger.info(pdfFile.getName() + " Version " + pdfFile.getVersion() + " Has been enabled!"); //You
}

public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args)
{
    Player player = (Player) sender;
    if (commandLabel.equalsIgnoreCase("sendme"))
    {
        player.sendMessage(ChatColor.BLUE + "Sent");
    }
    return false;
}
}

This is my plugin.yml

main: me.Bench3.yotube.Youtube
name: Youtube
version: 1.0

Upvotes: 0

Views: 886

Answers (3)

AniSkywalker
AniSkywalker

Reputation: 459

I know this is a bit late, but you have to use bukkit.jar as your referenced library, not the server jar. Head over to http://dl.bukkit.org/downloads/bukkit/ to get the latest n greatest build for your referenced library.

Upvotes: 0

Welsar55
Welsar55

Reputation: 39

Its in the plugin.yml change it to me.Bench3.youtube.Youtub from me.Bench3.yotube.Youtub(you forgot a u)

Upvotes: 2

PaulProgrammer
PaulProgrammer

Reputation: 17620

The error your describe indicates your class me.Bench3.youtube.Youtube is not on the classpath. Make sure your jar/classes are on the classpath prior to executing the java application.

Upvotes: 1

Related Questions