How to execute a command when left clicking a sword

I want to play a sound when I left click a sword using command blocks, but I cannot seem to get it to work when I set a scoreboard objective with stat.useItem.minecraft.iron_sword Answer You can’t detect it like that, since the useItem.minecraft.iron_sword statistic only increases when the sword actually hits something (and loses durability). Instead, … Read more

Minecraft 1.10 /testfor player manually breaking a specific block?

I was wondering if there was a way to test for players breaking a specific block, such as dirt. After they break the block, they die. Answer Set up an objective of the type you want, for example: /scoreboard objectives add BreakDirt stat.mineBlock.minecraft.dirt Then, on a clock and in this order, have the following commands: … Read more

Having problems trying to add multiple objectives to sidebar using command blocks in minecraft

I have had the objective KillCount on the sidebar for some time now, but I recently discovered the possibility of several objectives. Therefore I have been trying to add the deathCount, killCount and Distance by Elytra (unsure of the last ones objective name). I have never really used the scoreboard command and tried the following; … Read more

Command block problem, damaging snowballs [duplicate]

This question already has an answer here: How can I trigger a command when a player is hit by a Snowball? (1 answer) Closed last year. I’m trying to make a damaging snowball command which doesn’t need redstone (comparators, repeaters etc.) This is the entire code: Command one: /scoreboard players set xXElite_PythonXx HoldSnowball 1 {SelectedItemSlot:0,Inventory:[{tag:{display:{Name:”shuriken”,Lore:[“_____”]}}}]} … Read more