#[1.20.1] how do I make a specific entity detect if it's hit by a projectile and make it run code?
3 messages · Page 1 of 1 (latest)
must be public boolean hurtServer(ServerLevel serverLevel, DamageSource damageSource, float f)
from livingentity class
try overridig that an put some system.out on it
if (damageSource.is(DamageTypeTags.IS_PROJECTILE)){
System.out.println( "DamageTypeTags.IS_PROJECTILE" );
}
Atm I did it with public boolean hurt but it works anyways. Thank you :)