MrGarretto's One-Command Creations

Giving the modded minecraft feeling to vanilla

Aggressive Animals command
About this command
This command causes animals to become aggressive when they are hit! It also causes them to create trails, and show on a radar when they are aggressive!
Show source commands

INIT:/scoreboard objectives add AAn_Anger dummy
INIT:/scoreboard objectives add AAn_isAnimal dummy
INIT:/scoreboard objectives add AAn_Clock dummy
INIT:/scoreboard objectives add AAn_Home dummy
INIT:/tellraw @a [{color:"red",text:"The Aggressive Animals "},{color:"dark_aqua",text:"command module has been installed!"}]
# Find all animals, and group them into the AAn_isAnimal category.
/scoreboard players set @e[type=Cow] AAn_isAnimal 1
/scoreboard players set @e[type=Pig] AAn_isAnimal 1
/scoreboard players set @e[type=Sheep] AAn_isAnimal 1
/scoreboard players set @e[type=Chicken] AAn_isAnimal 1
# Manage aggression level for animals
/scoreboard players set @e[score_AAn_isAnimal_min=1] AAn_Anger 1
/scoreboard players set @e[type=Cow] AAn_Anger 0 {Health:10s}
/scoreboard players set @e[type=Pig] AAn_Anger 0 {Health:10s}
/scoreboard players set @e[type=Sheep] AAn_Anger 0 {Health:8s}
/scoreboard players set @e[type=Chicken] AAn_Anger 0 {Health:4s}
# Manage the clock
/scoreboard players add @e[score_AAn_isAnimal_min=1] AAn_Clock 1
/scoreboard players set @e[score_AAn_Clock_min=20] AAn_Clock 0
# Do stuff based on the aggression level
/execute @e[score_AAn_Anger_min=1,score_AAn_Clock=0] ~ ~0.8 ~ particle angryVillager ~ ~ ~ 0 0 0 1
/execute @e[score_AAn_Anger_min=1,score_AAn_Clock=0] ~ ~ ~ effect @a[r=2] minecraft:instant_damage 1 0 true
/execute @e[score_AAn_Anger_min=1,score_AAn_Clock=0] ~ ~ ~ fill ~ ~-1 ~ ~ ~-1 ~ dirt 0 replace grass 0
/execute @e[type=Item] ~ ~ ~ fill ~-1 255 ~-1 ~1 255 ~1 air 0 replace wool 14
/execute @e[score_AAn_Anger_min=1] ~ ~ ~ fill ~-1 255 ~-1 ~1 255 ~1 air 0 replace wool 14
/execute @e[score_AAn_Anger_min=1] ~ ~ ~ fill ~ 255 ~ ~ 255 ~ wool 14 replace air 0

For Minecraft version 1.8.3
Click here for other versions of this command!
How to use
Give yourself a command block with /give @p command_block. Place it then paste the command from below into it. One command creations are similar to Minecraft mods, but are much easier to add to your world!
Click here for other versions of this command!