mcmonkeyprojects / Sentinel

Combat NPCs for Spigot!
MIT License
168 stars 84 forks source link

[bug]NPC with knockback sword can knockback knockback resistance 100% mobs #375

Closed hkkongou closed 2 years ago

hkkongou commented 2 years ago

The output of command /version on my server is: (PLEASE FILL IN) [11:40:41 INFO]: This server is running Paper version git-Paper-152 (MC: 1.18.1) (Implementing API version 1.18.1-R0.1-SNAPSHOT) (Git: 78999b5) You are 15 version(s) behind Download the new version at: https://papermc.io/downloads Previous version: git-Purpur-1506 (MC: 1.18.1)

The output of command /version citizens on my server is: (PLEASE FILL IN) [11:40:31 INFO]: Citizens version 2.0.29-SNAPSHOT (build 2448) [11:40:31 INFO]: Website: http://www.citizensnpcs.co [11:40:31 INFO]: Author: fullwall

The output of command /version sentinel on my server is: (PLEASE FILL IN) [11:46:42 INFO]: Sentinel version 2.4.0-SNAPSHOT (build 453) [11:46:42 INFO]: Author: mcmonkey

A pastebin.com link to my (full!) Sentinel/config.yml file is: (PLEASE FILL IN) https://paste.denizenscript.com/View/92499

Log file https://paste.denizenscript.com/View/92434

config.yml citizen https://paste.denizenscript.com/View/92433

saves.yml citizen https://paste.denizenscript.com/View/92432

Description NPC can knockback mobs with 100% knockback resistance. i am using mythicmobs to make mobs, i made a mob with 100% knockback resistance as mob setting, which can prevent player knockback using any kind of knockback method(such as enchant), the mob can resist any player knockback, but it cannot resist NPC with a simple knockback enchantment.

i also checked by adding a normal knockback resistance boot to my mob, i also tested the boot myself, wearing the boot can resist all knockback from player and mob, but still, cannot resist NPC attack's knockback

video provided: https://youtu.be/rXGCwP3phbE

mcmonkey4eva commented 2 years ago

Finally got around to testing this - it's an attack methodology issue. If you NPC is configured to use native attacks (damage is -1 and do native attacks is enabled in config and/or on the NPC), knockback behaves exactly as it does in vanilla interactions If you use non-native NMS attacks (damage is manually set and/or do native attacks is disabled), knockback will be excessive, and that's not directly fixable. If you have workaround damage enabled, knockback was manually applied and did not properly respect that attribute. I have pushed an update so that workaround damage mode will respect knockback resistance properly in the new dev build.

Based on your config, you were likely using non-native NMS attacks with a custom damage value. After updating to the new build, you can either A: use native damage (/sentinel damage -1), or B: enable workaround damage in your config At which point either way, knockback resistance will be respected properly