Scoreboard API problems

Discussion in 'Plugin Development' started by Creeoer, Nov 21, 2014.

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

    Creeoer

    Not sure what can possibly be wrong here, all I did was declare an Objective object and returned myself an Objective from the scoreboard's method. And now whenever I try to apply a method to the Objective I'm thrown with errors.

    On a side note: Anyone know what the first string argumenent for the registerNewObjective method is for?

    Code:
    import org.bukkit.Bukkit;
    import org.bukkit.scoreboard.Objective;
    import org.bukkit.scoreboard.Scoreboard;
    import org.bukkit.scoreboard.ScoreboardManager;
     
    public class ScoreBoardManager {
     
    ScoreboardManager manager = Bukkit.getScoreboardManager();
     
    Scoreboard board = manager.getNewScoreboard();
                                          //Not sure what the first argument here means
    Objective dollars = board.registerNewObjective("test?", "dummy");
    //dollars can be resolved as anything, despite the variable right above me
    dollars.setDisplaySlot(DisplaySlot.BELOW_NAME);
     
  2. Offline

    Funergy

    Creeoer The register new objective is
    registerNewObjective("<Custom objective name>", "<Type of objective like "dummy">")
     
  3. Offline

    Creeoer

    Funergy
    Thanks for the method insight for the first argument, but that doesn't solve my problem with the fact that dollars isn't being resolved as anything..
     
  4. Offline

    Gater12

    Creeoer
    That's not how the syntax works. You need to execute methods of an object in a method or constructor.
     
  5. Offline

    Creeoer

    Gater12
    Thanks, never put it in a constructor.
     
Thread Status:
Not open for further replies.

Share This Page