Aggressive Animals command by MrGarretto
by Redsword 1556 1429 1
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!
VIDEO
How to install
How to import this command into your world
First, you must give yourself a command block (If you are on a server, you must be 'OP'ed, and have access to /gamemode 1)
To get a command block, type
/give @p command_block in the chat.
Once you have a command block, right click it to open it's GUI.
Now, you must copy and paste the command from your browser into the game. Select the entire command from below, then right click and press 'copy'.
Next, go back to your minecraft world, and paste the command you just copied into the command block. There are a few different keys that may be used to do this, depending on your keyboard. The most common ones are 'CTRL + V', 'COMMAND + V', or 'STRG + V'
Finally, you can press done to exit the GUI, and execute the command block by powering it with a redstone block, a lever, or any thing you can get your grubby hands on. Just make sure you don't place it on top of the command block, or the machine will not be installed!
Show source commands
#Tellraw
INIT:/tellraw @a ["",{"text":"One Commands créer par MrGarretto","color":"dark_aqua"},{"text":"\n"},{"text":"-","color":"red"},{"text":"Youtube","color":"red","clickEvent":{"action":"open_url","value":"https://www.youtube.com/user/JustMrGarretto"}},{"text":"\n"},{"text":"-","color":"green"},{"text":"Patreon","color":"green","clickEvent":{"action":"open_url","value":"https://www.patreon.com/MrGarretto"}},{"text":"\n--------------------------------\n"},{"text":"Mise a jour par Video_Game25","color":"gold"},{"text":"\n"},{"text":"-","color":"red"},{"text":"Youtube","color":"red","clickEvent":{"action":"open_url","value":"https://www.youtube.com/channel/UC5XAsoHEco6EyKapwcpFwuA"}}]
#Scoreboard
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
summon FallingSand ~ ~1 ~ {Block:stone,Time:1,Passengers:[{id:FallingSand,Block:redstone_block,Time:1,Passengers:[{id:FallingSand,Block:activator_rail,Time:1,Passengers:[{id:MinecartCommandBlock,Command:gamerule commandBlockOutput false},{id:MinecartCommandBlock,Command:fill ~2 ~-3 ~-2 ~8 ~ ~2 stained_hardened_clay 14 hollow},{id:MinecartCommandBlock,Command:fill ~2 ~-2 ~-2 ~8 ~-1 ~2 stained_glass 2 0 stained_hardened_clay},{id:MinecartCommandBlock,Command:"/tellraw @a [\"\",{\"text\":\"One Commands créer par MrGarretto\",\"color\":\"dark_aqua\"},{\"text\":\"\\n\"},{\"text\":\"-\",\"color\":\"red\"},{\"text\":\"Youtube\",\"color\":\"red\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.youtube.com/user/JustMrGarretto\"}},{\"text\":\"\\n\"},{\"text\":\"-\",\"color\":\"green\"},{\"text\":\"Patreon\",\"color\":\"green\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.patreon.com/MrGarretto\"}},{\"text\":\"\\n--------------------------------\\n\"},{\"text\":\"Mise a jour par Video_Game25\",\"color\":\"gold\"},{\"text\":\"\\n\"},{\"text\":\"-\",\"color\":\"red\"},{\"text\":\"Youtube\",\"color\":\"red\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://www.youtube.com/channel/UC5XAsoHEco6EyKapwcpFwuA\"}}]"},{id:MinecartCommandBlock,Command:/scoreboard objectives add AAn_Anger dummy},{id:MinecartCommandBlock,Command:/scoreboard objectives add AAn_isAnimal dummy},{id:MinecartCommandBlock,Command:/scoreboard objectives add AAn_Clock dummy},{id:MinecartCommandBlock,Command:/scoreboard objectives add AAn_Home dummy},{id:MinecartCommandBlock,Command:"/tellraw @a [{color:\"red\",text:\"The Aggressive Animals \"},{color:\"dark_aqua\",text:\"command module has been installed!\"}]"},{id:MinecartCommandBlock,Command:setblock ~1 ~-2 ~ wall_sign 4 0 {Text1:"{\\\"text\\\":\\\"=-=-=-=-=-=-=-=-=-=\\\",\\\"color\\\":\\\"dark_red\\\"}",Text2:"{\\\"text\\\":\\\"Destroy\\\",\\\"color\\\":\\\"red\\\"}",Text3:"{\\\"text\\\":\\\"Machine\\\",\\\"color\\\":\\\"red\\\"}",Text4:"{\\\"text\\\":\\\"=-=-=-=-=-=-=-=-=-=\\\",\\\"color\\\":\\\"dark_red\\\",\\\"clickEvent\\\":{\\\"action\\\":\\\"run_command\\\",\\\"value\\\":\\\"fill ~ ~-1 ~-2 ~7 ~2 ~2 air\\\"}}"}},{id:MinecartCommandBlock,Command:setblock ~1 ~-1 ~ wall_sign 4 0 {Text1:"{\\\"text\\\":\\\"=-=-=-=-=-=-=-=-=-=\\\",\\\"color\\\":\\\"dark_green\\\",\\\"clickEvent\\\":{\\\"action\\\":\\\"run_command\\\",\\\"value\\\":\\\"scoreboard players add @e[type=ArmorStand,name=TogAct,c=1] nDMQqj_A 1\\\"}}",Text2:"{\\\"text\\\":\\\"On/Off\\\",\\\"color\\\":\\\"green\\\",\\\"clickEvent\\\":{\\\"action\\\":\\\"run_command\\\",\\\"value\\\":\\\"execute @e[score_nDMQqj_A_min=1,score_nDMQqj_A=1] ~ ~ ~ blockdata ~ ~ ~ {auto:0}\\\"}}",Text3:"{\\\"text\\\":\\\"\\\",\\\"clickEvent\\\":{\\\"action\\\":\\\"run_command\\\",\\\"value\\\":\\\"execute @e[score_nDMQqj_A_min=2] ~ ~ ~ blockdata ~ ~ ~ {auto:1}\\\"}}",Text4:"{\\\"text\\\":\\\"=-=-=-=-=-=-=-=-=-=\\\",\\\"color\\\":\\\"dark_green\\\",\\\"clickEvent\\\":{\\\"action\\\":\\\"run_command\\\",\\\"value\\\":\\\"scoreboard players reset @e[score_nDMQqj_A_min=2] nDMQqj_A\\\"}}"}},{id:MinecartCommandBlock,Command:summon ArmorStand ~3 ~-2 ~-1 {CustomName:TogAct,Marker:1,NoGravity:1,Invisible:1}},{id:MinecartCommandBlock,Command:scoreboard objectives add nDMQqj_A dummy},{id:MinecartCommandBlock,Command:fill ~3 ~-2 ~-1 ~7 ~-1 ~1 chain_command_block 5},{id:MinecartCommandBlock,Command:fill ~7 ~-1 ~1 ~6 ~-1 ~1 chain_command_block 4},{id:MinecartCommandBlock,Command:setblock ~7 ~-2 ~1 chain_command_block 1},{id:MinecartCommandBlock,Command:setblock ~3 ~-2 ~ chain_command_block 3},{id:MinecartCommandBlock,Command:fill ~7 ~-2 ~ ~4 ~-2 ~ chain_command_block 4},{id:MinecartCommandBlock,Command:setblock ~7 ~-2 ~-1 chain_command_block 3},{id:MinecartCommandBlock,Command:setblock ~3 ~-2 ~-1 repeating_command_block 5},{id:MinecartCommandBlock,Command:blockdata ~6 ~-1 ~1 {auto:1,Command:/execute @e[score_AAn_Anger_min=1] ~ ~ ~ fill ~ 255 ~ ~ 255 ~ wool 14 replace air 0}},{id:MinecartCommandBlock,Command:blockdata ~7 ~-1 ~1 {auto:1,Command:/execute @e[score_AAn_Anger_min=1] ~ ~ ~ fill ~-1 255 ~-1 ~1 255 ~1 air 0 replace wool 14}},{id:MinecartCommandBlock,Command:blockdata ~7 ~-2 ~1 {auto:1,Command:/execute @e[type=Item] ~ ~ ~ fill ~-1 255 ~-1 ~1 255 ~1 air 0 replace wool 14}},{id:MinecartCommandBlock,Command:blockdata ~6 ~-2 ~1 {auto:1,Command:/execute @e[score_AAn_Anger_min=1,score_AAn_Clock=0] ~ ~ ~ fill ~ ~-1 ~ ~ ~-1 ~ dirt 0 replace grass 0}},{id:MinecartCommandBlock,Command:blockdata ~5 ~-2 ~1 {auto:1,Command:/execute @e[score_AAn_Anger_min=1,score_AAn_Clock=0] ~ ~ ~ effect @a[r=2] minecraft:instant_damage 1 0 true}},{id:MinecartCommandBlock,Command:blockdata ~4 ~-2 ~1 {auto:1,Command:/execute @e[score_AAn_Anger_min=1,score_AAn_Clock=0] ~ ~0.8 ~ particle angryVillager ~ ~ ~ 0 0 0 1}},{id:MinecartCommandBlock,Command:blockdata ~3 ~-2 ~1 {auto:1,Command:/scoreboard players set @e[score_AAn_Clock_min=20] AAn_Clock 0}},{id:MinecartCommandBlock,Command:blockdata ~3 ~-2 ~ {auto:1,Command:/scoreboard players add @e[score_AAn_isAnimal_min=1] AAn_Clock 1}},{id:MinecartCommandBlock,Command:blockdata ~4 ~-2 ~ {auto:1,Command:/scoreboard players set @e[type=Chicken] AAn_Anger 0 {Health:4s}}},{id:MinecartCommandBlock,Command:blockdata ~5 ~-2 ~ {auto:1,Command:/scoreboard players set @e[type=Sheep] AAn_Anger 0 {Health:8s}}},{id:MinecartCommandBlock,Command:blockdata ~6 ~-2 ~ {auto:1,Command:/scoreboard players set @e[type=Pig] AAn_Anger 0 {Health:10s}}},{id:MinecartCommandBlock,Command:blockdata ~7 ~-2 ~ {auto:1,Command:/scoreboard players set @e[type=Cow] AAn_Anger 0 {Health:10s}}},{id:MinecartCommandBlock,Command:blockdata ~7 ~-2 ~-1 {auto:1,Command:/scoreboard players set @e[score_AAn_isAnimal_min=1] AAn_Anger 1}},{id:MinecartCommandBlock,Command:blockdata ~6 ~-2 ~-1 {auto:1,Command:/scoreboard players set @e[type=Chicken] AAn_isAnimal 1}},{id:MinecartCommandBlock,Command:blockdata ~5 ~-2 ~-1 {auto:1,Command:/scoreboard players set @e[type=Sheep] AAn_isAnimal 1}},{id:MinecartCommandBlock,Command:blockdata ~4 ~-2 ~-1 {auto:1,Command:/scoreboard players set @e[type=Pig] AAn_isAnimal 1}},{id:MinecartCommandBlock,Command:blockdata ~3 ~-2 ~-1 {auto:1,Command:/scoreboard players set @e[type=Cow] AAn_isAnimal 1}},{id:MinecartCommandBlock,Command:setblock ~ ~ ~1 command_block 0 0 {Command:fill ~ ~-3 ~-1 ~ ~ ~ air}},{id:MinecartCommandBlock,Command:setblock ~ ~-1 ~1 redstone_block},{id:MinecartCommandBlock,Command:kill @e[type=MinecartCommandBlock,r=1]}]}]}]}