/tellraw using wrong player when using with command block in nether

/tellraw using wrong player when using with command block in nether - Crop hacker silhouette typing on computer keyboard while hacking system

[Java Edition 1.15.2] I have a pressure plate that activates two command blocks in the nether:

  1. execute as @p in minecraft:overworld run tp @p 98 67 101 180 0 which teleports the player from the pressure plate in the nether to a specific location in the overworld facing north.
  2. tellraw @a {"text":"","color":"green","bold":true,"extra":[{"selector":"@p"},{"text":" has teleported to the overworld!"}]} which tells the chat who teleported and to where.

I have the same thing in the overworld going to the nether. This works perfectly fine when going from the overworld to the nether, however, when going from the nether to the overworld the tellraw command block targets my friend in the overworld with @p instead of me.
For example, say I am playerOne and my friend is playerTwo. When I am going from the overworld to the nether is says playerOne has teleported to the nether! which is what is supposed to happen. But, when teleporting from the nether to the overworld, I see playerTwo has teleported to the overworld! which is incorrect.
How can I get this to work so that it is always the nearest player no matter what the dimension? If it makes a difference, playerTwo is always in the overworld while this is happening.






Pictures about "/tellraw using wrong player when using with command block in nether"

/tellraw using wrong player when using with command block in nether - Focused ethnic female DJ playing music at nightclub
/tellraw using wrong player when using with command block in nether - Crop mother and daughter sitting on bed while using laptop
/tellraw using wrong player when using with command block in nether - From above of crop anonymous male hacker typing on netbook with data on screen while sitting at desk



Do command blocks work in the Nether?

If a single portal block is placed using commands, it can still be used to travel to the Nether.

How do you use a command block in Tellraw?

Examples
  • To send the message "Hello" in chat: /tellraw @a "Hello" \u200c ...
  • To send the message "I am blue" colored red in chat: /tellraw @a {"text":"I am blue","color":"blue"} \u200c ...
  • To send the message "Hover me!" in chat, which displays the text "Hi!" when hovered over: ...
  • Use '\\n' to insert a new line:


  • How do you allow players to use command blocks?

    Go to the \u201cserver. properties\u201d file in your server's config files. Change the line that says \u201cenable-command-block=false\u201d to \u201cenable-command-block=true\u201d Give yourself a Command Block by opening the chat box and entering \u201c/give [your username] minecraft:command_block\u201d

    How do you make a Tellraw say a player name?

    Tellraw allows for a "selector" part, which takes any selector you want and displays a name. You should do: /tellraw @a {"text":"","color":"blue","extra":[{"selector":"@p"},{"text":" has won the game!



    Why Sudo Is The Best Command in Minecraft




    Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

    Images: Anete Lusina, Fardad Postwala, Tatiana Syrikova, Sora Shimazaki