Solved Scoreboard Help?

Discussion in 'Plugin Development' started by CytrixMC, Aug 27, 2014.

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

    CytrixMC

    Hi Bukkit Forums. I lately been stumped on scoreboard for each player. By this I mean I would display statistics for each player such as Kills, Deaths, Coins, etc. I already know how to input data into the config file and displaying it into a scoreboard. I have tried doing this many times but it never worked out perfectly. I am now tired of wasting time and I decided to turn to the community!
     
    GrandmaJam likes this.
  2. Offline

    MarinD99

    May we see the code? Perhaps the errors that come along the way?
     
  3. Offline

    ProStriker123

    Can you show us your code soo we can help you?
     
  4. Offline

    CytrixMC

    I don't exactly know how to make a scoreboard for each individual player. Thats why asked for help.

    Code:
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.scoreboard.DisplaySlot;
    import org.bukkit.scoreboard.Objective;
    import org.bukkit.scoreboard.Score;
    import org.bukkit.scoreboard.ScoreboardManager;
     
    public class Scoreboard extends JavaPlugin implements Listener {
     
    public void onEnable(){
    getServer().getPluginManager().registerEvents(this, this);
     
    makeScoreboard();
    }
     
    Scoreboard board;
     
    public void makeScoreboard(Player p){
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    board = (Scoreboard) manager.getNewScoreboard();
     
    int inta = Bukkit.getOnlinePlayers().length;
    int intb = getConfig().getString(p.getName(), ".Coins").length();
    int intc = getConfig().getString(p.getName(), ".Kills").length();
    int intd = getConfig().getString(p.getName(), ".Deaths").length();
     
    Objective objective = ((org.bukkit.scoreboard.Scoreboard) board).registerNewObjective("Stats1", "Stats2");
    objective.setDisplayName(ChatColor.AQUA + "Example");
    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
     
    Score score = objective.getScore(ChatColor.GOLD + "Online: ");
    score.setScore(inta);
     
    Score score2 = objective.getScore(ChatColor.GOLD + "Coins: ");
    score2.setScore(intb);
     
    Score score3 = objective.getScore(ChatColor.GOLD + "Kills: ");
    score3.setScore(intc);
     
    Score score4 = objective.getScore(ChatColor.GOLD + "Deaths: ");
    score4.setScore(intd);
    }
     
    @EventHandler
    public void onjoin(PlayerJoinEvent e){
    e.getPlayer().setScoreboard((org.bukkit.scoreboard.Scoreboard) board);
    }
     
     
    }
    
    When I add Player parameters and I try to add the parameters in the onEnable method it which makes and error.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 10, 2016
  5. Offline

    ProStriker123

    CytrixMC can you show us the error to also please? and sorry for the delay on the response
     
  6. Offline

    CytrixMC

    ProStriker123

    Well I was told to use UUID's because 1.8 uses them and name changes can effect that. So here is the error

    Code:
    [FONT=Consolas][12:02:12] [Server thread/INFO]: Starting minecraft server version 1.7.9
    [12:02:12] [Server thread/INFO]: Loading properties
    [12:02:12] [Server thread/INFO]: Default game type: SURVIVAL
    [12:02:12] [Server thread/INFO]: Generating keypair
    [12:02:12] [Server thread/INFO]: Starting Minecraft server on *:25565
    [12:02:13] [Server thread/INFO]: This server is running CraftBukkit version git-Bukkit-1.7.9-R0.1-b3084jnks (MC: 1.7.9) (Implementing API version 1.7.9-R0.1)
    [12:02:13] [Thread-7/INFO]: ----- Bukkit Auto Updater -----
    [12:02:13] [Thread-7/INFO]: It appears that you're running a Beta Build, when you've specified in bukkit.yml that you prefer to run Recommended Builds.
    [12:02:13] [Thread-7/INFO]: If you would like to be kept informed about new Beta Build releases, it is recommended that you change 'preferred-channel' in your bukkit.yml to 'beta'.
    [12:02:13] [Thread-7/INFO]: With that set, you will be told whenever a new version is available for download, so that you can always keep up to date and secure with the latest fixes.
    [12:02:13] [Thread-7/INFO]: If you would like to disable this warning, simply set 'suggest-channels' to false in bukkit.yml.
    [12:02:13] [Thread-7/INFO]: ----- ------------------- -----
    [12:02:14] [Server thread/INFO]: [FreeForAll] Loading FreeForAll v1.0
    [12:02:14] [Server thread/INFO]: [WorldEdit] Loading WorldEdit v5.5.8
    [12:02:14] [Server thread/INFO]: [ProtocolLib] Loading ProtocolLib v3.4.0
    [12:02:14] [Server thread/WARN]: [ProtocolLib] Version (MC: 1.7.9) has not yet been tested! Proceed with caution.
    [12:02:14] [Server thread/INFO]: [Multiverse-Core] Loading Multiverse-Core v2.4-b527
    [12:02:14] [Server thread/INFO]: [iControlU] Loading iControlU v1.7.0
    [12:02:14] [Server thread/INFO]: [LibsDisguises] Loading LibsDisguises v8.2.6
    [12:02:14] [Server thread/INFO]: [GalaxyFFA] Loading GalaxyFFA v1.0
    [12:02:14] [Server thread/INFO]: [BarAPI] Loading BarAPI v3.1
    [12:02:14] [Server thread/INFO]: [VoxelSniper] Loading VoxelSniper v5.170.0-SNAPSHOT-jnks317-gitfcb8fe1
    [12:02:14] [Server thread/INFO]: [WorldGuard] Loading WorldGuard v5.9
    [12:02:14] [Server thread/INFO]: [KlarityCoins] Loading KlarityCoins v1.0
    [12:02:14] [Server thread/INFO]: [Essentials] Loading Essentials v2.13.1
    [12:02:14] [Server thread/INFO]: [EssentialsSpawn] Loading EssentialsSpawn v2.13.1
    [12:02:14] [Server thread/INFO]: [ProtocolLib] Enabling ProtocolLib v3.4.0
    [12:02:14] [Server thread/INFO]: [ProtocolLib] Started structure compiler thread.
    [12:02:14] [Server thread/INFO]: Preparing level "world"
    [12:02:14] [Server thread/INFO]: Preparing start region for level 0 (Seed: 7442025355649778218)
    [12:02:15] [Server thread/INFO]: Preparing spawn area: 41%
    [12:02:15] [Server thread/INFO]: Preparing start region for level 1 (Seed: 7442025355649778218)
    [12:02:16] [Server thread/INFO]: Preparing start region for level 2 (Seed: 7442025355649778218)
    [12:02:17] [Server thread/INFO]: [FreeForAll] Enabling FreeForAll v1.0
    [12:02:17] [Server thread/INFO]: [WorldEdit] Enabling WorldEdit v5.5.8
    [12:02:18] [Server thread/INFO]: WEPIF: Using the Bukkit Permissions API.
    [12:02:18] [Server thread/INFO]: [Multiverse-Core] Enabling Multiverse-Core v2.4-b527
    [12:02:18] [Server thread/INFO]: [Multiverse-Core] - Version 2.4-b527 (API v14) Enabled - By Rigby, fernferret, lithium3141 and main--
    [12:02:18] [Server thread/INFO]: [AllPay] - Version 10.0 - hooked into Essentials Economy for Multiverse-Core v2.4-b527
    [12:02:19] [Server thread/INFO]: [Multiverse-Core] Loading World & Settings - 'world' - Env: NORMAL - Type: NORMAL & seed: 7442025355649778218
    [12:02:19] [Server thread/INFO]: [Multiverse-Core] Loading World & Settings - 'world_nether' - Env: NETHER - Type: NORMAL & seed: 7442025355649778218
    [12:02:19] [Server thread/INFO]: [Multiverse-Core] Loading World & Settings - 'world_the_end' - Env: THE_END - Type: NORMAL & seed: 7442025355649778218
    [12:02:19] [Server thread/INFO]: [Multiverse-Core] Loading World & Settings - 'FreeForAll' - Env: NORMAL - Type: FLAT & seed: 1008628003248201996
    [12:02:19] [Server thread/INFO]: Preparing start region for level 3 (Seed: 1008628003248201996)
    [12:02:20] [Server thread/INFO]: [Multiverse-Core] Loading World & Settings - 'FFAWorld2' - Env: NORMAL - Type: FLAT & seed: -6215306014615410393
    [12:02:20] [Server thread/INFO]: Preparing start region for level 4 (Seed: -6215306014615410393)
    [12:02:21] [Server thread/INFO]: [Multiverse-Core] 5 - World(s) loaded.
    [12:02:21] [Server thread/INFO]: [iControlU] Enabling iControlU v1.7.0
    [12:02:21] [Server thread/INFO]: [LibsDisguises] Enabling LibsDisguises v8.2.6
    [12:02:21] [Server thread/INFO]: [GalaxyFFA] Enabling GalaxyFFA v1.0
    [12:02:21] [Server thread/INFO]: [BarAPI] Enabling BarAPI v3.1
    [12:02:21] [Server thread/INFO]: [BarAPI] Loaded
    [12:02:21] [Server thread/INFO]: [VoxelSniper] Enabling VoxelSniper v5.170.0-SNAPSHOT-jnks317-gitfcb8fe1
    [12:02:21] [Server thread/INFO]: [VoxelSniper] Registered 75 Sniper Brushes with 149 handles.
    [12:02:21] [Server thread/INFO]: [VoxelSniper] Registered Sniper Listener.
    [12:02:21] [Server thread/INFO]: [WorldGuard] Enabling WorldGuard v5.9
    [12:02:21] [Server thread/INFO]: [WorldGuard] (world) TNT ignition is PERMITTED.
    [12:02:21] [Server thread/INFO]: [WorldGuard] (world) Lighters are PERMITTED.
    [12:02:21] [Server thread/INFO]: [WorldGuard] (world) Lava fire is blocked.
    [12:02:21] [Server thread/INFO]: [WorldGuard] (world) Fire spread is UNRESTRICTED.
    [12:02:21] [Server thread/INFO]: [WorldGuard] Loaded configuration for world 'world'
    [12:02:21] [Server thread/INFO]: [WorldGuard] (world_nether) TNT ignition is PERMITTED.
    [12:02:21] [Server thread/INFO]: [WorldGuard] (world_nether) Lighters are PERMITTED.
    [12:02:21] [Server thread/INFO]: [WorldGuard] (world_nether) Lava fire is blocked.
    [12:02:21] [Server thread/INFO]: [WorldGuard] (world_nether) Fire spread is UNRESTRICTED.
    [12:02:21] [Server thread/INFO]: [WorldGuard] Loaded configuration for world 'world_nether'
    [12:02:21] [Server thread/INFO]: [WorldGuard] (world_the_end) TNT ignition is PERMITTED.
    [12:02:21] [Server thread/INFO]: [WorldGuard] (world_the_end) Lighters are PERMITTED.
    [12:02:21] [Server thread/INFO]: [WorldGuard] (world_the_end) Lava fire is blocked.
    [12:02:21] [Server thread/INFO]: [WorldGuard] (world_the_end) Fire spread is UNRESTRICTED.
    [12:02:21] [Server thread/INFO]: [WorldGuard] Loaded configuration for world 'world_the_end'
    [12:02:21] [Server thread/INFO]: [WorldGuard] (FreeForAll) TNT ignition is PERMITTED.
    [12:02:21] [Server thread/INFO]: [WorldGuard] (FreeForAll) Lighters are PERMITTED.
    [12:02:21] [Server thread/INFO]: [WorldGuard] (FreeForAll) Lava fire is blocked.
    [12:02:21] [Server thread/INFO]: [WorldGuard] (FreeForAll) Fire spread is UNRESTRICTED.
    [12:02:21] [Server thread/INFO]: [WorldGuard] Loaded configuration for world 'FreeForAll'
    [12:02:21] [Server thread/INFO]: [WorldGuard] (FFAWorld2) TNT ignition is PERMITTED.
    [12:02:21] [Server thread/INFO]: [WorldGuard] (FFAWorld2) Lighters are PERMITTED.
    [12:02:21] [Server thread/INFO]: [WorldGuard] (FFAWorld2) Lava fire is blocked.
    [12:02:21] [Server thread/INFO]: [WorldGuard] (FFAWorld2) Fire spread is UNRESTRICTED.
    [12:02:21] [Server thread/INFO]: [WorldGuard] Loaded configuration for world 'FFAWorld2'
    [12:02:21] [Server thread/INFO]: [WorldGuard] 0 regions loaded for 'world'
    [12:02:21] [Server thread/INFO]: [WorldGuard] 0 regions loaded for 'world_nether'
    [12:02:21] [Server thread/INFO]: [WorldGuard] 0 regions loaded for 'world_the_end'
    [12:02:21] [Server thread/INFO]: [WorldGuard] 0 regions loaded for 'FreeForAll'
    [12:02:21] [Server thread/INFO]: [WorldGuard] 0 regions loaded for 'FFAWorld2'
    [12:02:21] [Server thread/INFO]: [KlarityCoins] Enabling KlarityCoins v1.0
    [12:02:21] [Server thread/INFO]: [Essentials] Enabling Essentials v2.13.1
    [12:02:22] [Server thread/INFO]: Essentials: Using config file enhanced permissions.
    [12:02:22] [Server thread/INFO]: Permissions listed in as player-commands will be given to all users.
    [12:02:22] [Server thread/INFO]: [EssentialsSpawn] Enabling EssentialsSpawn v2.13.1
    [12:02:22] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
    [12:02:22] [Server thread/INFO]: Done (8.101s)! For help, type "help" or "?"
    [12:02:23] [Server thread/INFO]: [0;34;1m[ProtocolLib] The updater did not find an update, and nothing was downloaded.[m
    [12:03:15] [User Authenticator #1/INFO]: UUID of player CytrixMC is 5d43cf77-3dd5-4b93-a923-c4fa45002b6b
    [12:03:15] [Server thread/INFO]: [0;37;22m?[0;35;1mFFA[0;37;22m? [0;33;22m| [0;36;22mCytrixMC[0;37;22m has joined [0;31;22mKlarity [0;36;1mFFA![m
    [12:03:15] [Server thread/INFO]: [21m[0;37;22m?[0;36;1mGalaxyPvP[0;37;22m? [21m[0;32;1mJOIN[0;37;22mCytrixMC[m
    [12:03:15] [Server thread/ERROR]: Could not pass event PlayerJoinEvent to KlarityCoins v1.0
    org.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:294) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:501) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:486) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.PlayerList.c(PlayerList.java:251) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.PlayerList.a(PlayerList.java:138) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.LoginListener.c(LoginListener.java:76) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.LoginListener.a(LoginListener.java:42) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:160) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.ServerConnection.c(SourceFile:134) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:667) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:260) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:558) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:469) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    Caused by: java.lang.IllegalArgumentException: Scoreboard cannot be null
    at org.apache.commons.lang.Validate.notNull(Validate.java:203) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer.setScoreboard(CraftPlayer.java:1214) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at me.CytrixMC.KlarityCoins.Coins.onJoin(Coins.java:71) ~[?:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_51]
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:292) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    ... 14 more
    [12:03:15] [Server thread/INFO]: CytrixMC[/24.185.37.239:57231] logged in with entity id 584 at ([FFAWorld2] 443.66986465790194, 5.0, 88.16573312402042)
    [12:10:27] [Server thread/INFO]: [EssentialsSpawn] Disabling EssentialsSpawn v2.13.1
    [12:10:27] [Server thread/INFO]: [Essentials] Disabling Essentials v2.13.1
    [12:10:27] [Server thread/INFO]: [KlarityCoins] Disabling KlarityCoins v1.0
    [12:10:27] [Server thread/INFO]: [WorldGuard] Disabling WorldGuard v5.9
    [12:10:27] [Server thread/INFO]: [VoxelSniper] Disabling VoxelSniper v5.170.0-SNAPSHOT-jnks317-gitfcb8fe1
    [12:10:27] [Server thread/INFO]: [BarAPI] Disabling BarAPI v3.1
    [12:10:27] [Server thread/INFO]: [GalaxyFFA] Disabling GalaxyFFA v1.0
    [12:10:27] [Server thread/INFO]: [LibsDisguises] Disabling LibsDisguises v8.2.6
    [12:10:27] [Server thread/INFO]: [iControlU] Disabling iControlU v1.7.0
    [12:10:27] [Server thread/INFO]: [Multiverse-Core] Disabling Multiverse-Core v2.4-b527
    [12:10:27] [Server thread/INFO]: [Multiverse-Core] - Disabled
    [12:10:27] [Server thread/INFO]: [ProtocolLib] Disabling ProtocolLib v3.4.0
    [12:10:28] [Server thread/INFO]: [WorldEdit] Disabling WorldEdit v5.5.8
    [12:10:28] [Server thread/INFO]: [FreeForAll] Disabling FreeForAll v1.0
    [12:10:28] [Server thread/INFO]: [FreeForAll] Loading FreeForAll v1.0
    [12:10:28] [Server thread/INFO]: [WorldEdit] Loading WorldEdit v5.5.8
    [12:10:28] [Server thread/INFO]: [ProtocolLib] Loading ProtocolLib v3.4.0
    [12:10:28] [Server thread/WARN]: [ProtocolLib] Version (MC: 1.7.9) has not yet been tested! Proceed with caution.
    [12:10:28] [Server thread/INFO]: [Multiverse-Core] Loading Multiverse-Core v2.4-b527
    [12:10:28] [Server thread/INFO]: [iControlU] Loading iControlU v1.7.0
    [12:10:28] [Server thread/INFO]: [LibsDisguises] Loading LibsDisguises v8.2.6
    [12:10:28] [Server thread/INFO]: [GalaxyFFA] Loading GalaxyFFA v1.0
    [12:10:28] [Server thread/INFO]: [BarAPI] Loading BarAPI v3.1
    [12:10:28] [Server thread/INFO]: [VoxelSniper] Loading VoxelSniper v5.170.0-SNAPSHOT-jnks317-gitfcb8fe1
    [12:10:28] [Server thread/INFO]: [WorldGuard] Loading WorldGuard v5.9
    [12:10:28] [Server thread/INFO]: [KlarityCoins] Loading KlarityCoins v1.0
    [12:10:28] [Server thread/INFO]: [Essentials] Loading Essentials v2.13.1
    [12:10:28] [Server thread/INFO]: [EssentialsSpawn] Loading EssentialsSpawn v2.13.1
    [12:10:28] [Server thread/INFO]: [ProtocolLib] Enabling ProtocolLib v3.4.0
    [12:10:28] [Server thread/INFO]: [ProtocolLib] Started structure compiler thread.
    [12:10:28] [Server thread/INFO]: [FreeForAll] Enabling FreeForAll v1.0
    [12:10:28] [Server thread/INFO]: [WorldEdit] Enabling WorldEdit v5.5.8
    [12:10:28] [Server thread/INFO]: WEPIF: Using the Bukkit Permissions API.
    [12:10:28] [Server thread/INFO]: [Multiverse-Core] Enabling Multiverse-Core v2.4-b527
    [12:10:28] [Server thread/INFO]: [Multiverse-Core] - Version 2.4-b527 (API v14) Enabled - By Rigby, fernferret, lithium3141 and main--
    [12:10:28] [Server thread/INFO]: [AllPay] - Version 10.0 - hooked into Essentials Economy for Multiverse-Core v2.4-b527
    [12:10:29] [Server thread/INFO]: [Multiverse-Core] Loading World & Settings - 'world' - Env: NORMAL - Type: NORMAL & seed: 7442025355649778218
    [12:10:29] [Server thread/INFO]: [Multiverse-Core] Loading World & Settings - 'world_nether' - Env: NETHER - Type: NORMAL & seed: 7442025355649778218
    [12:10:30] [Server thread/INFO]: [Multiverse-Core] Loading World & Settings - 'world_the_end' - Env: THE_END - Type: NORMAL & seed: 7442025355649778218
    [12:10:30] [Server thread/INFO]: [Multiverse-Core] Loading World & Settings - 'FreeForAll' - Env: NORMAL - Type: FLAT & seed: 1008628003248201996
    [12:10:30] [Server thread/INFO]: [Multiverse-Core] Loading World & Settings - 'FFAWorld2' - Env: NORMAL - Type: FLAT & seed: -6215306014615410393
    [12:10:30] [Server thread/INFO]: [Multiverse-Core] 5 - World(s) loaded.
    [12:10:30] [Server thread/INFO]: [iControlU] Enabling iControlU v1.7.0
    [12:10:30] [Server thread/INFO]: [LibsDisguises] Enabling LibsDisguises v8.2.6
    [12:10:30] [Server thread/INFO]: [GalaxyFFA] Enabling GalaxyFFA v1.0
    [12:10:30] [Server thread/INFO]: [BarAPI] Enabling BarAPI v3.1
    [12:10:30] [Server thread/INFO]: [BarAPI] Loaded
    [12:10:30] [Server thread/INFO]: [VoxelSniper] Enabling VoxelSniper v5.170.0-SNAPSHOT-jnks317-gitfcb8fe1
    [12:10:30] [Server thread/INFO]: [VoxelSniper] Registered 75 Sniper Brushes with 149 handles.
    [12:10:30] [Server thread/INFO]: [VoxelSniper] Registered Sniper Listener.
    [12:10:31] [Server thread/INFO]: [WorldGuard] Enabling WorldGuard v5.9
    [12:10:31] [Server thread/INFO]: [WorldGuard] (world) TNT ignition is PERMITTED.
    [12:10:31] [Server thread/INFO]: [WorldGuard] (world) Lighters are PERMITTED.
    [12:10:31] [Server thread/INFO]: [WorldGuard] (world) Lava fire is blocked.
    [12:10:31] [Server thread/INFO]: [WorldGuard] (world) Fire spread is UNRESTRICTED.
    [12:10:31] [Server thread/INFO]: [WorldGuard] Loaded configuration for world 'world'
    [12:10:31] [Server thread/INFO]: [WorldGuard] (world_nether) TNT ignition is PERMITTED.
    [12:10:31] [Server thread/INFO]: [WorldGuard] (world_nether) Lighters are PERMITTED.
    [12:10:31] [Server thread/INFO]: [WorldGuard] (world_nether) Lava fire is blocked.
    [12:10:31] [Server thread/INFO]: [WorldGuard] (world_nether) Fire spread is UNRESTRICTED.
    [12:10:31] [Server thread/INFO]: [WorldGuard] Loaded configuration for world 'world_nether'
    [12:10:31] [Server thread/INFO]: [WorldGuard] (world_the_end) TNT ignition is PERMITTED.
    [12:10:31] [Server thread/INFO]: [WorldGuard] (world_the_end) Lighters are PERMITTED.
    [12:10:31] [Server thread/INFO]: [WorldGuard] (world_the_end) Lava fire is blocked.
    [12:10:31] [Server thread/INFO]: [WorldGuard] (world_the_end) Fire spread is UNRESTRICTED.
    [12:10:31] [Server thread/INFO]: [WorldGuard] Loaded configuration for world 'world_the_end'
    [12:10:31] [Server thread/INFO]: [WorldGuard] (FreeForAll) TNT ignition is PERMITTED.
    [12:10:31] [Server thread/INFO]: [WorldGuard] (FreeForAll) Lighters are PERMITTED.
    [12:10:31] [Server thread/INFO]: [WorldGuard] (FreeForAll) Lava fire is blocked.
    [12:10:31] [Server thread/INFO]: [WorldGuard] (FreeForAll) Fire spread is UNRESTRICTED.
    [12:10:31] [Server thread/INFO]: [WorldGuard] Loaded configuration for world 'FreeForAll'
    [12:10:31] [Server thread/INFO]: [WorldGuard] (FFAWorld2) TNT ignition is PERMITTED.
    [12:10:31] [Server thread/INFO]: [WorldGuard] (FFAWorld2) Lighters are PERMITTED.
    [12:10:31] [Server thread/INFO]: [WorldGuard] (FFAWorld2) Lava fire is blocked.
    [12:10:31] [Server thread/INFO]: [WorldGuard] (FFAWorld2) Fire spread is UNRESTRICTED.
    [12:10:31] [Server thread/INFO]: [WorldGuard] Loaded configuration for world 'FFAWorld2'
    [12:10:31] [Server thread/INFO]: [WorldGuard] 0 regions loaded for 'world'
    [12:10:31] [Server thread/INFO]: [WorldGuard] 0 regions loaded for 'world_nether'
    [12:10:31] [Server thread/INFO]: [WorldGuard] 0 regions loaded for 'world_the_end'
    [12:10:31] [Server thread/INFO]: [WorldGuard] 0 regions loaded for 'FreeForAll'
    [12:10:31] [Server thread/INFO]: [WorldGuard] 0 regions loaded for 'FFAWorld2'
    [12:10:31] [Server thread/INFO]: [KlarityCoins] Enabling KlarityCoins v1.0
    [12:10:31] [Server thread/INFO]: [Essentials] Enabling Essentials v2.13.1
    [12:10:31] [Server thread/INFO]: Essentials: Using config file enhanced permissions.
    [12:10:31] [Server thread/INFO]: Permissions listed in as player-commands will be given to all users.
    [12:10:31] [Server thread/INFO]: [EssentialsSpawn] Enabling EssentialsSpawn v2.13.1
    [12:10:31] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
    [12:10:31] [Server thread/INFO]: CONSOLE: [0;32;1mReload complete.[m
    [12:10:31] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 4134ms behind, skipping 82 tick(s)
    [12:10:33] [Server thread/INFO]: CytrixMC lost connection: Disconnected
    [12:10:33] [Server thread/INFO]: [0;37;22m?[0;35;1mFFA[0;37;22m? [0;33;22m| [0;37;22mCytrixMC[0;35;1m has left [21m[0;31;22mKlarity [0;36;1mFFA![m
    [12:10:33] [Server thread/INFO]: [21m[0;37;22m?[0;36;1mGalaxyPvP[0;37;22m? [21m[0;31;1mLEAVE[0;37;22mCytrixMC[m
    [12:10:33] [Server thread/INFO]: CytrixMC left the game.
    [12:10:35] [User Authenticator #2/INFO]: UUID of player CytrixMC is 5d43cf77-3dd5-4b93-a923-c4fa45002b6b
    [12:10:35] [Server thread/INFO]: [0;37;22m?[0;35;1mFFA[0;37;22m? [0;33;22m| [0;36;22mCytrixMC[0;37;22m has joined [0;31;22mKlarity [0;36;1mFFA![m
    [12:10:35] [Server thread/INFO]: [21m[0;37;22m?[0;36;1mGalaxyPvP[0;37;22m? [21m[0;32;1mJOIN[0;37;22mCytrixMC[m
    [12:10:35] [Server thread/ERROR]: Could not pass event PlayerJoinEvent to KlarityCoins v1.0
    org.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:294) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:501) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:486) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.PlayerList.c(PlayerList.java:251) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.PlayerList.a(PlayerList.java:138) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.LoginListener.c(LoginListener.java:76) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.LoginListener.a(LoginListener.java:42) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:160) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.ServerConnection.c(SourceFile:134) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:667) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:260) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:558) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:469) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    Caused by: java.lang.IllegalArgumentException: Scoreboard cannot be null
    at org.apache.commons.lang.Validate.notNull(Validate.java:203) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer.setScoreboard(CraftPlayer.java:1214) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    at me.CytrixMC.KlarityCoins.Coins.onJoin(Coins.java:71) ~[?:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_51]
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:292) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-b3084jnks]
    ... 14 more
    [12:10:35] [Server thread/INFO]: CytrixMC[/24.185.37.239:57771] logged in with entity id 1027 at ([FFAWorld2] 437.25731367079277, 6.65658248110962, 98.90889745593749)[/FONT]
    
    ProStriker123

    Here is the updated code

    Code:
    [FONT=Consolas]package me.CytrixMC.KlarityCoins;
     
     
    import java.util.HashMap;
    import java.util.UUID;
     
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.entity.PlayerDeathEvent;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.scoreboard.DisplaySlot;
    import org.bukkit.scoreboard.Objective;
    import org.bukkit.scoreboard.Score;
    import org.bukkit.scoreboard.Scoreboard;
    import org.bukkit.scoreboard.ScoreboardManager;
     
     
    public class Coins extends JavaPlugin implements Listener {
     
    Scoreboard board;
     
    HashMap<UUID, Scoreboard> uuidboard = new HashMap<UUID, Scoreboard>();
     
    public void onEnable(){
    this.getCommand("coins").setExecutor(new CoinsCommand(this));
    getServer().getPluginManager().registerEvents(this, this);
    }
     
     
    @SuppressWarnings("deprecation")
    public void showScoreboard(Player player) {
     
    UUID p = player.getUniqueId();
     
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    Scoreboard board = manager.getNewScoreboard();
     
     
    int a = Bukkit.getOnlinePlayers().length;
    String b = getConfig().getString(Bukkit.getPlayer(p).getName(), ".Coins");
     
    Objective objective = board.registerNewObjective("test", "stats");
    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    objective.setDisplayName(ChatColor.RED + "Klarity " + ChatColor.GOLD + "FFA");
     
    //Online Score
    Score score1 = objective.getScore(Bukkit.getOfflinePlayer(ChatColor.GREEN + "Online:"));
    Score score1int = objective.getScore(Bukkit.getOfflinePlayer(ChatColor.WHITE + "" + a));
    score1.setScore(4);
    score1int.setScore(3);
     
    //Coins Score
    Score score2 = objective.getScore(Bukkit.getOfflinePlayer(ChatColor.GOLD + "Coins"));
    Score score2int = objective.getScore(Bukkit.getOfflinePlayer(ChatColor.WHITE + "" + b));
    score2.setScore(2);
    score2int.setScore(1);
     
    }
     
     
     
    @EventHandler
    public void onJoin(PlayerJoinEvent e){
    Player p = e.getPlayer();
    if(p instanceof Player){
    //Scoreboard Set
    e.getPlayer().setScoreboard(board);
     
    //Coins Config Data
    if(!getConfig().contains(p.getName())){
    getConfig().set(p.getUniqueId() + ".Coins", 0);
    }
     
    }
    }
     
     
    @EventHandler
    public void onKill(PlayerDeathEvent e){
    if(e.getEntity() instanceof Player){
    Player p = (Player) e.getEntity();
    if(e.getEntity().getKiller() instanceof Player){
    Player k = p.getKiller();
    addCoins(k, 1);
    }
    }
     
    if(e.getEntity() instanceof Player){
    Player p = (Player) e.getEntity();
    if(e.getEntity().getKiller() instanceof Player){
    removeCoins(p, 1);
    }
    }
    }
     
    public void addCoins(Player p, int i){
    getConfig().set(p.getUniqueId() + ".Coins", getConfig().getInt(p.getUniqueId() + ".Coins", 0) + i);
    saveConfig();
    }
     
    public void removeCoins(Player p, int i){
    if(getConfig().getInt(p.getUniqueId() + ".Coins") == 0){
    return;
    } else {
    getConfig().set(p.getUniqueId() + ".Coins", getConfig().getInt(p.getUniqueId() + ".Coins", 0) - i);
    saveConfig();
    }
    }
     
    public void onDisable(){
     
    }
     
     
    }[/FONT]
    
    I hope you can help.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 10, 2016
Thread Status:
Not open for further replies.

Share This Page