LuckPerms

LuckPerms

41.4k Downloads

Prefix/Suffix clear and replace issue

Opened this issue ยท 1 comments

commented

Ok, so I am switching to luckyperms from PEX, I did the migration and everything is good. However I have BossShopPro which enables me to create my own menus and such so I created a menu for changing "tags" or in reality suffixes. With pex the /pex user USER (prefix or suffix) PREFIX/SUFFIX would replace the existing prefix/suffix. Now that is not the case with LP which is fine so I figured I would just have a command run before the set command to clear their prefix or suffix. So I changed some and tested it out. Its hit and miss. Reason being is the commands in BSP are run in order from top to bottom. Well when it runs the two commands in this order it doesnt always run in order.

  • 'lp user USER meta clear suffix'
  • 'lp user USER addsuffix 10 SUFFIX'

So in theory this should run the clear suffix command first and then add the suffix specified. Now what happens is shown in the files attached. My question/concern/bug is that even if the suffix is empty or the weight of the suffix/prefix is lower OR higher than what is being added. The clear suffix command should still run first and clear the prefix or suffix. EVEN if there isnt one. It just becomes a redundant command.

How it SHOULD (and sometimes does) work.
Gyazo Link

How it works most of the time. PLEASE NOTE: that when I used the hacker tag the first time it did not work (cleared the tag after it set it to hacker) in this picture then a few seconds later it did work.
Gyazo Link2

commented

Commands in LuckPerms are executed asynchronously, which means at any one time, more than one command can be processing.

This means that you cannot rely on the execution order of commands, especially when they're called at exactly the same moment. My suggestion would be to run the second command at a slight delay to ensure it always runs after the first one.

You could try: https://dev.bukkit.org/projects/command-delay