check items in inventory

Started by water on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
check items in inventory

 

 

Hello, this code actives when a modded item hits an entity, that part is working, 

i need the code to check what objects the player has in their inventory , if the player has all the  required objects and the entity is hostile despawn it, strike lighting and place stone in the last entity position, could someone assist me? thank you!

https://freeimage.host/i/fnL6X1V

Joined Nov 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It is checking for items in…
Mon, 12/01/2025 - 00:48

It is checking for items in the inventory of the entity attacked, not the source entity, so use source entity instead of event/target entity for checking the items