Better Whitelist
Better Whitelist provides a flexible whitelist system for your Minecraft server that can be customized to meet specific needs.
Installation Requirements: The mod must be installed both on the server and on all clients connecting to it.
Configuration via μScript: Whitelist configuration is done using the μScript language, but no deep programming knowledge is required to work with it. When you first start the server with the mod installed, a configuration file with detailed instructions is automatically created.
Example Simple Configuration:
// convert a mod to a simplified representation to save bandwidth
simplify = { mod -> { id = mod.id, version = mod.version } }
// all non-server mods present on the server
sharedMods = mods::values()
::filter({ v -> v.environment != 'server' & v.id != 'java' })
::map(simplify)
// check if the client has the correct versions of all non-server mods from the server
clientMissing = challenge({ arg ->
arg::filter({ v -> !mods::values()::anyMatch({ m -> v.id == m.id & v.version == m.version }) })
}, sharedMods)
assert(clientMissing::isEmpty(), 'You lack required mods: ' || clientMissing)
// check that the client has no additional mods that are required on the server
clientAdditional = challenge({ arg, fn ->
clientSideMods = mods::values()::filter({ v -> v.environment != 'client' & v.id != 'java' })
clientSideMods::filter({ v -> !arg::anyMatch({ m -> v.id == m.id & v.version == m.version }) })::map(fn)
}, sharedMods, simplify)
assert(clientAdditional::isEmpty(), 'You have unsupported mods: ' || clientAdditional)
// filter resource packs to block X-Ray packs
bannedWords = listOf('xray', 'x-ray', 'cheat')
assert(!challenge({ ->
resourcePacks::map({ pack -> pack.name || ' ' || pack.displayName || ' ' || pack.description })
})::anyMatch({ v -> bannedWords::anyMatch({ word -> v::toLower()::contains(word) }) }), "Please don't cheat, " || user.name)
Available Features in Scripts:
- All methods from the μScript standard library (including date/time operations, allowing you to create temporary whitelists, blacklists, or countdowns)
resourcePacks(client only): list of resource packs with fieldsname,displayName, anddescriptionprintln('message')(both): debugging functionmods(both): list of loaded mods with the same fields as the result ofmod()mod('id')(both): information about a specific mod (or null):id,name,description,authors(list of strings),contributors(list of strings),version,environment(client,server, or*),license,contact(same as FMJ),depends(list of strings)assert(bool)(server): condition check with player kick on false result (optionally add a message as the second parameter)challenge({->closure}, additional arguments...)(server): send a closure to the client for execution there. Arguments may contain other closures.user(server): information about the user trying to log in, specifically theiridandname