Resolve command selectors for command blocks
YJJcoolcool opened this issue ยท 2 comments
Description
Some time back, I asked in the LuckPerms Discord whether there was a way to use target selectors like @p (link to Discord message).
A user sent me a link to the LuckPerms config.yml which had a setting named resolve-command-selectors
. After adding that line with the true
option and restarting my server, I realised that target selectors worked when executed by players, but not when executed by command blocks.
The command that I wanted to run: /lp user @p parent add <groupname>
(I also tried other commands, like /lp user @p promote <track>
, which also had the same issue). Additionally, I couldn't find any error messages from LuckPerms in my server's console.
Screenshot of command successfully run by player:
Screenshot of failed command when run by a command block:
Reproduction Steps
- In your LuckPerm's config.yml, ensure you have the following option set:
resolve-command-selectors: true
(older versions of LP may not have came with this option, so you might have to add it manually) - Restart your server for the changes to apply.
- After restarting, execute a LP command with a target selector (e.g.,
/lp user @p parent add <groupname>
) as a player and then with a command block. - When executing as a player, the command should work with no problems (you can verify by going to the WebUI using
/lp editor
). However, when using the command block, the command fails to run.
Expected Behaviour
The command should work with no errors when run by a command block.
Server Details
git-Paper-388 (MC: 1.18.2)
LuckPerms Version
v5.4.30
Logs and Configs
No response
Extra Details
No response
Yeah, this is somewhat intended (the resolving of command selectors was only implemented for players)
Would accept a PR to add it for other command executor types, but it's not a priority for me