Potion Effects :3

Discussion in 'Spigot Plugin Development' started by IllegalSloth, Jun 1, 2017.

  1. Hey, so its been ages since I've done potion effects and I forgot the method I've looked through the JavaDocs but their methods won't work (I probably don't understand them) :3
    Could someone give me the code
    I currently have
    Code (Text):
    p.addPotionEffect( - What do i add here - )
  2. it is not JavaDoc problem it is yours, try learning some basics at java so you can clearly understand what the javadoc said
    you can use the PotionEffect enum to search for effects.
  3. Relatively simple..
    Code (Text):
    p.addPotionEffect(new PotionEffect(PotionEffect.TYPE , duration , level));
    You are creating a PotionEffect to add to the player indefinitely.

    Best if you read the javadocs thoroughly..
    #4 DamaTheDev, Jun 1, 2017
    Last edited: Jun 1, 2017
  4. now he won't look to javadoc instead copy this one as his guide not learning how it works or how it done.
  5. I am helping him out with the hope that he listens to the rest of my advice in reading the javadocs, if he does not pursue the javadocs then he will never progress as a developer, it's a decision he has to make.
  6. It actually wont work . there's no method Player#addPotionEffect(PotionEffectType); in Javadoc
    p.addPotionEffect(new PotionEffect(PotionEffect.TYPE , duration , level));
  7. yes it is a decision but you as well known developer let's assume are you going to give others a chance to take the negative way or just teach the positive way for his / her benefits?
  8. oops yeah it is.
  9. See, I need to even read the javadocs lol.
  10. Code (Text):
    p.addPotionEffect(New PotionEffect(PotionEffectType.#portions#, #time ticks#, #amplifier#));
    Why do u have the ";3" in ur titlte?

    No place to be cute; be gewd with Java first ;3