1

Execute Problems

Mikey67's Avatar Mikey675/2/18 7:47 pm history
1 emeralds 159 3
5/2/2018 8:43 pm
Barlennan's Avatar Barlennan
I'm trying to use the following command to make a dropped tnt item named Grenade explode. I'm using 1.12.2.
/execute @e[type=item] /testfor @e[type=Item] ~ ~ ~ {Item:{id:"minecraft:tnt",tag:{display:{Name:Grenade}}}} /summon creeper ~ ~ ~ {Fuse:0}
For some reason it won't summon the creeper and it outputs:
[16:40:26] Failed to execute '{Item:{id:"minecraft:tnt",Count:1b,tag:{display:{Name:"Grenade"}}}} /summon creeper ~ ~ ~ {Fuse:0}' as item.tile.tnt

SOLVED
Posted by Mikey67's Avatar
Mikey67
Level 24 : Expert Artist
0

Create an account or sign in to comment.

3

1
05/02/2018 8:43 pm
Level 42 : Master Engineer
Barlennan
Barlennan's Avatar
The way to do that is to scoreboard tag all tnt items named grenade with explode in a repeating command block:

scoreboard players tag @e[type=item] add explode {Item:{id:"minecraft:tnt",Count:1b,tag:{display:{Name:"grenade"}}}}

and then make them blow up in a chain command block:

execute @e[tag=explode] ~ ~ ~ summon tnt


HOWEVER: I think you want them to be able to land on the ground first before they explode, so they don't explode in the player's face immediately? Or, have a timer? To have a timer, do these:

To do that, first type this command:

/scoreboard objectives add explode dummy explode

Then, place a repeating command block and type in this command:

scoreboard players tag @e[type=item] add explode {Item:{id:"minecraft:tnt",Count:1b,tag:{display:{Name:"grenade"}}}}

Then put a chain command block after it and type this command into it:

scoreboard players add @e[tag=explode] explode 1

Then put another chain command block after the previous one and type this command into it:

execute @e[score_explode_min=60] ~ ~ ~ summon tnt ~ ~ ~

Or, if you want to have them explode when they hit the ground, tell me and i'll try. but its much harder to do that.
1
05/02/2018 8:15 pm
Level 42 : Master Engineer
Barlennan
Barlennan's Avatar
There are multiple things wrong with that command, here's what they are and how to fix:

-after the execute @e[type=item] is an ~ ~ ~

-unfortunately, you can't do a testfor and then a command...

-I'm pretty sure you don't need the tag:{} part
1
05/02/2018 8:03 pm
Level 42 : Master Engineer
Barlennan
Barlennan's Avatar
The tag is probably wrong. I'll look into it and see if I can fix it :)
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome