-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Allow setting if the critical hit should disable sweep attack in CriticalHitEvent, adding SweepAttackEvent #1496
Conversation
|
src/main/java/net/neoforged/neoforge/event/entity/player/CriticalHitEvent.java
Outdated
Show resolved
Hide resolved
I asked in the other PR, what is the behavior when that property is set on axes or other weapons with no sweep, I assume just ignored? Or am I able to force sweeps onto any weapon? Personally I think it should just be ignored but wanted to double check so I know I dont have to deal with my weapons suddenly gaining sweep attacks. |
Per Shadow’s request, it allows bypassing item ability check. Do you think I should have |
🚀 This PR has been released as NeoForge version |
Rework of PR #1314
Closes Issue #1313
This PR does the following:
disableSweep
inCriticalHitEvent
to track if sweep attack should be disabled. Legacy methods that enables critical hit will disable sweep attack.CriticalHitEvent
to enable critical hit without disabling sweep attack.SweepAttackEvent
to determine if player should sweep attack, considering both vanilla conditions andCriticalHitEvent.disableSweep()
The vanilla logic for critical hit and sweep attack is:
This PR propose the following logic:
flag1
would represent all 9 vanilla critical hit conditionsallowSweep
would represent first 4 vanilla sweep conditions (excluding critical hit check)CriticalHitEvent
determines if the attack would disable sweepSweepAttackEvent
determines if the attack would be a sweep attack, consideringallowSweep
andCriticalHit.disableSweep