#Defining Damage

1 messages · Page 1 of 1 (latest)

remote veldt
#

I am making a plugin for the Warden to be immune to specific type of damage but I dont know how to define the damage

upper dagger
#

EntityDamageEvent or smth

#

check the damage cause

#

and if it is what u want, then set damage to 0

silk cloud
#

why don't you use the other thread?

upper dagger
silk cloud
#

you already have a thread about this exact thing

upper dagger
#

pretty easy

remote veldt
#

well yes but if I would want to cancel the event if the damage is from a potion or explosion and im not really sure how to do that

silk cloud
#

in the entitydamageevent, check if the DamageCause is ENTITY_EXPLOSION or BLOCK_EXPLOSION

#

if yes, cancel it

remote veldt
#

ok

#

thanks

remote veldt
silk cloud
#

event.getCause()

#

if(event.getCause() == DamageCause.ENTITY_EXPLOSION) {

remote veldt
#

thanks

remote veldt
#

are respawn anchors counted as BLOCK_EXPLOSION?

silk cloud
#

do they explode?!

remote veldt
#

yes

#

in the overworld

silk cloud
#

it should be a BLOCK_EXPLOSION then, yes

remote veldt
#

ok

#

also do you happen to know how do I make sure it is like only if its the warden then immune

#

is it like

#

if(e.getEntity instanceof minecraft.WARDEN){
blah blah blah
}

silk cloud
#
if(event.getEntity().getType() == EntityType.WARDEN) { ...
remote veldt
#

thanks

remote veldt
#

can you help me with the attributes I dont know how to put them in

silk cloud
#

what exactly is the problem?

remote veldt
#

like how am I supposed to add the attributes to the Warden im not sure exactly how

silk cloud