Hey,
I have a wierd issue with the PotionEffect builder method:
I have seen a recent post on the forum about applying Potion effects to the player. First, there were no error detected by Eclipse about that code:
public void addEffect(Player target){
List<PotionEffect> myList = new ArrayList<PotionEffect>();
myList.add(PotionEffect.builder()
.particles(false)
.potionType(PotionEffectTypes.STRENGTH)
.amplifier(1)
.duration(5)
.build());
target.offer(Keys.POTION_EFFECTS,myList);
}
Since I moved to Java8 in order to make some other methodes work, that .builder() method is underlined. And here is the message it gives:
This static method of interface PotionEffect can only be accessed as PotionEffect.builder
So, what did I do wrong?