Essentials icon indicating copy to clipboard operation
Essentials copied to clipboard

@'s do not work in commandblocks

Open limegreenicy opened this issue 8 years ago • 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.

limegreenicy avatar Aug 04 '18 07:08 limegreenicy

I agree. I tried the same and it doesn't work

mrgeneralq avatar Aug 07 '18 15:08 mrgeneralq

It seems like Minecraft or Spigot might have removed selectors in command blocks for plugin commands - I'll need to look into this.

mdcfe avatar Aug 08 '18 07:08 mdcfe

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 avatar Aug 12 '18 03:08 dontaco2000

@dontaco2000 Yes, it's possible to use the minecraft: prefix, but the issue is that EssentialsX commands don't support Minecraft selectors.

mdcfe avatar Aug 12 '18 07:08 mdcfe

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.

dontaco2000 avatar Aug 13 '18 22:08 dontaco2000

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. image and when I add a space at the end - it changes to red indicating it is wrong (which is nice) image So whether it is a bug for EssX or not, I'm not sure. Just offering a different perspective.

smmmadden avatar Aug 14 '18 02:08 smmmadden

If you do the same thing without EssentialsX installed, both work.

dontaco2000 avatar Aug 14 '18 06:08 dontaco2000

@smmmadden I believe in 1.12 and below, Minecraft will automatically resolve selectors in command blocks and /execute before CB passes them to plugins.

mdcfe avatar Aug 14 '18 18:08 mdcfe

It s always break? because for me it s a problem

jajamic avatar Oct 01 '18 14:10 jajamic

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!

YanisBft avatar Oct 20 '18 09:10 YanisBft

@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.

mdcfe avatar Oct 20 '18 14:10 mdcfe

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.

mdcfe avatar Dec 06 '18 18:12 mdcfe

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

MrPistachios avatar Dec 12 '18 21:12 MrPistachios

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+.

pop4959 avatar Oct 30 '19 20:10 pop4959

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?

AyrtonWonton avatar Apr 01 '20 22:04 AyrtonWonton

inside the command block, you put /minecraft:tp @p 1 1 1 (replace 1 1 1 with the coordinates)

zade333 avatar Apr 09 '20 09:04 zade333

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

Hwacivilongola avatar Apr 11 '20 15:04 Hwacivilongola

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?

MrPistachios avatar Apr 11 '20 15:04 MrPistachios

For vanilla you should be using /minecraft:give instead.

pop4959 avatar Apr 11 '20 18:04 pop4959

Dont use the slash, just use monecraft:give or minecraft:tp in a command block

On Sat, Apr 11, 2020, 14:44 pop4959 [email protected] wrote:

For vanilla you should be using /minecraft:give instead.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/EssentialsX/Essentials/issues/2102#issuecomment-612487583, or unsubscribe https://github.com/notifications/unsubscribe-auth/APA2UNL7AGNC57RQV4PWHOTRMC3BNANCNFSM4FN3SN3A .

AyrtonWonton avatar Apr 15 '20 18:04 AyrtonWonton