How to make an item kick a player

Started by Birb_ on

Topic category: Help with Minecraft modding (Java Edition)

Active 5 months ago
Joined Jun 2021
Points:
566

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 0
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?

Active 2 years ago
Joined Apr 2021
Points:
604

User statistics:

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

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

Active 3 months ago
Joined May 2018
Points:
1125

User statistics:

  • Modifications: 8
  • Forum topics: 36
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 366
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).