Repository navigation
1.8.0 - The Leaderboards Update
What's Changed
- Add placeholder api support by @Fedox-die-Ente in #37
- Leaderboards and more by @maximjsx in #40
- Introduced interactive hologram entities "InteractionBox" that respond to player interactions.
- Added customizable, multi-page leaderboard holograms with player head support and flexible formatting.
- Added player head rendering and caching utilities with asynchronous skin and head retrieval.
Breaking Changes in the API 🚨
If you are already using HologramLib's leaderboards, you MUST update your plugin before updating HologramLib on your server ⚠️
Everything regarding Leaderboards is new including imports!
Here is a small example:
Map<UUID, LeaderboardHologram.PlayerScore> scores = new HashMap<>();
LeaderboardHologram.LeaderboardOptions pvpOptions = LeaderboardHologram.LeaderboardOptions.builder()
.title("PvP Champions")
.suffix("Kills")
.showEmptyPlaces(false)
.maxDisplayEntries(10)
.sortOrder(LeaderboardHologram.SortOrder.DESCENDING)
.headMode(LeaderboardHologram.HeadMode.RESOURCEPACK)
.leaderboardType(LeaderboardHologram.LeaderboardType.ALL_PLAYER_HEADS)
.build();
LeaderboardHologram pvpLeaderboard = new LeaderboardHologram(pvpOptions, "pvp_lb");
pvpLeaderboard.setAllScores(scores);
/* You can combine the leaderboard with others in a paginated leaderboard
but you can also just spawn the pvpLeaderboard for example
directly using hologramManager.spawn(pvpLeaderboard, location)
*/
PagedLeaderboard pagedLeaderboard = new PagedLeaderboard("paged_holo")
.addPage(pvpLeaderboard)
.addPage(<... another page>)
.setArrowBackgrounds(pvpLeaderboard.getBackgroundHologram().getBackgroundColor())
.setLeftArrowText("<red><<")
.setRightArrowText("<red>>>")
.setArrowOffset(3.5)
.setClickSounds(Sound.BLOCK_AMETHYST_CLUSTER_FALL, Sound.BLOCK_AMETHYST_CLUSTER_FALL)
.addPage(economyLeaderboard)
.rotate(0);
hologramManager.spawn(pagedLeaderboard, location);For the resourcepack option you also need the resourcepack zip file from below on your server.
Note
The wiki was partially updated already
New Contributors
- @Fedox-die-Ente made their first contribution in #37
Full Changelog: 1.7.7...1.8.0