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 modding (Java Edition)

Last seen on 14:49, 11. Jan 2022
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?

Last seen on 22:05, 24. Apr 2024
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!