
Target selectors not working
Closed this issue ยท 14 comments
I have a command block that when executed, sets the group of the player who clicked the button that triggered using target selectors (@p
). LuckPerms don't let me do that.
It's down to your server implementation to do this. I won't be adding direct support in LP.
I'm using Sponge. Is there any other way that I can add a group to a player when they do something if not with LuckPerms?
Perhaps you can find a plugin which supports adding replacements before they get processed, or ask the people behind Sponge if they can add support for it.
That's why I'm confused why it's not working. Sponge already supports this through SelectorCommandElement
. The default player argument should handle that just fine. https://github.com/SpongePowered/SpongeAPI/blob/bleeding/src/main/java/org/spongepowered/api/command/args/GenericArguments.java#L1136
I don't use Sponge's argument parsing. The selectors would need to be replaced in the raw command string.
Sponge supports parsing target selectors through the Selector
class. The reason it's not replaced automatically is that Selectors can select multiple players. Would it be possible to run the target selector through the Selector
class if it is a selector, and then see if it's size is 1? If it's not one, throw an error?
Should work fine. Behaviour will be the same as with Sponge parsed command arguments.
Lmk how it goes. :)
This code should be in 3.1.35, right? Because it's not working.
LP: 3.1.35-sponge
Minecraft: 1.11.2
Sponge: SpongeForge-1.11.2-2282-7.0.0-BETA-2301
/lp user @p info
yields [LP] @p is not a valid username/uuid.
I ran it from an commandblock (while standing next to it) and I ran the command myself (I have full permissions). And I literally used that command. @p
nothing more, nothing less.
Edit: Only thing I could imagine is that the combination out of Sponge and Forge is somehow renaming the selectors...
Yep it's Sponge (Vanilla and Forge). For some reason they renamed the selectors.
Here's a list:
@a
-> @minecraft:all_players
@p
-> @minecraft:nearest_player
@r
-> @minecraft:random
@e
-> @minecraft:all_entities
Good thing is that it is documented no where.
Working wonderful for me with @p[r=10]
. Whatever problems you're having, it's most likely a Sponge problem at this point. spongeforge-1.10.2-2281-5.2.0-BETA-2308.