#Defining Damage
1 messages · Page 1 of 1 (latest)
EntityDamageEvent or smth
check the damage cause
and if it is what u want, then set damage to 0
declaration: package: org.bukkit.event.entity, class: EntityDamageEvent
why don't you use the other thread?
declaration: package: org.bukkit.event.entity, class: EntityDamageEvent
you already have a thread about this exact thing
declaration: package: org.bukkit.event.entity, class: EntityDamageEvent
pretty easy
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
in the entitydamageevent, check if the DamageCause is ENTITY_EXPLOSION or BLOCK_EXPLOSION
if yes, cancel it
how exactly do I check the damage cause?
thanks
are respawn anchors counted as BLOCK_EXPLOSION?
do they explode?!
it should be a BLOCK_EXPLOSION then, yes
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
}
if(event.getEntity().getType() == EntityType.WARDEN) { ...
thanks
can you help me with the attributes I dont know how to put them in
what exactly is the problem?
like how am I supposed to add the attributes to the Warden im not sure exactly how
declaration: package: org.bukkit.attribute, interface: Attributable