-3

How do I use @p in tellraw without a command block? This is what the current command looks like, and I want it to kick whoever clicks it.

/tellraw @a ["",{"text":"Click me!","clickEvent":{"action":"run_command","value":"/kick @p You got trolled!"},"hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"Click me!"}]}}}]

pppery
  • 3,876
  • 8
  • 27
  • 47
  • I don't know what you mean. tellraw is not a command that is command block exclusive. Actually there are no commands that are command block exclusive. Every command that works in a command block works just as well in the chat. – Fabian Röling Apr 06 '18 at 22:10
  • I want it to kick @p/the player who clicked it. – Griffin Apr 07 '18 at 00:21

1 Answers1

3

Your command can be run by typing it into chat. No need for a command block. Your command will work as is, with the @p target selector.

I recommend you use @s target selector as it will select the player who executed the command, which is the player who clicked the tellraw text.

Note: The command is executed by the player at the permission level of the player. If your players do not have permission to use the kick command, your command will not work. There is a work around involving the trigger command but it adds complication to the system which will no longer be a type it in chat solution.

IronAnvil
  • 5,663
  • 1
  • 14
  • 31
  • Also, the /trigger workaround requires that the command be executable by a command block, which /kick isn't – pppery Jul 12 '19 at 14:33