1
Can someone help me with my plugin
i made my first plug in and i put it on a test server bukkit but it shows up no plugins heres the code http://pastebin.com/7W91rpRQ
4
i have been and thanks for the help
I didn't even need to put it into eclipse or anything to tell what was wrong, are you using notepad++ or something? I mean by the looks of this the whole file would have turned red...
You have uneaven amount of both brackets and braces, they are missplaced, you forgot to put a string in quotes "" and the capitlisation on the methods and classes are wrong in places, you have a variable with the same name as the class file(which i think may work but I wouldnt suggest it even if it does) and you forgot to import JavaPlugin so even if the code was working it wouldnt run
Basically your code should be this
Personally I would suggest taking a look at some bukkit tutorials or look at something like codecademy's basic java tutorials.
Edit: In eclipse things should turn red when starting to go wrong, it will either tell you what is wrong exactly, or tell you what is generally wrong such as with braces and you will have to find where to fix those
You have uneaven amount of both brackets and braces, they are missplaced, you forgot to put a string in quotes "" and the capitlisation on the methods and classes are wrong in places, you have a variable with the same name as the class file(which i think may work but I wouldnt suggest it even if it does) and you forgot to import JavaPlugin so even if the code was working it wouldnt run
Basically your code should be this
Click to reveal
package me.geekygeek293;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class Plugin extends JavaPlugin {
public static JavaPlugin Plugin plugin;
@Override
public void onEnable() {
this.getServer().getLogger().info("hello enable logger has been enabled");
}
@Override
public void onDisable(){
}
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (cmd.getName().equalsIgnoreCase("hello") && sender instanceof Player) {
Player player = (Player) sender;
player.sendMessage("Hello, " + player.getName() + "!");
return true;
}
return false;
}
}Personally I would suggest taking a look at some bukkit tutorials or look at something like codecademy's basic java tutorials.
Edit: In eclipse things should turn red when starting to go wrong, it will either tell you what is wrong exactly, or tell you what is generally wrong such as with braces and you will have to find where to fix those
bump
pls send me the fix and tell me what it was
