public void setUseAction(String useAction) { if (Util.isInEnum(useAction.toLowerCase(), EnumAction.class)) { this.useAction = EnumAction.valueOf(useAction.toLowerCase()); } else { this.useAction = EnumAction.eat; } }
@Override protected void onFoodEaten(ItemStack p_77849_1_, World p_77849_2_, EntityPlayer p_77849_3_) { if (!p_77849_2_.isRemote) { if (effectsArray != null) { for (int i = 0; i < effectsArray.length; i++) { Cfg_PotionEffect effect = effectsArray[i]; if (p_77849_2_.rand.nextFloat() < effect.potionEffectProbability) { p_77849_3_.addPotionEffect( new PotionEffect( Util.potionEffectId(effect.effect), effect.potionDuration * 20, effect.potionAmplifier)); } } } } }