LuckPerms

LuckPerms

41.4k Downloads

Temporary permissions being longer some times than given.

BlitzOffline opened this issue ยท 3 comments

commented

So today i tried doing something with DeluxeMenus, PlaceholdersAPI and LuckPerms. I tried giving myself a temporary permission using thecommand "lp user %player_name% permission settemp permission.test2 true 2s". This should have given the permission for 2 seconds.

What I found out tho is that something is broken. When i use this placeholder: "%luckperms_expiry_time_permission.test2%" having "update: true" and "update_interval: 1" the countdown is broken.(update: true and update_interval being settings in deluxemenus which allow the item to update every second allows me to see the expiry time counting down live).

It counts 2, 1, 0, -1, -2 and then it removes the permission so the permission stays 2-3 seconds more than it should.

This would not be a problem when giving a permission for more minutes/hours/days etc but i needed it for only 2 seconds and it breaks everything because of that.

Version of server and version of plugin: https://paste.helpch.at/jokezovita.bash
Photo: https://imgur.com/a/ztHHHq2 (don't mind the lore just the Permission exipres in: -1)

commented

This is normal behaviour as LP checks temp-perms roughly every 3 seconds, therefore the temp-perm may be set longer than intended.

More info: https://github.com/lucko/LuckPerms/wiki/Advanced-Setup#temporary-permissions

commented

You can download the latest expansion version, with the above fix, from here: https://ci.lucko.me/job/LuckPermsPlaceholders/

commented

I've changed the placeholders (see above) so negative times won't be displayed.

However, technically those permissions will still be there until they are removed 1-3 seconds later. This is a documented quirk of temporary permissions. If you need finer control (accuracy greater than 3 seconds), then my recommendation is to find a plugin which will set transient permissions through LP, and then remove them a number of ticks later. (Vault supports this)