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

Started by TrilliByte on

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:
  • MCreator plugins:
  • Comments:
How do I detect if a mob gets killed by the player.

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 10:38, 22. Apr 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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.

Last seen on 23:26, 24. Apr 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How would I do this if the…
Tue, 01/09/2024 - 04:16

How would I do this if the target player killed another player?