Minecraft – How to modify mob attribute in minecraft

minecraft-commandsminecraft-java-edition

The hard difficulty is not hard enough for me so I decided to change the attributes of all mobs with command blocks, but I am having some problems. I modified zombies with the command:

/entitydata @e[type=zombie] {Attributes:[{Name:generic.maxHealth,Base:30},{Name:generic.attackDamage,Base:6}],Health:30f}

My command block works with clock redstone (it don't work in repetition mod with this line, though, I don't know why) so the zombie always self-regens, is there an another way ?

How can I modify the damage of a skeleton archer without modifying all arrows? Same for ghast or blaze?

I would like the game to spawn giants who are aggressive. Is it possible to do this with command blocks?

If I modify the damage of one mob (a zombie for example) and he takes a weapon, is the damage additional?

Best Answer

Questions One & Two

There is a way to do this but without the entitydata command, rater than modify the entity's damage and health that way with a skeleton it is easier to give them an enchanted bow or a bow with attribute modifiers.

Skeletons

The following command will give all skeletons in the world a bow that makes their health 200% of it's original and slightly more damage. This also makes the shot more powerful and sets the arrow on fire because of the punch and flame effects applied.

/replaceitem entity @e[type=skeleton] slot.weapon minecraft:bow 1 0 {AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:20,Operation:1,UUIDLeast:398320,UUIDMost:481485},{AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:2,Operation:1,UUIDLeast:124027,UUIDMost:199291}],ench:[{id:49,lvl:10},{id:50,lvl:1}]}

Blazes

This is harder but still doable thanks to the attribute modifiers on stuff. This also makes the blaze drop a little more blaze rods because it is technically wearing a blaze rod:

/replaceitem entity @e[type=blaze] slot.armor.chest minecraft:blaze_rod 1 0 {AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:20,Operation:1,UUIDLeast:398320,UUIDMost:481485},{AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:2,Operation:1,UUIDLeast:124027,UUIDMost:199291}]}

The rest can all be done using MC Stacker which gives you the commands if you specify the attributes you want to add using the format established.

Question Three

Place command blocks in a central location and then perform these commands using chained command blocks to spawn aggressive giants at the push of a button randomly thought the world (Also They Have Laser Eyes):

/summon guardian ~ ~1 ~ {Attributes:[{Name:generic.attackDamage,Base:100},{Name:generic.followRange,Base:100}],Silent:1,ActiveEffects:[{Id:14,Amplifier:1,Duration:200000,ShowParticles:0b}],Passengers:[{id:"giant"}]}
/spreadplayers ~ ~ 1500 10000 false @e[type=Giant,r=10]

Question Four

I tested this with the attribute modifier method and the answer seems to be no but this may depend on the operation type of the modifier.