Compatibility
Minecraft: Java Edition
26.1.x
1.21.x
1.20.x
1.19.x
1.18.x
Platforms
Tags
Creators
Details
Licensed CC0-1.0
Published 3 months ago
LibertyOffline is an addon for LibertyBans that allows admins to issue warnings to players even when the player has logged off.
It does this by simply displaying all active warnings for a player every time they join the game, until they expire.
This plugin was born because I assumed LibertBans warnings were shown to warned players on join every time for the duration of the warning, so I warned players while they were offline, however they never saw the warning.
There is no configuration, no commands, just one feature I thought was default.
It's so simple that I won't bother creating a GitHub repo, other than all the boiler plate, the code is just:
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
UUID uuid = player.getUniqueId();
InetAddress ip = player.getAddress().getAddress();
// get all active warnings for player and IP
libertyBans.getSelector()
.selectionByApplicabilityBuilder(uuid, ip)
.build()
.getAllSpecificPunishments()
.thenAccept(punishments -> {
// "enforce" it which just displays warnings in chat
for (Punishment punishment : punishments) {
punishment.enforcePunishment();
}
});
}


