Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobs with no Attack Goal cannot use custom_hostile.json #151

Open
mxnmnm opened this issue Mar 26, 2024 · 3 comments
Open

Mobs with no Attack Goal cannot use custom_hostile.json #151

mxnmnm opened this issue Mar 26, 2024 · 3 comments
Labels
bug Something isn't working confirmed The problem is confirmed enhancement New feature or request

Comments

@mxnmnm
Copy link

mxnmnm commented Mar 26, 2024

Describe the bug
The Fight back chance under the animals configs ends up conflicting with custom ai's setup in the custom_flee.json and custom_hostile.json. The values chosen in the config will end up overwriting anything you did assuming you pick the mobs that are impacted by this config.

Versions where you encountered the problem (Use the exact version numbers, not 'latest' or similar):

  • Minecraft: 1.20.1
  • Neoforge: 47.1.103
  • Enhanced AI: 2.4.2
  • InsaneLib: 1.13.2

Steps to reproduce

  1. Set the Fight back chance to 0 in the config
  2. Make pigs attack chickens using the custom_hostile.json
  3. Make chickens run away from pigs using the custom_flee.json
  4. Watch as pigs don't attack the chickens (they still run away at this point)
  5. Set Fight back chance to 1 in the config
  6. Watch as chickens run away from the pigs until one of them gets hit, where they then ignore the custom_flee.json and just attack the pigs

Logs
https://gist.github.com/mxnmnm/6d2d9f68547fd8c3966256bf7cdcaccd

Can the issue be reproduced with EnhancedAI only (or with a minimal set of mods)?
Yes

@mxnmnm mxnmnm added the bug Something isn't working label Mar 26, 2024
@Insane96
Copy link
Owner

Configs?

@Insane96 Insane96 added the confirmed The problem is confirmed label Apr 8, 2024
@Insane96
Copy link
Owner

Insane96 commented Apr 8, 2024

The problem is that pigs (or most animals) don't have the MeleeAttackGoal, so they set the Chicken as a target but have no attack goal to attack them. Setting fighting back will make pigs attack chickens as they have the attack goal.

where they then ignore the custom_flee.json and just attack the pigs
As for this, as soon as the flee goal doesn't find a pig to flee from or a path, the goal fails and the attack back starts.

I will think about adding a custom_attack.json to add the attack goal to entities in the future

@Insane96 Insane96 changed the title Config overwrites custom jsons when it shouldn't Mobs with no Attack Goal cannot use custom_hostile.json Apr 8, 2024
@Insane96 Insane96 added the enhancement New feature or request label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmed The problem is confirmed enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants