4

So I was trying to make grenades and I used an armor stand tracking command set I found here How would I make something spawn when and where a snowball hits something? (MrLemon's answer) and it has an issue for me. After converting the commands from pre-1.11 to post-1.11 format (e.g. Snowball to minecraft:snowball) the armor stands won't leave and once the /summon tnt command goes off, I get a huge row of explosions along the trajectory of the snowball. I tried something like

execute @e[type=snowball] ~ ~ ~ summon armor_stand ~ ~ ~ {NoGravity:1b,CustomName:"SnowballMarker",Marker:1b,Invisible:1b}

testfor @e[type=armor_stand,CustomName:"SnowballMarker",Marker:1b,Invisible:1b] {inTile:Air}

kill @e[type=armor_stand,CustomName:"SnowballMarker",Marker:1b,Invisible:1b,inTile:Air]

First command summons an armor stand at the snowballs location.

Second command tests if the stand is in the air(at least that was the plan)

Third command kills said airborne armor stands.

If anyone can make a post-1.11 friendly version of MrLemon's command, I'd greatly appreciate it.

Also, please show the arrangement of the commands in their command blocks, crazy things can happen.

  • 2
    The link you incorporated into your post points to Mystery's answer, and not Mr. Lemons. Did you mean to do that? – Timmy Jim Nov 20 '17 at 13:45
  • Also, just to link to it as well, here is an answer by @Unionhawk which predates your linked answer which uses the same age/armor stand system to detect snowball impact. It was a clever idea. – IronAnvil Nov 20 '17 at 16:15
  • @TimmyJim Sorry, my mistake. I don't know how to change it, unfortunately. – DABSPIRIT Nov 21 '17 at 5:35
2

Here are the exact commands but updated:

/scoreboard players add @e[type=snowball] snowballTime 1

/execute @e[type=snowball,score_snowballTime=1] ~ ~ ~ summon armor_stand ~ ~ ~ {NoGravity:1b,CustomName:"SnowballMarker",Marker:1b,Invisible:1b}
/execute @e[type=snowball,score_snowballTime_min=2] ~ ~ ~ tp @e[type=armor_stand,name=SnowballMarker,c=1] @e[type=snowball,r=1]

/scoreboard players set @e[type=armor_stand,name=SnowballMarker] hasSnowball 0
/execute @e[type=snowball] ~ ~ ~ scoreboard players set @e[type=armor_stand,name=SnowballMarker,r=1] hasSnowball 1

/execute @e[type=armor_stand,name=SnowballMarker,score_hasSnowball=0] ~ ~ ~ summon tnt ~ ~ ~ {Fuse:0}
/kill @e[type=armor_stand,name=SnowballMarker,score_hasSnowball=0]

The results in 1.12.2: Boom

Here is the same solution but it uses scoreboard tags instead of objectives. This means you don't have to setup the objectives.

execute @e[type=snowball,tag=!Grenade] ~ ~ ~ summon armor_stand ~ ~ ~ {NoGravity:1b,CustomName:"SnowballMarker",Marker:1b,Invisible:1b}
scoreboard players tag @e[type=snowball] add Grenade
execute @e[tag=Grenade] ~ ~ ~ tp @e[name=SnowballMarker,c=1] @e[tag=Grenade,r=1]

scoreboard players tag @e[name=SnowballMarker] remove hasSnowball
execute @e[tag=Grenade] ~ ~ ~ scoreboard players tag @e[name=SnowballMarker,r=1] add hasSnowball 

execute @e[name=SnowballMarker,tag=!hasSnowball] ~ ~ ~ summon tnt ~ ~ ~ {Fuse:0}
kill @e[name=SnowballMarker,tag=!hasSnowball]
  • It works, thanks a lot. However, I placed the kill armor stand command as the second command, then followed with the actual second command and so on. – DABSPIRIT Nov 21 '17 at 11:42

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.