How do I detect if a mob gets killed by the player.

Started by TrilliByte on Sun, 11/20/2022 - 22:37

Topic category: Help with modding (Java Edition)

Last seen on 02:08, 21. Nov 2022
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How do I detect if a mob gets killed by the player.
Sun, 11/20/2022 - 22:37

I'm making an advancement for when a player kills the wither it gives you the advancement but I don't know how to do that.

I'm new to modding so I don't know much about anything.

Last seen on 16:27, 27. Jan 2023
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Make a procedure that…
Sun, 11/20/2022 - 23:53

Make a procedure that triggers when an entity is killed. (There should be an 'entity dies' trigger in the top block.) Then, use an if-block, and check if the source entity is a player, and the target entity is a wither. Inside the If block, add a block to give the source entity your custom advancement.