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)

Active 3 years ago
Joined Aug 2021
Points:
539

User statistics:

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

Active 4 months ago
Joined Jan 2021
Points:
737

User statistics:

  • Modifications: 2
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 198
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!