Is TabAPI working? Mine isn't. I don't have any code to provide at the moment, but only 3 lines I used was the setPriority method, update method and setTabString method. I followed the tutorial by the author, but it's not working. No errors in console either, everything else is working. Does anyone know if it's outdated or something?
Assist Post the error you are getting if there is one. Post the code you have. Edit: If you are testing your plugin behind a BungeeCord server it might not work... (Forgot the settings to make it work)
Goblom No errors as I said, also the code I'm using is the example code provided by the author, nothing else.
Assist Do you have something like this in your code ? Code:java TabAPI TabAPI = Bukkit.getServer().getPluginManager().getPlugin("TabAPI") If you don't that is probably why it is not working
Goblom No, I added the jar in the project library (properties -> build path -> referenced libraries).
Assist Just doing that wont work. The server needs TabAPIs instance just adding the jar and importing the code does nothing without the instance. Currently without that all your TabAPI Stuff is being thrown out for the garbage collector to get.
Goblom But you don't have to get the plugin instance like this. Make sure ProtocolLib and TabAPI are in your plugins folder. then add tabapi as a dependecy in your plugin.yml.
Goblom As this guy above me said, Also from the TabAPI developer page: Simply download TabAPI then add it to your class path. You are now ready to start coding with the TabAPI! ZachBora Janmm14 I have TabAPI and ProtocolLib in my plugins folder already. Edit: I don't know what happened, but it's working now. Edit2: Well I just noticed that the tab list can't contain 2 same strings.. how unfortunate, this really ruins my plan. Does anyone know a workaround for that?
Assist You can add spaces or colors at the end of the text. I believe however that TabAPI already has a function you can call for that.
ZachBora I guess the nextNull() is what you're talking about, I'll look into it later. I'm also having a slight problem with string placement, I'll post a screenshot and code later. Edit: So I wrote a quick test code Code:java for (int i = 0; i < alphaSortedMap.size(); i++) {TabAPI.setTabString(this, player, i, 0, "Player" + i);TabAPI.setTabString(this, player, i, 1, "Kills - " + new Random().nextInt(99) + 1);TabAPI.setTabString(this, player, i, 2, "Deaths - " + new Random().nextInt(99) + 1);TabAPI.nextNull();TabAPI.updatePlayer(player);} Here is how I want it to look like Spoiler (Move your mouse to the spoiler area to reveal the content) Show Spoiler Hide Spoiler View attachment 15600 But the spacing seems to be random, sometimes it looks like this Spoiler (Move your mouse to the spoiler area to reveal the content) Show Spoiler Hide Spoiler View attachment 15601 Most of the time it seems to be correct, but sometimes not. Does anyone have any idea what might cause this?
ZachBora I tried that, but it doesn't work. It definitely has to do with trying to use a string in the tab list that already exists, it messes up rest of the text. nextNull should work, as stated in the change log of the project. Exposed TabAPI.nextnull(); which returns a unique string which can be used to ensure a string is unique. For example, str + TabAPI.nextNull() wil ensure that str is unique Code:java for (int i = 0; i < alphaSortedMap.size(); i++) {TabAPI.setTabString(this, player, i, 0, "Player" + i);TabAPI.setTabString(this, player, i, 1, "Kills - 1" + TabAPI.nextNull());TabAPI.setTabString(this, player, i, 2, "Deaths - 1" + TabAPI.nextNull());} I tried to display several same "Kills - 1" and "Deaths - 1", though it fails to do so after the first one has been displayed. Thanks for the suggestions, got any more? Edit: I tried adding TabAPI.nextNull() before the string, and it indeed uses colors to make them unique, but it still fails after the first one. Edit2: I figured I'd just add a number (representing player id) behind their kills and deaths. Solved.