LuckPerms

LuckPerms

41.4k Downloads

Ability to remove parents with a specific weight from a user

Chris6ix opened this issue ยท 7 comments

commented

Description

Hey, it would be great if you could remove parents with a specific weight from a user, so that this parent could be replaced with another one with the same weight without causing problems...

An example is that my Players have the Ability to select a "Title" that they want to display in the TAB List in front of the Rank. The thing is that the currently equipped Title needs to be removed before a new one can be added (Or it causes problems for displaying it).

Currently, I have to check which rank they have, then execute /lp user %player_name% parent clear, then re-add their Rank and then add the new Title...which is very messy and unnecessary...as this needs to be done for every Rank/Titles combination...(Using DeluxeMenus)

So if I could for example remove the parent with the weight 1 (Which all the "Titles" have), I could just precisely remove the old Title and equip the new one without clearing and re-adding the Rank.

Proposed Behaviour

This could maybe be implemented with a new subcommand like these:

/lp user %player_name% parent removeweight "weight"
or
/lp user %player_name% parent weight remove "weight"
or something in this style...

Extra Details

No response

commented

Bump.

commented

Hey @lucko :)
Sorry to ping you, but I was wondering if you maybe missed my issue, as it is now almost as month old without any interaction...
I was wondering if you could check it out and tell me what you think of it...as I could really use that feature :)

~Cheers

commented

I have a workaround for that:
Why don't you add all your title type groups into one track, let's say "titles" and everything else into another track, let's say "playerranks". Now with that in place, you can use /lp user %player_name% parent settrack <track> <group>
'Settrack' works just like 'parent set' but does not impact other tracks than the one you specify, hence not removing the groups which root from your "playerranks" track, replacing the 'old' with new.
Meta stacking would have to be adjusted accordingly of course to display both track-based prefixes.
What'cha think?

EDIT: I'd just like to suggest you could also use DeluxeTags or AlonsoTags which both work via a preset 'tags' from a config, providing permissions per tag and placeholders, even an actual gui menu for DT (not sure if AT has a gui but I think so). Maybe an option rather than going via LP prefixes or groups altogether?

commented

There is a command to clear and set a parent in once: /lp user %player_name% parent set <new group>.

The issue isn't the setting the parent command, the issue is removing a prefix without touching their group and setting a new one for the player without knowing which one the player has at the time, so even unsetting the custom prefix isn't an option unless you want to fire the unset command for every single prefix potentially possible before adding the new one. Currently, he clears the user first, adds their group back and then applies the new custom prefix (title) to the user as far as I understood that correctly ofc. It's a bit confusing due to this issue title mentioning parents and the description mentioning 'titles' (prefixes?).

commented

There is a command to clear and set a parent in once: /lp user %player_name% parent set <new group>.

commented

@ZeromaniacMc
I checked DeluxeTags and AlonsoTags out, but Deluxe is not quite what i need and Alonso seems to have what I need, but some of the features are paid :/
So I'm going to try that "track" thing as that sounds really promising!

Thank you very much for these tips :)

The issue isn't the setting the parent command, the issue is removing a prefix without touching their group and setting a new one for the player without knowing which one the player has at the time (...). Currently, he clears the user first, adds their group back and then applies the new custom prefix (title) to the user as far as I understood that correctly ofc.

Exactly that!
I'm sorry it's a bit confusing, I had some trouble explaining what I wanted to do :)

I'm going to close this as I think I found a fix for my issue, if I can't fix it with this, then I'm going to re-open the issue.

Thanks again :)

commented

If it's only the prefix you want to change, why don't you look for a plugin to change the prefix of players?
I hope it's oke if I tell you the name of the plugin I'm using myself to change players prefix; PrefiX - Custom Tag Manager. You can find it on spigot.