TransWikia.com

How do I run a summon command based on the amount of HP the main mob has?

Arqade Asked by Mr Guy on July 20, 2021

I have tried many lines of code, and none of them seem to work. This is the code I use to store the health score:

execute as @e[type=zombie,limit=1] at @s store result score @s Health run data get entity @s Health

This is the code I use to check if it’s equal to or under a certain amount and summon the mob:

execute if score @e[type=zombie,limit=1] Health matches ..20 run summon minecraft:wither_skeleton -106 80 -30

None of the command blocks work, and they don’t even have a log output. How do I run a summon command based on the amount of HP the main mob has?

One Answer

Check the following:

Are the command blocks being activated? The command block for the first command should be Repeating.

Is the zombie selected in the second command the same zombie that was selected in the first?

Make sure the Health scoreboard is a dummy scoreboard (/scoreboard objectives add Health dummy).

Answered by ginkgo on July 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP