3
Making mobs agressive with commands?
i want to make a skeleton that is friendly to players but agressive to litteraly everything else.
i made it passive by creating a team and having it and the players join it.
as for the agressive part i used the snowball method but i'm wondering if there's a more... subtle way
i made it passive by creating a team and having it and the players join it.
as for the agressive part i used the snowball method but i'm wondering if there's a more... subtle way
Create an account or sign in to comment.
10
I Got you, its a new solution never before seen by anybody and its only like one command.
/execute as @e[type=skeleton,sort=nearest,limit=1] at @e[type=zombie,sort=nearest,limit=1] run damage @s 1 generic by @e[type=zombie,sort=nearest,limit=1]
this makes a zombie and skeleton have a fight by damaging the nearest skeleton by the attacker the nearest zombie!Kind of curios too what your making with this knowledge?
/execute as @e[type=skeleton,sort=nearest,limit=1] at @e[type=zombie,sort=nearest,limit=1] run damage @s 1 generic by @e[type=zombie,sort=nearest,limit=1]
this makes a zombie and skeleton have a fight by damaging the nearest skeleton by the attacker the nearest zombie!Kind of curios too what your making with this knowledge?
i'm making this origins type datapack and one of the origins is a necromancer, it's a support class and i wanted to add an attack, so i made it able to summon undead mobs (skeletons, zombies, phantoms and all the variants depending on the enviroment), but until now i was only able to make them attack players, or be completely passive if the place they are on has a celing.
thanks for the help
thanks for the help
They're most likely making a follower system with hostile mobs being as part of the pool like pokemon.
Also your command is both 1. inefficient because you're checking for the nearest zombie twice from scratch and 2. already known by a supermajority of the minecraft datapacking/command blocking community. /damage was pretty much asked for since forever.
Heres a vid explaining the command from a year ago
Also your command is both 1. inefficient because you're checking for the nearest zombie twice from scratch and 2. already known by a supermajority of the minecraft datapacking/command blocking community. /damage was pretty much asked for since forever.
execute as @e[type=skeleton,tag=follower] at @s run damage @s 0.0 generic by @e[tag=zombie,distance=..10,sort=nearest,limit=1]
Heres a vid explaining the command from a year ago
hm... it works, but the knockback is making it impossible for them to attack
There should not be any knockback, especially with the generic attack type.
idk what to tell you, there is. i added a cooldown and now it's fine
thank you, i'll try it right now
Ye fair enough, did not know that cloudwolf did a video on it. But yeah it was just some goofy hype. Also What about a data merge command? Make a mob follow a id of an entity nearest to itself?
data merge would only work on neutral mobs such as wolves, iron golems and piglins as they have nbt that makes them aggressive towards a specific entity. The aggressiveness of naturally hostile mobs (i.e. zombies) cannot be accessed without /damage as that is the only interface that relevnantly interacts.
If you're just talking about the skeleton following the player, that'll require pathfinding such as via the use of wandering traders
If you're just talking about the skeleton following the player, that'll require pathfinding such as via the use of wandering traders
True! yeh it depends on how you want to go about making the mobs agro onto other mobs, you could also make an invis golem and tp the entity to that specific golem facing the same way, to sorta make em agro on all hostile mobs? some downsides to this is it launches the mob how an iron golem would and its only for physical contact, no shooty the bow :P