Your first command is fine if you are changing it as you say.
The problem appears to be that you have a space between the selector (@a
) and the selector arguments ([score_Deaths_min=1]
), when there shouldn't be one. Try this command instead:
/give @a[score_Deaths_min=1] iron_sword
What you could do to test if you left-click the sword is have some mob (ex. an slime) that is made invisible, then teleported constantly to your head. For example, you could use this command:
summon Slime ~ ~1.4 ~ {NoAI:1,CustomName:"LeftClick",CustomNameVisible:0,Size:0,ActiveEffects:[{Id:14,Duration:1000000,Ambient:1}],Attributes:[{Name:generic.maxHealth,Base:1}]}
Basically, this command summons a Slime named LeftClick which is invisible and has half a heart of health. Then, you want to make a redstone clock attached to this command:
execute @p[score_IsHolding_min=1] ~ ~ ~ tp @e[name=LeftClick] ~ ~1.4 ~
This will constantly teleport that slime to your head. So, whenever you left click, you will hit the slime, which will add one to your InfinityBlade objective score count. Additionally, remember that you have to set up some sort of command to spawn a new LeftClick slime every time you left-click, since the previous one will be killed.
The only problem with this system is that you can't actually hit anything else with the sword, since the slime is constantly being teleported to you, so whenever you left-click, you hit the slime. Unfortunately, there's no way to get around this, so if this isn't what you want, you have to find another way to detect when you want to shoot a fireball.
However, if this idea works for you, you then have to be able to detect which way the player is facing to summon a fireball in that direction. To do this, you have to use an MCEdit filter called CPDirections. This video explains how to use the filter in great detail.
Hopefully I answered all of your questions.
Best Answer
You can use the
stat.damageDealt
andstat.damageTaken
objective-types to target players who have dealt and taken damage for multiplayer support.The following assumes you're using the latest version, being 1.9.
Prerequisites:
Objective to track damage dealt.
Objective to track damage taken.
Item to provide the player.
Clock commands:
The following must be run in numerical order on a clock.
Remove the label from players who were wielding the particular item in the event they are no longer holding it.
Mark players who are wielding the desired item. Any tags that are not the root
id
,Damage
,Count
, andSlot
will be placed within a singletag
compound.Cause players to are holding the sword and have dealt damage to inflict poison on the closest living player to them who has taken damage. Note, however, that targeting the actual player that was struck is impossible. There is nothing to state which player struck which player, short of guesswork via the auto-incrementing objectives. You may want to fiddle with the nested selector to fit your needs better.
Reset player's "Dealt" and "Taken" scores for future detection.