Solved An error with potion effect

Discussion in 'Spigot Plugin Development' started by DickPig396, Jun 13, 2021.

  1. Method "h.addPotionEffects(PotionEffectType.HEAL, 30, 5)" is markin' like a wrong (
    The method addPotionEffects(Collection<PotionEffect>) in the type LivingEntity is not applicable for the arguments (PotionEffectType, int, int))
     
  2. more code pleaseee
     
  3. The error says it all really, you need to create a new PotionEffect with the parameters. An example is as following:
    Code (Text):
    livingEntity.addPotionEffect(new PotionEffect(PotionEffectType.HEAL, 30, 5));
     
    • Winner Winner x 2
  4. You legit don’t need anymore more code for this lol also as mentioned the issue is stated in the error message, you have to create a potioneffect
     
    • Like Like x 1
  5. My bad, I didn't see it.
     
    • Useful Useful x 1