-
Notifications
You must be signed in to change notification settings - Fork 12
API: FPlayers
You can work with players extremely easily with the LegacyFactions API.
Use the FPlayers Collection Class (FPlayerColl) to get a list of all FPlayers:
List<FPlayer> fplayers = FPlayerColl.all();You can use this in a for loop like this:
for (FPlayer fplayer : FPlayerColl.all()) {
String name = fplayer.getName();
Faction faction = fplayer.getFaction();
Role role = fplayer.getRole();
}You can see all the methods for the FPlayer class right here on GitHub.
Want to take advantage of lambdas? The FPlayerColl in LegacyFactions provides this to you:
FPlayerColl.all(fplayer -> {
fplayer.sendMessage("hey!");
});You can also get a FPlayer by Player, OfflinePlayer, UUID, String id, or String name all from the one .get() method:
FPlayer fplayer = FPlayerColl.get(player);
FPlayer fplayer = FPlayerColl.get("name");
// ... etcThe .get() method will work it out for you. Easy, right?
📚 Looking for documentation? You're in the right place. Start with the items on the right of the page.
🐞 Found a bug? Please open a GitHub Issue.
🆘 Need help? Jump on our discord channel - we'll do our best to help 😄
⭐️ If you like LegacyFactions please leave a review and let others know!