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

Charm of the Diva does not make mob attack something else #4561

Closed
TheRealWormbo opened this issue Jan 21, 2024 · 1 comment · Fixed by #4656
Closed

Charm of the Diva does not make mob attack something else #4561

TheRealWormbo opened this issue Jan 21, 2024 · 1 comment · Fixed by #4656

Comments

@TheRealWormbo
Copy link
Collaborator

Mod Loader

Forge

Minecraft Version

1.20.1

Botania version

443

Modloader version

(dev snapshot)

Modpack info

(none)

The latest.log file

(n/a)

Issue description

On Forge only the Charm of the Diva fails to "brainwash" mobs. The method itself succeeds, causing the mob to heal and particles to be displayed, but the mob will continue to attack the player.

This works fine on Fabric when hitting hostile mobs that implement the Enemy interface. However, when hitting mobs that don't implement that interface, yet can still attack (e.g. polar bear, llama), they never seem to get "brainwashed" into attacking nearby hostile mobs.

Steps to reproduce

  1. Equip the Charm of the Diva.
  2. Find or spawn two hostile mobs, e.g. husks.
  3. Hit one of them until you hear the charm's sound effect and see particles. On Fabric the mob starts attacking another hostile mob, on Forge it continues attacking the player.

Other information

Bug report #4064 covers mobs that use the new "brain"-based AI system. That currently only affects piglins, hoglins, zoglins and the warden.

The main difference between Forge and Fabric seems to be that for Fabric a mix-in is used that calls the Charm of the Diva's code after the damage is done, while the Forge hook uses a built-in event that happens before the damage is applied. I assume the "brainwashing" is simply overridden by the mob because it considers the player-dealt damage after having a new target set, therefore reverting to attacking the player.

@TheRealWormbo
Copy link
Collaborator Author

Also, considering #4478, the Forge solution probably shouldn't be to just switch to the Fabric mixin implementation.

TheRealWormbo added a commit to TheRealWormbo/Botania that referenced this issue May 26, 2024
…ral mobs

Fixes VazkiiMods#4561 by temporarily storing mob IDs on the charm and applying the brainwashing during the next worn tick.
Fabric damage hook for the charm was also moved to LivingEntity::actuallyHurt for better parity with Forge.
TheRealWormbo added a commit that referenced this issue May 26, 2024
…ral mobs

Fixes #4561 by temporarily storing mob IDs on the charm and applying the brainwashing during the next worn tick.
Fabric damage hook for the charm was also moved to LivingEntity::actuallyHurt for better parity with Forge.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant