1

Can someone help me with my plugin

Gaming_gambler •11/18/15 4:36 pm
•
241
•
11/24/2015 1:25 pm
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
Posted by
Gaming_gambler
Level 5 : Apprentice System
1

  Have something to say?

Join • Sign in

4

Gaming_gambler
• 11/24/2015 1:25 pm
• Level 5 : Apprentice System
i have been and thanks for the help
1
sekwah41
• 11/22/2015 1:39 pm
He/Him • Level 89 : Elite Cyborg Senpai
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
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
1
Gaming_gambler
• 11/22/2015 12:59 pm
• Level 5 : Apprentice System
bump
1
Gaming_gambler
• 11/18/2015 4:36 pm
• Level 5 : Apprentice System
pls send me the fix and tell me what it was
1

Welcome