#Cancelling EntityHurt event

1 messages · Page 1 of 1 (latest)

wooden hawk
#

Is it possible to "cancel" an event? I still want to execute a piece of code on damage taken, but i also want to stop the entity from taking damage and not make the damage sound and others.

pale flint
#

you can only cancel beforeEvents

wooden hawk
#

how do i do that?

pale flint
#

theres no beforeevent for entityhurt

wooden hawk
#

so its not possible?

#

what does beforeDataDrivenEntityTriggerEvent do?

#

wiat yeah no that doesnt work

covert void
# wooden hawk how do i do that?

All you can do is modify the player file to interact with the script, to be more specific you will have to change the component "Minecraft:damage_sensor"

wooden hawk
#

uhuhh

#

so its complecated

#

and alot of effort that could just be like changed in the next update

covert void
#

It's the only way for you to cancel the damage before the event and still allow PVP

wooden hawk
#

yeah okay thats fine

#

thanks

covert void
wooden hawk
#

i just started messing around with scripts like

#

uhhhhh

#

and hour ago

#

and i havent done mods in like a year

#

coz ive been busy lol

#

i was just messing around to try and learn

#

but thanks ill probably come back to it at a later date

covert void
#

I also haven't been working more than making mods for servers

#

more is that, good luck waiting for you

frozen oriole
#

I was trying to do this same thing, I cancelled every non fatal damage

#

But a hurtEvent that fires when an entity died, well, I couldn't do anything

covert void
#

What I did was just cancel the damage if the entity doesn't have a tag

#

This helps to combat kill spawn on servers etc.

#

You can also turn PVP on for certain players and off for others

#

create team systems

#

among other systems that you can do

#

It's even better to avoid using the API script for things you can do using command or molang