Make overlay appear upon killing a mob with a certain item

Started by Rocketdude9611 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Make overlay appear upon killing a mob with a certain item

I'm trying to make it so that when I kill an entity with a certain item an overlay appears. (i don't mean the entity has the item i mean the player)
Does anyone know how to make this happen?

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Use global trigger "entity…
Thu, 02/26/2026 - 06:21

Use global trigger "entity dies".

Then use "item in main hand" block to check what item the player is holding.

There might be some special overlay code like an "if" statement in the actual overlay element itself that you can set it to but I'm not quite sure.

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Probably a global number…
Thu, 02/26/2026 - 13:00

Probably a global number variable with scope of player lifetime that is set to something like 20 when you kill the entity (using the trigger and condition suggested by Peteypops13)

Then a procedure that returns logic ((number variable) > (0)) for the overlay condition.

And another procedure running on Player tick update that checks if the variable is greater than 0, and if so, decreases it by 1.

That will make the overlay appear for 1 second on killing an entity with the certain item. If you want it to be longer, you can increase the 20.

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
And I just realized, you'll…
Thu, 02/26/2026 - 13:02

And I just realized, you'll want to update the variable for source entity instead of event/target entity in the first procedure (the kill entity, get variable to 20 procedure), both for getting the item from the player's hand and for updating the variable.