NametagEdit

721k Downloads

API method getPrefix() not working.

MonsterDeveloper opened this issue ยท 2 comments

commented

Bug Report

Type /ver NametagEdit and post the output.
version 4.1.7

What version of Bukkit/Spigot/PaperSpigot are you using? Type /ver
Spigot 1.8.8-R0.1-SNAPSHOT

What plugins are you using? Type /plugins
MyCustomPlugin, PermissionsEx, SkinRestorer, ViaVersion, NametagEdit, Tablist

Please explain your issue. How do you trigger it?
In MyCustomPlugin on PlayerJoinEvent I call player.setJoinMessage("Welcome, " + NametagEdit.getApi().getNametag(player).getPrefix() + player.getName()), but the prefix is just empty String. Suffix doesn't work too(

Are there any errors in the console? Please use: https://pastebin.com
Nope, but here is my code: https://pastebin.com/FmT390Wv

commented

Yeah, I think it would be great. But now I do if (player.hasPermission("nte.vip")) and detect prefix, but cons is that if you change prefix you must change it in groups.yml and in the plugin.

commented

The issue is that NametagEdit loads nametags after the PlayerJoinEvent fires. This is because we asynchronously load this data from the file/database. You could potentially add a delay, or perhaps we could make a method to retrieve this information in the form of a callback. Otherwise we sacrifice performance.