public class DfgbProcedure {
public static void executeProcedure(Map<String, Object> dependencies) {
if (dependencies.get("entity") == null) {
if (!dependencies.containsKey("entity"))
DcatsModPackMod.LOGGER.warn("Failed to load dependency entity for procedure Dfgb!");
return;
}
Entity entity = (Entity) dependencies.get("entity");
if (new Object() {
boolean check(Entity _entity) {
if (_entity instanceof LivingEntity) {
Collection<EffectInstance> effects = ((LivingEntity) _entity).getActivePotionEffects();
for (EffectInstance effect : effects) {
if (effect.getPotion() == Effects.LUCK)
return true;
}
}
return false;
}
}.check(entity)) {
entity.attackEntityFrom(DamageSource.GENERIC, (float) 1);
}
}
}