How make an item damage a player, but only give an item when they take damage

Started by I_need_some_help on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jul 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How make an item damage a player, but only give an item when they take damage

I tried using an if/elseif prompt that checked if the player was a player and was using the specific item as well as if they were vulnerable. but it kept giving them the item even when they weren't vulnerable. does anyone know how to fix this? (also i set it to a global trigger that checks if the item is swung)