Building a grenade(?) with commands (P1)
So I want to make some battlefield type of game which I would call "Extreme Warfare", and I want to start off by making a so-called grenade that upon hitting a distance, it explodes.
I somehow want it instant, but I'm sure it's impossible, so the best option is using /summon
to place a TNT on the landing spot.
I'll be using a Splash Potion of Poison as the grenade, since most grenades I know are green, and I want to throw it and produce a TNT once landing. So I thought of modifying this command:
execute @e[name=Potion] ~ ~ ~ summon tnt
The bits I need to deal with is the detection of landing, which then summons a TNT, and I also want to determine what potion it is referring to.
For this post, here's my question:
How to detect the projectile to land in order to summon a piece of TNT?
Thanks to penguin for suggesting another method.
Method 1
One command block
This should be an Unconditional
, Always Active
and Repeating
. The command should be: /execute @e[type=splash_potion] ~ ~ ~ detect ~ ~-1 ~ grass 0 /summon tnt
Use multiple different command blocks for different blocks.
Method 2
For this to work you'll need two command blocks:
The first command block
This should be an Unconditional
, Always Active
and Repeating
. The command should be: /execute @e[type=splash_potion] ~ ~ ~ testforblock ~ ~-1 ~ dirt
.
The dirt
here can be replaced for another block.
The second command block
This should be a Conditional
, Always Active
and Chain
. The command should be: execute @e[type=splash_potion, c=1] ~ ~ ~ summon tnt
.
Orientation
The arrows on the side of the command blocks should be facing in the same direction as each other. More specifically, the arrow on the first must point towards the second.
For multiple different blocks have multiple of the first command block all pointing into the second with different blocks in place of dirt.