LuckPerms

LuckPerms

41.4k Downloads

Field `primarygroup` in `luckperms_players` table is always "default"

Sliman4 opened this issue ยท 2 comments

commented

Description

It looks like user.getPrimaryGroup().getStoredValue() in

is not updated before saving, it's always "default".

Reproduction Steps

  1. Clean install LuckPerms with MySQL or MariaDB storage.
  2. /lp creategroup testgroup
  3. /lp user parent add testgroup
  4. /lp user info: shows primary group "testgroup"
  5. See the value in luckperms_players table is still default, even after rejoin, /lp sync, and even server restart.

Expected Behaviour

Set primarygroup to "testgroup"

Server Details

3096-Spigot-9fb885e--296df56 (MC: 1.16.5)

LuckPerms Version

e6cc817, also tested v5.3.x

Logs and Configs

Config is default, only changed storage-method to MariaDB and database credentials. No warnings in logs.

Extra Details

No response

commented

I believe this is intended behavior. With the default config, the primary group is calculated at runtime by weight, thus no point in saving it. You can change the primary group calculation here if you want.

(While I'm here, be aware that modifying/reading the raw SQL data isn't really supported. While it will work, don't be surprised if there's unannounced breaking changes, and if you break something, you're pretty much on your own)

commented

Thanks for the response, I was trying to read the primary group and display it on a website, but looks like I'll have to write a separate plugin for this.