Started by
rgpmc
on
Topic category: Help with MCreator software
I am creating a boss and I want it so that only spectral arrows deal damage to it
I tried to use the following code
if (damagesource.getDirectEntity() instanceof Arrow)
return false;
if (damagesource.getDirectEntity() instanceof TippedArrow)
return false;
if (damagesource.getDirectEntity() instanceof SpectralArrow)
return true;
but it did not work
Can someone help me resolve this?
Nvm guys I found it
for those who have issues with it you need these two lines of code
import net.minecraft.world.entity.projectile.SpectralArrow;
and
if (!(damagesource.getDirectEntity() instanceof SpectralArrow)) {
return false; // Block all non-spectral arrow damage
}