How to spawn a splash potion of healing?

Discussion in 'Plugin Development' started by justin_393, Sep 1, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    justin_393

    Yeah, so I'm trying to figure out how to spawn a splash potion of healing with .spawnEntity();

    I have tried a lot of different things, but I can't figure it out.
     
  2. Offline

    mine-care

  3. Offline

    justin_393

    mine-care
    What do you put in for "whatever" at

    effects.add(new PotionEffect(whatever));
     
  4. Offline

    Peter25715

    Exactly. If it's not working say here. But I'm sure this will work.
    When you see that this issue is fixed please turn your thread to solved ;)
     
  5. Offline

    justin_393

    Peter25715
    I don't know what to put in for whatever. I've tried names and IDs, but neither work.
     
  6. Offline

    codex01


    Code:java
    1. addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 200, 5));

    Jump is the effect, 200 is the duration ( In ticks ) and 5 is the potion level
     
  7. Offline

    mine-care

    as codex01 correctly, time is in ticks. just to clear this thing up, 1 second is 20 ticks.
     
  8. Offline

    justin_393

    codex01 mine-care
    Ah, that explains it, I was trying PotionEffect, not PotionEffectType
     
  9. Offline

    mine-care

  10. Offline

    justin_393

    mine-care
    How would I implement that into player.spawnEntity();

    Because player.getWorld().spawnEntity(player.getTargetBlock(null, 200).getLocation(), potion); does not work and want's me to change ThrownPotion potion = .............. to Entity
     
Thread Status:
Not open for further replies.

Share This Page