Cause splash potion 'explosion' at given location

Discussion in 'Plugin Development' started by knokko, Nov 10, 2019.

  1. Offline

    knokko

    For one of my plug-ins, I'm looking for a way to cause the explosion/splash of a splash potion at any location I choose (possibly in mid-air).

    I browsed through the methods of World and ThrownPotion, but couldn't find any method that would solve this easily.

    I am now thinking about spawning a splash potion and some kind of obstacle at exactly the right place, but that feels very error-prone and dirty. So if anybody knows a better way to do this, I would like to know!

    By the way, I need this in minecraft versions 1.12 up to 1.14. It is okay if I need different code for each version, as long as I can make it work in each version separately.
     
  2. Offline

    yPedx

  3. Offline

    DerDonut

    @knokko Or you play the BREAK_POTION effect
    Not sure which versions support that, 1.14 does
     
  4. Offline

    knokko

    I know I can spawn a splash potion like this (I also found out how to configure the effects), but how do I force it to splash/explode immediately? (That's what I meant with my question)

    This would only display the effect, but not actually give potion effects to surrounding entities, right? The problem is that I need both.
     
  5. Offline

    DerDonut

    Yeah thats right. Anyways these two are the only possibilities I can think of so you either have to do your obstacle trick (barrier e.g) or use the effect and add the potion effects manually
     
  6. Offline

    yPedx

    @knokko
    Just spawn it on the ground, it'll most likely splash instantly.
     

Share This Page