Started by
HollowVoidGojo
on
Topic category: Help with Minecraft modding (Java Edition)
So I want to make an advancement go to a player when they take 20 hearts of damage its called "Deadly Close" Im a little stuck on what its called so if someone could tell me it would be very appreciated, thanks!
Edited by HollowVoidGojo on Thu, 10/28/2021 - 09:25
If player current health = (calculate the correct one)
then do: add achievement
on top of my head I think of
Before entity dies
if event target entity current health = 20
do grant achievement to event target entity: ADV
Thank you but I do not see any code saying "If event target entity current health = 20" the most I can find is "current health of event target entity)
Also to correct, I want to calculate how much damage the player takes whilst they are on the world and when they get 20 damage they get the advancement.
yes, that's what the procedure is for, and you don't find the block, you construct it, search tutorials on how to make procedures on Yt
Example: going from full health to 1
On player tick
If entity health = 20, wait like 15 ticks then
If entity health = 1, add advancement
but that will fail on almost all cases, so just do mine
I believe Before Entity Dies doesn't exist so do this:
Entity dies Global Trigger
if not event target entity has unlocked advancement: "YOUR_ADVANCMENT"
do Cancel Global Trigger
if health of event target entity = 20
do (Kill player)
Grant Advancement to event target entity: ADVANCEMENT
Entity dies Global Trigger
if not event target entity has unlocked advancement: "YOUR_ADVANCMENT"
do Cancel Global Trigger
wait 2 ticks then do:
if health of event target entity = 20
do (Kill player)
Grant Advancement to event target entity: ADVANCEMENT
(forgot to put the Wait part)
Any other way? Its kind of confusing, if you have discord add me on "The Last Cat Boy#5556" (Without the quotes) and could we vc at some point so you could help me?
Explain exactly what you need and we will help you. Every time player takes 20 damage ? Or just once ?
Please exactly explain and we will help you
Just once a player takes 20 damadge they get a advancement
As already explained you, 20 damage is 10 hearts so when player current health = (write what you want here) then add achievements
I would do this way but you can gain some outcome different systems
if you want I will take a video on how to make the procedure