NametagEdit

721k Downloads

Can't clear Prefix with API

secapS opened this issue ยท 7 comments

commented

I tried setting the prefix to null and it doesn't change. It doesn't look like there is a way to clear it.

commented

The API does not accept null arguments. Null args are replaced with "". Ii can add in a method to clear the nametag, if you like.

commented

Try using the API method api.setNametag(player, null, null);. It will remove any prefix or suffix the player has. You can combine it with a getter method to maintain one or the other, like this: api.setNametag(player, null, api.getSuffix(player));

commented

Yes please sgtcaze.
Would it also be possible(sounds a little silly) to add method to save the new prefix/suffix/nametag to the current file system (whether it be Flatfile or MySQL).
I'd rather keep all my changes in the one place rather then setting up a separate DB or Config.

commented

@TagCraftMC You don't need separate databases or configs as long as the groups and permissions are within the same server, you can remotely connect to those servers and retrieve the same data.

Most shared hosts have their database server open remotely, so if you have multiple servers with them and you can create one database for each server. Just create one database and usually create it on your BungeeCord server and configure all your servers to remotely connect to that database. You can cross database/cross network as long as the database is open remotely.

commented

@TagCraftMC do you still need this? We may still add it on our next release.

commented

Setting the players prefix/suffix to null or a method to clear it? Yea, that would be great.

commented

Sorry for the delay. This has been added in this commit:

15e1846