Detect which player ignites the TNT using flint and steel

Detect which player ignites the TNT using flint and steel - Old fashioned cassette player placed in shabby garage near old industrial equipment

How can I detect when player ignite a TNT block, using flint and steel, and identify which player it is?

I want to then show a tellraw message. I have tried creating a scoreboard that detects when a player uses a flint and steel:

/scoreboard objectives add igniteTNT
/stat.useItem.minecraft.flint_and_steel

Then running the following on a fill clock:

/execute @e[type=PrimedTnt]
/execute @p[score_igniteTNT_min=1]
/tellraw @a [{selector:"@p",color:none},{text:" has ignited a tnt!",color:red}]
/scoreboard players reset @a igniteTNT

It seems like the stat.useItem.minecraft.flint_and_steel doesn't go up when using flint and steel on a TNT block.



Best Answer

If you have a clock set up at spawn, you could check for an activated tnt in a radius.

/testfor @e[type=PrimedTnt,r=300]

This would check for primed tnt in a radius of 300 blocks, for example...




Pictures about "Detect which player ignites the TNT using flint and steel"

Detect which player ignites the TNT using flint and steel - Focused ethnic female DJ playing music at nightclub
Detect which player ignites the TNT using flint and steel - Woman playing piano at free time
Detect which player ignites the TNT using flint and steel - Young male gamer wearing VR headset for exploring cyberspace and playing video games looking at camera



What is the correct tool to break TNT?

TNT can be broken instantly with any tool, or without a tool. However, primed TNT cannot be broken, as it is an entity, but it can be removed with the /kill command.

How do you summon primed TNT on a player?

You can create a fire charge by placing a charcoal in the center of the grid, a blaze powder to the left of it, and a gunpowder below it. Fire charges are not as efficient as flint and steel, as you lose the charge that you throw. Throwing a fire charge at the TNT will light it.



✔ Minecraft: 15 Things You Didn't Know About the Flint and Steel




More answers regarding detect which player ignites the TNT using flint and steel

Answer 2

Firstly the /scoreboard command should be

/scoreboard objectives add igniteTNT stat.useItem.minecraft.flint_and_steel igniteTNT

Secondly, you should have a commandblock fill clock. The first command should be the command to test if a player has ignited the TNT.

/execute @p[score_igniteTNT_min=1] ~ ~ ~ /execute @e[type=PrimedTnt,r=4] ~ ~ ~ /tellraw @a ["",{"selector":"@p"},{"text":" has ignited the TNT"}]

and the second should be

/scoreboard players set @a igniteTnt 0

Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Andrea Piacquadio, Fardad Postwala, Charles Parker, Eren Li