© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
AdmincraftA
Admincraft•14mo ago•
29 replies
Biquaternions

How LuckPerms "predicts" permissions

This is not an issue, only something I was investigating for fun

I've been curious about how LuckPerms manages to "predict" permissions the server has available.
I made a very small single-file plugin to see this feature in action with just a single
Permissible.hasPermission(String)
Permissible.hasPermission(String)
function at the start of a command.
Apparently before trying to execute the command, luckperms is not yet aware of this permission, however after trying it once and opening the editor, it does show as a possible permission to choose.
This suggest that they might be caching permissions when
Permissible.hasPermission(String)
Permissible.hasPermission(String)
or similar functions are executed, however in their repo there isn't a clear reference to a cache on
hasPermission
hasPermission
, only on
addPermission
addPermission
.

I've been reading their repo for a while now, and learned a lot of how the plugin works but so far, no reference as how they resolve those permissions, closest I could find is
AsyncPermissionRegistry
AsyncPermissionRegistry
but there's nothing suggesting a possible cache.

This post is mostly for curiosity, if anyone had the same question and managed to find an answer before me.

This is the example plugin I made to test this:
class CrappyPlugin : JavaPlugin() {

    lateinit var self: CrappyPlugin

    override fun onLoad() {
        this.self = this
    }

    override fun onEnable() {
        this.server.commandMap.register("example", object : Command("canexecute"), PluginIdentifiableCommand {
            override fun execute(
                sender: CommandSender,
                label: String,
                args: Array<out String>?
            ): Boolean {
                if (sender.hasPermission("example.canexecute.test")) {
                    sender.sendMessage("Yes, you can execute")
                    return true
                }
                sender.sendMessage("No, you can't execute")
                return false
            }

            override fun getPlugin() = self

        })
    }

}
class CrappyPlugin : JavaPlugin() {

    lateinit var self: CrappyPlugin

    override fun onLoad() {
        this.self = this
    }

    override fun onEnable() {
        this.server.commandMap.register("example", object : Command("canexecute"), PluginIdentifiableCommand {
            override fun execute(
                sender: CommandSender,
                label: String,
                args: Array<out String>?
            ): Boolean {
                if (sender.hasPermission("example.canexecute.test")) {
                    sender.sendMessage("Yes, you can execute")
                    return true
                }
                sender.sendMessage("No, you can't execute")
                return false
            }

            override fun getPlugin() = self

        })
    }

}
image.png
Solution
I tried that and it lead me to
AsyncPermissionRegistry
AsyncPermissionRegistry
Jump to solution
AdmincraftJoin
10,704Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Recommended luckperms permissions?
AdmincraftAAdmincraft / questions
3y ago
Per-server permissions on Luckperms [bungee]
AdmincraftAAdmincraft / questions
3y ago
Luckperms asking for op regardless of permissions
AdmincraftAAdmincraft / questions
3y ago
Luckperms change group name and bulk edit permissions
AdmincraftAAdmincraft / questions
11mo ago