question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

commands do not work when used with default target selector variables (@p, @e, etc)

See original GitHub issue

ENVIRONMENT: running CraftBukkit version git-Spigot-b6ecf3b-9060bfa (MC: 1.12.2) (Implementing API version 1.12.2-R0.1-SNAPSHOT) and running only one plugin, LuckPerms (v.4.1.63) [EDIT: re-verified behavior on latest LP version]

PROBLEM: when a user or group has been given permission to use commands that normally accept default target selector variables, such as @p @e and so on, these commands will not work when that command is used with a target selector variable. the commands return messages such as “Player ‘@p’ not found” or “Entity ‘@e’ not found”.

CAVEATS: the same command WILL work if the command does not use a target selector variable, but instead names the player. Commands with target selector variables continue to work as expected when the user has default minecraft Operator privelege, although this defeats the intent of LuckPerms and so is not a workaround

STEPS TO REPRODUCE.

(1) ensure you do not have minecraft “op” privilege set for your [username]

(2) use luckperms to assign your non-op [username] the “minecraft.command.give” permission, or assign the user to a group that has this permission enabled.

(3) type in the user command window “/give @p dirt”. the result will be “Player '@p' not found

(4) type in the user command window “/give [username] dirt”. the result will be to give <username> one block of dirt.

other commands, such as ‘kill’, ‘tell’, ‘teleport’, and any other plugin commands that use target selector variables (@p, @a, @e, @r, @s) all behave in this manner.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
luckocommented, Apr 20, 2018

Yes, you’re right, the Essentials commands don’t support selectors.

In fact, in general, Bukkit plugin commands will not support selectors, as this isn’t exposed in the Bukkit API.

Perhaps that’s the problem you’re encountering? If the Vanilla commands aren’t working with selectors, then this sounds like a Spigot/CraftBukkit bug. You could try reproducing it without any plugins on the server?

It’s definitely unrelated to LuckPerms. 😃

1reaction
luckocommented, Apr 19, 2018

Sorry if I came across as defensive, that wasn’t my intention - but I can see my message might’ve come across that way. I was just trying to get to the point 😃

I’m quite tired at the moment so can’t really give this issue my full thought - I’ll try look into this a bit more / work out a reply sometime tomorrow - if that’s okay. 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Target selectors - Minecraft Wiki - Fandom
Target selectors are used in commands to select players and entities arbitrarily, without needing to specify an exact player name or a UUID....
Read more >
Target Selectors | dx, dy, dz, r, rm, type, family, l, lm etc
Target Selectors | Minecraft Bedrock | Command Augments | dx, dy, dz, r, ... A target selector variable can be used to choose...
Read more >
All Minecraft target selector arguments - Arqade
That is my question: What are all Minecraft selector arguments (in 1.8) The ones I currently know are score_scorename=value, score_scorename_min ...
Read more >
Commands that uses Arguments on target selectors doesn't ...
What was I expecting-When I use command using target selector that have Arguments, it should execute properly either on chat or command ......
Read more >
Introduction to Commands | Microsoft Learn
A guide covering how Commands work in-game, the syntax that is used and what parameters are available to use.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found