LuckPerms

LuckPerms

41.4k Downloads

Perms take ~9 ticks before they work by default.

iaxedu opened this issue ยท 1 comments

commented

Not sure if this is an issue but I'm trying to give temporary perms for 1 second so they can continue in a GUI menu. The downside is when giving a player perms it always take at least 9/10 ticks before it's added. So it takes 0.5 seconds before it works. I've tested this with my default MariaDB config and a complete empty newly generated config but both take at least 0.5 seconds before you can let the player execute a command.

Example of my usecase:
- '[console] lp user %player_name% settemp chestcommands.open.* true 1s' - '[console] lp user %player_name% settemp chestcommands.command.open true 1s' - '[player] cc open dealer <delay=10>'

I've to delay the command making the menu act slow. I've had this issue before with another usecase but ended up not using it. I mainly wonder if this is normal. It's obvious that it takes time but 0.5 second feels like allot if you want to give players a smooth experience.

commented

Yes, it's normal.

The action to set the permission is executed asynchronously, and will "apply" at some point in the future, usually within a second. It's done async to avoid blocking the main thread whilst the database is updated (this would lag the server).

For permissions as shortlived as 1 second, your best bet is setting them via a permission attachment in the Bukkit API - as this system is not affected by the behaviour of the database. Changes should apply instantly.