is it possible to make headshots deal critical damage?

Started by the deadly scorpion on

Topic category: Help with modding (Java Edition)

Last seen on 20:01, 17. Sep 2022
Joined Apr 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
is it possible to make headshots deal critical damage?
Wed, 07/22/2020 - 21:07 (edited)

so im making a zombie apocalypse mod and i want the zombies to die only when they are shot in the head, but idk how to do this, can someone help me out with this.

 

here is the discord channel for my mod incase you wanna join https://discord.gg/mRRpVjZ

Edited by the deadly scorpion on Wed, 07/22/2020 - 21:07
Last seen on 17:18, 1. Dec 2023
Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can only do this with…
Fri, 08/21/2020 - 15:06

You can only do this with coding...

Last seen on 17:51, 25. Apr 2024
Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Are you using a projectile?…
Fri, 12/29/2023 - 00:14

Are you using a projectile? If you are, then you can detect when the projectile hits an entity, and then check if the entity is a zombie.

 

If it is, then check if the T position of the projectile is higher than the Y position of the zombie minus some value, (you'll have to do some tweaking for that).

 

Then if that is true, then damage/kill the zombie, and otherwise, do nothing.

 

If you want, I might be able to provide a rough procedure for you.