Minecraft – How to add text after a command has run using /tellraw in minecraft pc

minecraft-commandsminecraft-java-edition

This is a confusing question but I'll try my best to explain what I need help with.

So this is the command I'm using

/tellraw @p ["Would you like to Teleport?",{"text": " Yes ","color": "green","bold": "true","clickEvent": { "action": "run_command","value": "/tp @p -8188.449 64 7415.522 "},"hoverEvent":{"action": "show_text","value":{"text": "Confirm"}}},{"text": " No ","color": "red","bold": "true","clickEvent":{"action": "run_command","value": "/tellraw @p {\"text\":\"Come back when you want to teleport\"}"},"hoverEvent":{"action":"show_text","value":{"text":"Cancel"}}}]

Works great but I want to add something more to it. After the the command /tp, I want to add more text that says something like "teleporting..please wait" but I'm not sure how to execute that. Whether I need another command block or there's a data tag to add more text after that??

Best Answer

You could use a setblock command, using a redstone block, instead of teleporting the player right away. The block would be placed next to some redstone, which would trigger a command block to say "teleporting", and run to a line of repeaters to create delay, which is what I assume you want. At the end, have it trigger two command blocks: One to teleport the player, the other to remove the redstone block, to ensure that this would work more than once. Here's a simple schematic:

     C2
C1   ^
R>>>>+>>C3

Where R is where the redstone block would be placed, C1 is the command block that would have the command to tell the player, C2 is the command block that destroys the redstone block, C3 is the command block that actually teleports the player. >> being a right-facing repeater, ^ being an up-facing repeater and + being redstone dust. You could also take advantage of the Scoreboard system so the command block teleports the correct player.