#Can an entity be prevented from attacking us when wearing a piece of armor?
1 messages · Page 1 of 1 (latest)
you should check the piglins file :v
I've done it and it didn't work
There should be a has_equipment filter
I also thought that by adding the line of code where a piglin does not attack the player when we use a piece of armor an entity would have that behavior
The problem is that I want it to do that function on hostile entities except bosses.
The problem is that I have to place that behavior in all the behavior files of the entities that I want to be affected by it.
And I already did that but it didn't work for me, I don't know if it is necessary for its behaviors to be from the new versions
?? Do you have many entities that you want to have the same behavior?
Yeah
Except for the bosses
Nothing more to hostile mobs
I did that in the entities I wanted but for some strange reason it didn't work.
It's not possible, show me how you did it
Well I used the hostile entity behavior files from the official resource pack, and along with the piglin behavior in that part of the code I decided to copy and paste that line into the other entities, (right where it says which entity they should attack along with their conditions) but when I wanted to try it didn't work and that's even though I put the name of the attachable that I want
After that I gave up because I tried that 20 times
So I deleted those entity behavior files
did you set the priority correctly?
Yes, I did it as is the line of code
What I changed is the name of the attachable
No, this has priority 7, your code must need another priority
0_0
I will try to change it
priority must be lower than that of the melee component
Justly
That is, smaller numbers
The lower the number, the higher the priority?
But you also have to be careful, so that other components do not alter the attack priority.
yes
If you have a random movement component with priority 1, probably no other component with priority higher than 2 will work correctly.
0_0, no wonder some of my capybara's behaviors weren't working
So I have to set a higher priority so that the other behaviors that have priorities are lower than the highest one.
Just like the attachable
It didn't work
Here is his behavior
{
"filters": {
"any_of": [
{ "test": "is_family", "subject": "other", "value": "player" },
{ "test": "is_family", "subject": "other", "value": "snowgolem" },
{ "test": "is_family", "subject": "other", "value": "irongolem" }
]
},
"max_dist": 35
},
remove the first filter
,,mmmm no wait
I think it's better
Yes, delete it
@lime yarrow
Do I use this?
no
Aaa delete
delete that filter
Ok, I'll see.
It is the first
YES IT WORKS
It works the same as piglins
But if I removed the part about attacking iron golems, snow golems, etc., wouldn't that affect its behavior?
Maybe it will work if I put the line I deleted at the end.
Ouh?
Ok, deleting all that filter was too much, it's fixed here
Really? I'll try to see if it works the same.
The order is not important, so it doesn't matter where you place the filter.
Yey, yes it works :3
If you attack what you should attack
Now to place this function on the entities that I want to have it 🙂
Does it have to be in the same order?
I guess so