How to make an item kick a player

Started by Birb_ on

Topic category: Help with modding (Java Edition)

Last seen on 01:46, 24. Nov 2022
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make an item kick a player

I am creating a joke mod with a variety of useless items, among them is a "potion of kicking" which should kick the player upon consumption, but it doesn't. I have it set to execute the command /kick @s when used but it does nothing. Using the command in the console however, works just fine. Is there any way I can get a potion to kick the player that uses it?

Last seen on 13:34, 4. Oct 2022
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
try it with /execute…
Wed, 06/16/2021 - 06:50

try it with /execute positioned ~ ~ ~ run kick @p

Last seen on 15:14, 16. Apr 2024
Joined May 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Use kick @p instead. The…
Thu, 07/08/2021 - 15:10

Use kick @p instead. The reason @s doesn't work is because @s targets the player executing the command, but in this case it is technically the potion which is executing the command and not the player (and obviously the game cannot kick a potion).