How to make a tool that gives you a potion effect when you kill a mob with it?

Started by Porsche928 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a tool that gives you a potion effect when you kill a mob with it?

How do I make a tool that gives you a potion effect when you kill a mob with it?

Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This is one way to do it,…
Thu, 01/06/2022 - 15:01

This is one way to do it, swap the "in inventory" to "in main hand"

Procedure

This checks if the entity dies in the area so a way to check if the player killed it is to place a variable on the entity when the player attacks it then check if that entity has it before it dies.

Hope it helps!