#I want to run different script events depending on damage received
1 messages · Page 1 of 1 (latest)
You can use a Entity Hurt to detect the damage
but if you want to cancel the damage, Entity Hurt doesn't work, at least not yet
because Entity Hurt only is after event now, in previews the EntityHurtBeforeEvent is already exists
and with BeforeEvent can you know about the damage count and you can cancel the attack
after that you can use an apply knockback to make the animation of it pushing you back
I know that bit but when you do if(data.damage) how do I use that information to play certain events depending on the damage
if(Math.floor(data.damage)===1) player.triggerEvent("test")
just chain a pile of these together with if, and if else statement or a switch statement.
Or you can make a more advanced system if you need it.
Ok thx
Wait could I use inequalities instead of === for example I could use data.damage >= 9
In testing it, it doesn’t work
You might have your statements ordered backwards, causing it to not fall through properly.