How to make an item kick a player

Started by Birb_ on Tue, 06/15/2021 - 16:21

Topic category: Help with modding (Java Edition)

Last seen on 14:08, 16. Jul 2021
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to make an item kick a player
Tue, 06/15/2021 - 16:21

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 07:00, 16. Jun 2021
Joined Apr 2021
Points:

User statistics:

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

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

Last seen on 19:53, 28. Jul 2021
Joined May 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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).