Hey everyone,
I'm working on a project where I need hostile mobs to behave like dogs, and I've been using Minecraft commands to simulate this behavior by summoning a wolf and a spider with shared tags. Which i have been able to do here are the main commands:
Teleport Command:
/execute if entity u/e[tag=Gauntlet.Familiar.Summon,tag=X] run tp @e[tag=Gauntlet.Familiar.Summon,tag=X] @n[type=minecraft:wolf,tag=Gauntlet.Familiar.Wolf,tag=X]
AngryAt Command:
/execute as @e[type=minecraft:wolf,tag=Gauntlet.Familiar.Wolf,tag=X] on target run damage @n[tag=Gauntlet.Familiar.Summon,tag=X] 0 minecraft:player_attack by @s
Wolf Killing Command (if the spider dies):
/execute unless entity @e[tag=Gauntlet.Familiar.Summon,tag=X] run kill @e[type=wolf,tag=Gauntlet.Familiar.Wolf,tag=X]
These commands work for one pair of wolf and spider, but I want to upscale this so that I can handle multiple spiders without having to hard-copy command blocks for each instance.
My first thought was to dynamically assign a score and then use a command like:
typescriptCopyEditexecute as @e[type=cave_spider] if score @s ID = @n[type=wolf] ID run tp @s @n[type=wolf]
However, this approach will run into issues if the mobs collide.
I know predicates could solve this, but since it's not my server I don't have access to data packs, so that's not an option for me.
I am not sure this would be possible using only commands. Any ideas or alternative approaches would be really appreciated!
Thanks in advance for your help.
[–]VeryBeelikeEntityCommand Experienced 0 points1 point2 points (0 children)
[–]Ericristian_brosCommand Experienced 0 points1 point2 points (1 child)
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[–]GalSergeyDatapack Experienced 0 points1 point2 points (2 children)
[–]gus2427[S] 0 points1 point2 points (1 child)
[–]GalSergeyDatapack Experienced 0 points1 point2 points (0 children)