how do i check if a player attacks a passive mob?

Started by WatermelonFrogy on

Topic category: Help with modding (Java Edition)

Last seen on 01:38, 14. Dec 2021
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how do i check if a player attacks a passive mob?

Hello!
I am making a mod called Pointless Advancements where i just add stupid advancements like "congrats, you wasted leather!" after creating leather armor.
I am currently trying to make an advancement called "Animal Cruelty" that you get from hitting a passive mob like cows or pigs.
How would i go about doing this? i'm pretty new and just started today and everything i know is self taught.

Last seen on 04:28, 26. Jan 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
entity is hurt global…
Wed, 10/06/2021 - 04:36

entity is hurt global trigger

if source entity is type Player AND event target entity is Animal Mob

do grant advancement to source entity: ADVANCEMENT