Detect Hostile or Docile Mobs

Status
Fixed
Issue description

Hello! I just released an Update of the MCreator Tutorial Mod and I just added the Guards, which is supposed to attack all hostile mobs around, but we need to add all mobs possible in here AI Builder, like in Image 1

 

What I am asking in this ticket is a Procedure block which is "Check if mob is [Hostile/Docile?]"

Or something same in AI Builder which is "Attack only[   ] Hostile Mobs?" or "Attack only[   ] Docile Mobs?"

I am asking this feature because guards won't attack Hostile mobs of other mods

Issue comments

For the AI tasks, we are limited to the functions that are available in AI tasks that Minecraft has and these can only define entities per name, not per type so we can't add this.

Hostility is also not a 100% defined parameter that would make checking this possible in procedures too.

The solution I see right now is that you make a list of all entities that are hostile and save it as a template so you can easily reuse it.

Ok but I hope there will be a way to check if mob is Hostile or Docile, because even with a list of all hostile entities, it won't work for mobs of other mods

Well as I said there is no 100% flag in the mob code to check if the entity is indeed hostile and mob "hostilness" can be implemented in many ways.

Back on this, It can be implemented in many ways, I see, You can add all the ways? Well I think No, because it will be hard

Then If we can't detect Hostility, Then there is another solution, A lot of procedures blocks like:

Can entity attack player?

Does Entity spawn during night?

Does Entity spawn during day?D

Does Entity burn to sun?

Entity can breed?

Entity can open doors?

Get Entity Speed

Get Entity Attack Damage

And surely many other ones may be possible to detect a mob,

What I am think is a IF for all mobs AI procedure blocks

 

 

Most of these are AI dependent and hard to detect, but some might be possible, but might not work accurately with all entities. I will check what can be done.