#How to make it have mutiple minecraft:behavior.nearest_attackable_targets
1 messages · Page 1 of 1 (latest)
"traye:zombie_team_blue": {
"minecraft:damage_sensor": {
"triggers": [
{
"on_damage": {
"filters": {
"test": "has_tag",
"subject": "other",
"value": "blueTeam"
}
},
"deals_damage": false
}
]
},
"minecraft:skin_id": {
"value": 1
},
"minecraft:behavior.nearest_attackable_target": {
"priority": 2,
"must_see": true,
"reselect_targets": true,
"within_radius": 25.0,
"must_see_forget_duration": 17.0,
"entity_types": [
{
"filters": {
"none_of": [
{ "test": "has_tag", "subject": "other", "value": "blueTeam" },
{ "test": "is_family", "subject": "other", "value": "zombie" }
],
"all_of": [
{ "test": "is_family", "subject": "other", "value": "player"}
]
},
"max_dist": 35
}
]
}
},
"traye:zombie_team_red": {
"minecraft:damage_sensor": {
"triggers": [
{
"on_damage": {
"filters": {
"test": "has_tag",
"subject": "other",
"value": "redTeam"
}
},
"deals_damage": false
}
]
},
"minecraft:skin_id": {
"value": 2
},
"minecraft:behavior.nearest_attackable_target": {
"priority": 2,
"must_see": true,
"reselect_targets": true,
"within_radius": 25.0,
"must_see_forget_duration": 17.0,
"entity_types": [
{
"filters": {
"none_of": [
{ "test": "has_tag", "subject": "other", "value": "redTeam" },
{ "test": "is_family", "subject": "other", "value": "zombie" }
],
"all_of": [
{ "test": "is_family", "subject": "other", "value": "player"}
]
},
"max_dist": 35
}
]
}
},```
this is in component groups
Everything is well written, you have to say what the error is and how you expect it to work.
I think what he means is that group makes it only attack 1 mob until its out of range or it dies, I think he wants it to try to attack multiple targets in range at once
You can try setting the max distance for each to be lower, so itll kinda mimic it.
but itll have llimitations
I want to be able to change the entity so it can be like a team zombie and attack 1 side or the other
Well, I see it as correct.
I would only fix the filters
So that they attack only players of the opposite color
No
well what i did was not attac the team that the zombie is on
but that should still work
right?
It should be something like this all_of:[ {family player},{tag redteam}] I think adding the zombie filter is not necessary
its to make the zombies
not attack eachother
because thats what they were doing before
Were they attacking each other? Maybe instead of using all_of, you used any_of.
oh that was before i added that
Ok
bro now hes tryna attack the npc
with these filters
{
"filters": {
"all_of": [
{ "test": "has_tag", "subject": "other", "value": "redTeam" },
{ "test": "is_family", "subject": "other", "value": "player"}
]
},
"max_dist": 35
}```
this npc has
"minecraft:type_family": {
"family": [
"npc",
"mob"
]
},```
wait i think i figured out the issue
its with changing
when hes agro
so how do i make him stop being agro
wait thats not the full story
the zombie initially spawns with this
"traye:add_no_attack_owner": {
"minecraft:damage_sensor": {
"triggers": [
{
"on_damage": {
"filters": {
"test": "is_owner",
"subject": "other",
"value": true
}
},
"deals_damage": false
}
]
},
"minecraft:tameable": {},
"minecraft:skin_id": {
"value": 0
},
"minecraft:behavior.nearest_attackable_target": {
"priority": 2,
"must_see": true,
"reselect_targets": true,
"within_radius": 25.0,
"must_see_forget_duration": 17.0,
"entity_types": [
{
"filters": {
"none_of": [
{ "test": "is_family", "subject": "other", "value": "zombie"}
],
"all_of": [
{ "test": "is_owner", "subject": "other", "value": false }
]
},
"max_dist": 35
}
]
}
},```
which is why
but i set him to red team
and he still did
until i hit him
and he went after me
then i switched to creative
then hes chill
so thats why i think agro is the problem
Ok, did you remove that group before adding the new team group?
Can you send all the code?
Ok Ok, I don't know how you're testing it, that's probably the problem, you have to remove the previous component group before changing the group, if you execute the blue event, You must add the blue group and remove the red group, and the same with the other event
Also removes the owner group en cada evento
You add events and they pile up, everything is chaos
wait i think it just works
You have 3 groups with nearest attack, when you add one make sure to remove the
Unless the question is... "How do I add a turret to my mob?"
I legit don't understand the question...
I know the Wither's two heads - in a way - act like turrets (if that makes sense...)
lemme rephrase
How can i make a zombie have mutiple minecraft:behavior.nearest_attackable_target behaviors?
and switch between them accordingly
OH!
The problem is almost solved.
Show the code to check it
I know that Zombies typically don't "lock-on" to people like Creepers do, if that helps
I see people use a buddy system to have one guy kite a Creeper, then the other guy gets a free kill
Zombies don't fall for that
THey automatically attack whomever smacks them last
Even if that's not what this is about, I wanted to share that because this reminded me of that Mob AI fact
Having them be able to "switch targets" on the fly sounds pretty... "advanced"
yeah its solved but its kinda weird
i have to spawn them as one thing
and never swithc them
twitch: https://www.twitch.tv/alteregosocial
discord: https://discord.gg/TPwdMKtJS6
business email: [email protected]
Snycent's Fiverr
https://www.fiverr.com/pro_nick?source=inbox
Chapters:
00:00 - Intro
00:41 - Spawning
01:14 - Goal System
01:29 - Wander Phase
03:23 - Chase Phase
05:49 - Health
06:50 - Loot Drops
07:23 - Leader Zo...
Feel free to give videos like this a watch, when you've the time. (Even if you already know the details.) It's worth it, imo.) ❤️
Yes , has that component activated although I doubt they will hit each other, Although if I wanted to avoid it I would simply remove the hurt_by_target component
Share the code to check it out
Tfw a Drowned accidentally hits the Leader Zombie with his thrown Trident:
https://youtu.be/AM4j9ObRUpA?si=abtJ5i3cCw-qlwsj
I had to... XD
You haven't changed anything about the events, :v
ay what works, works man