Hey friends. If anyone would be so kind as to explain/offer pictures of a sword that, when it strikes a mob, drops a lightning bolt with a 30 second cooldown, that would be great. I'm an idiot when it comes to scoreboard, and I've burned down 3 forests in my futile attempts thusfar. I understand the concept, but can't put my idea into a command.
/scoreboard players set @a[score_lightSword_min=1,score_lightCool=0] lightCool 600
/scoreboard players set @a[score_lightSword_min=1] lightSword 0
What this will do is when a player uses a golden sword lightning will strike the closest entity that is not the player that used the sword. Sometimes this will strike the wrong target, but for the most part it should be good enough. After they use the sword their cooldown will be set to 600 and each tick will reduce that by 1. Lightning will not strike unless the cooldown has reached 0.
@Nigathin: Where would I add a command block to only test for a diamond sword with a specific name, I.e. "Lightblade" (Not the actual name of the sword). There's only one sword with this effect in the whole map, but you can get normal diamond swords. Also, I want them to be able to equip it in any hot bar slot.