@'s do not work in commandblocks
limegreenicy opened this issue ยท 22 comments
When doing a warp command or sudo commands in command blocks, for example, warp spawn @p, it says player not found. This used to work, but as of the 1.13 update, it doesn't.
This may be added to EssentialsX in the future, but it is not currently a priority.
If this is an issue for you, I would recommend looking into a plugin which adds selectors to all commands on the server, like CommandHook.
This is a Minecraft issue as stated on spigot support https://hub.spigotmc.org/jira/browse/SPIGOT-4295
There is a plugin that solves this issue called commandhook https://www.spigotmc.org/resources/commandhook.61415/
I use this to allow players to select their own name color by adding a prefix which required the @p selector and the plugin has solved that issue
It seems like Minecraft or Spigot might have removed selectors in command blocks for plugin commands - I'll need to look into this.
I signed up just to say that I confirmed this personally on my test server and would be more than happy to invite you to show you.
EDIT: I just confirmed that I can force minecraft to process the command to make it work so instead of "/tp @ xyz" I could use "/minecraft:tp @ xyz" to bypass this issue.
@dontaco2000 Yes, it's possible to use the minecraft:
prefix, but the issue is that EssentialsX commands don't support Minecraft selectors.
Yeah I know it doesn't work and that it is a bug but I wanted to prove it and at the same time provide a workaround until it is fixed.
for what its worth, I also tested this out on a new spigot server with the EssX 2.15.0.17 and I could get the minecraft:tp to work as long as there was no space at the end of it and the tp @p x y z does not work. I don't recall this ever working in a command block and have always used the minecraft:tp to do it or whatever other resource that may offer a similar tp behavior. There does appear to be changes to command blocks in 1.13 as shown here with the command with no spaces at the end. There appears to be help with commands in 1.13 showing as I type in the command block.
and when I add a space at the end - it changes to red indicating it is wrong (which is nice)
So whether it is a bug for EssX or not, I'm not sure. Just offering a different perspective.
@smmmadden I believe in 1.12 and below, Minecraft will automatically resolve selectors in command blocks and /execute
before CB passes them to plugins.
Hey @md678685, just wanted to know, did you look into this bug?
I can understand you don't have enough time or whatever, and the plugin is free after all, but it's a really annoying bug ^^
Anyway thanks for your work on this!
@Yanis48 This isn't a bug. Spigot doesn't have command selectors for plugin commands any more. I personally can't look into this, but anyone is welcome to look into implementing selectors.
Closing this issue since I don't think Essentials will be seeing built-in selectors anytime soon. This is an issue with Spigot. I would, like md, recommend CommandHook or similar plugins, if you absolutely need selectors in 1.13+.
Umh, pop4959, Im in a 1.15.2 server. And im trying to do /kit Iron @p. Any idea on how I could bypass the bug with a /kit command?
So I want to make a command block teleport the player who presses the button to another player or to a fixed location. I have the essentialsx plugin installed and the normal @p doesnt work, could somebody help me out?
inside the command block, you put /minecraft:tp @p 1 1 1 (replace 1 1 1 with the coordinates)
I got CommandHook but I still can't use complex vanilla commands like this
give @p minecraft:diamond_shovel{CanDestroy:["minecraft:snow_block"],Unbreakable:1b} 1
I got CommandHook but I still can't use complex vanilla commands like this
give @p minecraft:diamond_shovel{CanDestroy:["minecraft:snow_block"],Unbreakable:1b} 1
Does it work without essentialsx?