PlayerData is undefined

Discussion in 'Spigot Plugin Development' started by pattyd14, May 28, 2015.

  1. I just started setting up my spigot eclipse workspace today, and I get the following error. I was hoping that somebody could help me out, as I believe I imported all of the necessary information.


    Code (Text):
    package tk.blockadenetwork.quickreport;

    import org.bukkit.entity.Player;
    import org.spigotmc.event.player.*;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.*;
    import org.spigotmc.*;

    public final class quickreport extends JavaPlugin{
        @Override
        public void onEnable() {
            for (Player player : Bukkit.getServer().getOnlinePlayers()) {
                playerList.put(player.getName(), playerData(player));
            }
            getLogger().info("[QuickReport] Reporting system is now active!");
        }

        @Override
        public void onDisable() {
            getLogger().info("[QuickReport] Reporting system disabled");
        }
    }

    I get the error:

    Code (Text):
    The method playerData(Player) is undefined
    I know that this is a very, very basic problem, but I am unable to find a solution. What am I missing here? Thanks :)
     
    • Agree Agree x 1
    • Winner Winner x 1
  2. I have experience with Java, so pointing me to a beginner tutorial is of no help. Please make an effort to answer the question, not point me to a beginner tutorial
     
  3. I'm pretty sure there is no protected/public field named playerList in the JavaPlugin, or PluginBase class. I highly suggest following the advice @not2excel gave instead of ignoring him out of ignorance.
     
  4. This: playerData(player)
    means you have a method called playerData, which requires a Player variable, which would look like:
    public Object playerData(Player player){
    }

    What exactly are you trying to do? Also, if this is your entire code, then you really should look at a few more beginner tutorials, as Skionz and not2excel pointed out, there are some pretty big issues with this code.
     
  5. Thank you. This isn't my entire code, just the main class.