3

Making mobs agressive with commands?

web_warrior_geo_1's Avatar web_warrior_geo_12/24/24 4:38 pm
2/26/2024 11:58 am
web_warrior_geo_1's Avatar web_warrior_geo_1
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
Posted by web_warrior_geo_1's Avatar
web_warrior_geo_1
Level 1 : New Miner
1

Create an account or sign in to comment.

10

2
02/24/2024 8:17 pm
Level 42 : Master uwu
ICanGamez
ICanGamez's Avatar
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?
2
02/25/2024 8:37 am
Level 1 : New Miner
web_warrior_geo_1
web_warrior_geo_1's Avatar
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
3
02/24/2024 8:56 pmhistory
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
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.

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
2
02/25/2024 8:44 am
Level 1 : New Miner
web_warrior_geo_1
web_warrior_geo_1's Avatar
hm... it works, but the knockback is making it impossible for them to attack
1
02/25/2024 6:36 pm
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
There should not be any knockback, especially with the generic attack type.
1
02/26/2024 11:58 am
Level 1 : New Miner
web_warrior_geo_1
web_warrior_geo_1's Avatar
idk what to tell you, there is. i added a cooldown and now it's fine
2
02/25/2024 8:37 am
Level 1 : New Miner
web_warrior_geo_1
web_warrior_geo_1's Avatar
thank you, i'll try it right now
1
02/24/2024 9:54 pm
Level 42 : Master uwu
ICanGamez
ICanGamez's Avatar
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?
2
02/24/2024 11:13 pmhistory
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
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
1
02/25/2024 10:05 am
Level 42 : Master uwu
ICanGamez
ICanGamez's Avatar
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
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome