After playing around a bit, I have found a workaround for the non-functioning stat
objective. It works by using Flint and Steel with a durability of 0 (i.e. Damage of 64), which are automatically given to every player that does not currently have flint and steel somewhere in his inventory.
First, set up the objective as a dummy, also set up an objective tracking whether or not a TNT was already ignited.
/scoreboard objectives add hasFlintAndSteel dummy
/scoreboard objectives add Fuse dummy
Now create a fill clock and run the following 4 commands (in this order):
/scoreboard players set @a hasFlintAndSteel 0
/scoreboard players set @a hasFlintAndSteel 1 {Inventory:[{id:minecraft:flint_and_steel}]}
/scoreboard players add @e[type=PrimedTnt] Fuse 1
/execute @e[type=PrimedTnt,score_Fuse=1] ~ ~ ~ execute @p[score_flintandsteel=0,r=5] ~ ~ ~ tellraw @a ["",{selector:@p,bold:true}," has set us up the bomb!"]
/give @a[score_flintandsteel=0] minecraft:flint_and_steel 1 64
- The first two commands determine whether a player currently has flint and steel in this clock cycle/tick.
- The third command tracks the fuse time of all primed TNT entities. It is used to execute only on newly ignited TNT.
- The forth command checks for a player who just used his flint and steel in a 5 block radius around every freshly primed TNT. If a player is found, the tellraw command is executed at that player.
- The fith command gives an almost broken flint and steel to every player without one.
Since this method requires the Flint and Steel to break, this will only work in Survival or Adventure mode. Also, there is an annoying clunk sound and particles on screen every time you use your Flint and Steel.
If not everyone in your game has access to Flint and Steel, you can use another objective to only give it to the players that do in the 5th command.
This took me a while, I even manually went through all the steps (which is my last hope against bugs), but then I got it:
You just need to add ,tag=!D_InventorSkull
to the selector in the first command.
That way the skinned head doesn't get the baseSkull
tag and the first execute
in the third command doesn't trigger a second time.
scoreboard players tag @e[type=Item,tag=!baseSkull,tag=!D_InventorSkull] add baseSkull {Item:{id:"minecraft:skull",Damage:3s,Count:1b}}
Also, are you sure you don't want to kill the arrow, too? In that case you should add a sixth command:
execute @e[tag=D_InventorSkull] ~ ~ ~ kill @e[type=arrow,r=1]
In 1.13:
execute as @e[tag=D_InventorSkull] at @s run kill @e[type=arrow,distance=..1]
Best Answer
No, it is not possible to keep the item in the crafting grid and to damage it with a crafting recipe, though this might change in the future.
Buckets are actually an exception to the general crafting rules. If you use a filled bucket in a recipe, then it acts as if you just use the liquid. Giving back the bucket is no more than removing the bucket with the liquid from the grid and replacing it with an empty bucket. They are in fact two totally different items.
There are alternatives to actual crafting recipes, such that you can damage items, but they require some commands.
You can use floor crafting for example where you throw your items on the floor and they turn into your resulting item. In minecraft 1.13, you can retrieve the damage from your flint and steel and store it in a scoreboard. Then you can subtract 1 from the score and put the score back into the flint and steel.