0

I'd like to summon a fuse 0 creeper at the position of a splash potion when the splash potion hits something. What I need to know is how to detect when it hits something. I have three ideas currently:

One idea was to give the potion a tag and store the Pos[] of the potion in scoreboards every tick after it was thrown, then test for if an entity with the tag exists, and when it stops existing (as it has hit something) summon the creeper at the last known coordinates. This has the detriment of only working for one potion at a time, and is likely very resource intensive.

Another idea is to execute as a thrown potion with any type of block right next to it, but I'd like to have it not trigger if I've thrown it through a plant or door or something. I was thinking of using a bunch of unless block ~ ~ ~ minecraft:___ with air, water, lava, and a bunch of plants, but the potion would break before it got in a block that wasn't one of the above mentioned ones so it would be very glitchy or not work at all.

Finally, I was considering trying to execute at the particles/effect caused by the potion (Instant Damage 4), but I have absolutely no idea how to do this, because I don't want to use lingering potions and there is no area effect cloud to execute at.

If anyone knows how to make one of these options viable or has a different suggestion, no matter how big or small, please put it down because I've spent several frustrating hours thinking of how to do this, and have not had much progress.

1

How something like this is usually done is having a marker, e.g. an armour stand, constantly teleport to the splash potion. When it can't find anything nearby anymore, that means the potion is gone, it has hit something.

  • So there is no other way besides teleporting every tick? Seems resource intensive but if everyone is using it maybe not. Thanks – Nik3141 May 4 at 2:17
  • I've got execute as @e[tag=handGrenadeArmorStand] at @s run tp @s @e[tag=handGrenade,distance=..1] but it's the same problem as this question I posed a few weeks ago: it won't accept the @e in the teleport tag. gaming.stackexchange.com/questions/348970/… I can't use the stacked execute functions I ended up using in that question because I need two entity arguments in the tp command. – Nik3141 May 4 at 5:59
  • 1
    Maybe you could also give the same "ID" scoreboard value to both and only copy the position to a scoreboard of the armour stand. For tp, use limit=1. Even if there is only one, it complains. – Fabian Röling May 4 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.