Mobs that are immune to oozing and infested through datapacks will only be immune to infested.
To reproduce:
Enable the attached datapack, adding chickens to the
#immune_to_oozing
and#immune_to_infested
entity type tags.Spawn a chicken
Splash the chicken with Oozing
Kill the chicken
Note that slimes spawn even though chickens are immune to Oozing through the datapack
Code analysis:
LivingEntity.class
public boolean canBeAffected(MobEffectInstance mobEffectInstance) {
if (getType().is(EntityTypeTags.IMMUNE_TO_INFESTED)) {
return !mobEffectInstance.is(MobEffects.INFESTED);
}
if (getType().is(EntityTypeTags.IMMUNE_TO_OOZING)) {
return !mobEffectInstance.is(MobEffects.OOZING);
}
if (getType().is(EntityTypeTags.IGNORES_POISON_AND_REGEN)) {
return !mobEffectInstance.is(MobEffects.REGENERATION) && !mobEffectInstance.is(MobEffects.POISON);
}
return true;
}
If the entity is in the #immune_to_infested tag, the code only checks if the applied status effect is infested, and does not check whether the entity is also immune to other effects.
Attachments
Comments 0
No comments.