Hello everyone, so basically, i was trying to make an "event" inside of my minecraft world where all the zombies become stronger during this time. All other command blocks are working just fine, except for one.
This one should make all zombies that have a maximum health of 20 gain an health equivalent to 50 and to not burn in sunlight.
the command i made is this, but i can't make it work even by changing it over and over again. Can someone help me please?
/execute as @e[type=minecraft:zombie,distance=..300,nbt={Attributes:[{Name:"minecraft:generic.max_health",Base:20d}]}] run data merge entity @s[type=minecraft:zombie,distance=..300] {Fire:0,Health:50}
I think there's no need to add the max health attribute here in the end of the command, i made a separate command block for that and it works just fine.
You need to increase the base of the maxHealth attribute to 50.0d before increasing the health:
/execute as @e[type=zombie,nbt={Attributes:[{Name:"generic.maxHealth",Base:20.0d}]}] run data modify entity @s Attributes[0].Base set value 50.0d
/execute as @e[type=zombie,nbt={Attributes:[{Name:"generic.maxHealth",Base:50.0d}]}] run data modify entity @s Health set value 50.0f
Hello everyone, so basically, i was trying to make an "event" inside of my minecraft world where all the zombies become stronger during this time. All other command blocks are working just fine, except for one.
This one should make all zombies that have a maximum health of 20 gain an health equivalent to 50 and to not burn in sunlight.
the command i made is this, but i can't make it work even by changing it over and over again. Can someone help me please?
/execute as @e[type=minecraft:zombie,distance=..300,nbt={Attributes:[{Name:"minecraft:generic.max_health",Base:20d}]}] run data merge entity @s[type=minecraft:zombie,distance=..300] {Fire:0,Health:50}
I think there's no need to add the max health attribute here in the end of the command, i made a separate command block for that and it works just fine.
You need to increase the base of the maxHealth attribute to 50.0d before increasing the health:
Command block engineer // Developer // #TeamTrees