I know some stuff about command blocks, but I'm not an expert. I am trying to teleport a player five blocks along the x-axis whenever they through an xp bottle. I have done the testing for the bottle part, but the execute command will not work for /tp. It works for other things such as /summon and /setblock. My command is this: execute @p ~ ~ ~ tp ~5 ~ ~ It gives me an error message: "Failed to execute 'tp ~5 ~ ~' as Brendanzeros" Can someone please tell me why the command is failing and how I can fix it?
Oh ok. Thanks a lot. I had thought that /tp @p ~5 ~ ~ would teleport the player to a position 5 blocks along the x axis in regard to the command block, not the player. I'll keep that in mind.
Using /execute is both less accurate in this case and can contribute to lag (running two commands instead of one).
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/