Main class doen 't work

Discussion in 'Plugin Development' started by ramptoetsenbord, Aug 1, 2017.

Thread Status:
Not open for further replies.
  1. Offline


    Hello, I am making a plugin and i found out that the main class doesn 't work.
    Whenever i try to call an event it doesn 't do it.

    My main code:
    package me.bukkit.ServerSurvival;
    import java.util.logging.Logger;
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.PluginManager;
    public class SurvivalServer extends JavaPlugin {
        public void onEnable() {
            PluginDescriptionFile pdfFile = getDescription();
            Logger logger = getLogger();
   + " has been enabled!, version: " + pdfFile.getVersion() + "!");
        public void onDisable() {
        public void registerCommands() {
        public void registerEvents() {
            PluginManager pm = getServer().getPluginManager();
            pm.registerEvents(new PlayerJoin(), this);
            pm.registerEvents(new BlockBreak(), this);
        private void registerConfig() {
    If you need the code of one of my events to just ask!
  2. Offline

    timtower Administrator Administrator Moderator

    Moved to plugin development
    1. Don't log your own plugins, Bukkit does this for you.
    2. Your onDisable does nothing, please remove it. Same for registerCommands
    3. Please post your full server log using
  3. Offline


    @timtower @ramptoetsenbord
    Maybe a staff member can verify this for me but i believe that there was a article on here about having .bukkit inside of your package declaration. If i remember correctly it said something about bukkit ignoring packages containing .bukkit inside of this that aren't directly from the bukkit staff.

    Is your whole plugin unresponsive, or only the main class. If your whole plugin is unresponsive, try changing your package declaration to something similar to this
    package me.<yourusername>.<pluginname>
    For Example yours should look like this
    package me.ramptoetsenbord.serversurvival
    If its just your event classes that do not work, we will need to see them via pastebin
  4. Offline

    Jeyge third sticky from the top.
    FrostDevStudios likes this.
  5. @FrostDevStudios
    Actually, 'me' is very bad practice for packages. If you don't have a website, use the country code for your country as the tld, followed by your name. You can also alternatively reverse your email address if you find that the countrycode.yourname package was taken.

    From the Java Language Specification:
    FrostDevStudios and Jeyge like this.
  6. Offline


    Thanks y 'all!
    it works!
  7. Offline


    Good to know! When i was learning to program, I saw a-lot of tutorials that suggested using 'me' inside of your namespace (package declaration) so i assumed it was good practice. Anyways, I will no longer suggest this to anyone.


    No problem! Please make sure you mark this thread as solved
    Last edited: Aug 1, 2017
Thread Status:
Not open for further replies.

Share This Page