kernitus / BukkitOldCombatMechanics

Spigot plugin to configure combat mechanics from 1.9 onwards
https://www.spigotmc.org/resources/19510/
Mozilla Public License 2.0
160 stars 70 forks source link

Error when attacking entity #656

Closed qaz197418i closed 1 year ago

qaz197418i commented 1 year ago

Problem Description

When I attack entities other than players, such as villagers, beetles, etc., the console will throw this error

Steps to reproduce the behavior: Just attack entities other than players

kernitus commented 1 year ago

I have just tested this again in 1.12.2 but cannot reproduce at all. I tried attacking villagers, spiders, and pigs but I do not get the error, even if I artificially give them absorption hearts. I would need to know more about your setup, also what do you mean by "beetles"?

qaz197418i commented 1 year ago

I have just tested this again in 1.12.2 but cannot reproduce at all. I tried attacking villagers, spiders, and pigs but I do not get the error, even if I artificially give them absorption hearts. I would need to know more about your setup, also what do you mean by "beetles"?

My mistake, my server is running Bedwards1058, and this error seems to occur when I attack other entities, such as other players' Iron Golem, Silverfish, and store NPCs (Villager) When I replace the plugin back to 1.11.0, this error will not occur Due to my use of translation software, there may have been some errors. 'beetles' actually means silverfish, sorry

Edit: I found a way to reproduce the problem by installing OldCombatMechanics and Citizens on the server, and then using the command '/npc create test --type Villager' to create a new NPC. Attacking this NPC will result in an error on the console. And not only Villager, the other types of entities also experience errors

skbeh commented 1 year ago

@kernitus Last time I built the plugin and tested it on 1.12.2, it indeed thrown some exceptions with getAbsorptionAmount. With the method backported on the server, these exceptions disappeared.

I think that there is something wrong with your reflection code.

kernitus commented 1 year ago

@skbeh It works fine on vanilla, I think the problem lies when there are custom entities / other plugins interfering.

kernitus commented 1 year ago

@qaz197418i I am still unable to reproduce this at all. I tried with Citizens2 on Paper 1.12.2 and created and NPC and made them vulnerable, but the attack works fine and there is no error in the console. The debug log shows the correct amount of absorption for the entity (i.e. 0). Do you have any other special configuration, either with the server, the plugins of the NPCs?

SissioMisio commented 1 year ago

I can reproduce it with Bedwars1058 installed. When I attack a mob it spits out the errors in the console.

qaz197418i commented 1 year ago

@qaz197418i I am still unable to reproduce this at all. I tried with Citizens2 on Paper 1.12.2 and created and NPC and made them vulnerable, but the attack works fine and there is no error in the console. The debug log shows the correct amount of absorption for the entity (i.e. 0). Do you have any other special configuration, either with the server, the plugins of the NPCs?

No, this error occurred when I attacked any entity in the Bedwars1058 game. As far as I know, its shop NPC was created by Citizens. I am not sure about the other entities, but there will still be similar errors

kernitus commented 1 year ago

That bedwards plugin is absolutely cursed, I can't even manage to setup an arena and have it run without getting insane world synchronisation errors in the console. And that's before putting OCM into the mix!

Which entities are you hitting that are causing the error? Are they the villager or player NPCs? Are those entities vulnerable? Do they flash as if damaged, or does nothing happen?

qaz197418i commented 1 year ago

That bedwards plugin is absolutely cursed, I can't even manage to setup an arena and have it run without getting insane world synchronisation errors in the console. And that's before putting OCM into the mix!

Which entities are you hitting that are causing the error? Are they the villager or player NPCs? Are those entities vulnerable? Do they flash as if damaged, or does nothing happen?

There are Citizens NPCs of the village type that will not be attacked There are also SilverFish and IronGolem in Bedwars1058, which will only be attacked by enemies

I think maybe some free bedwars1058 setup can help you reproduce the problem

kernitus commented 1 year ago

@qaz197418i @SissioMisio @skbeh I believe I have identified what the problem was. Could you please try test version 148 and let me know if you still receive an error? If you do, please post the new error, as I have also made it more informative to help with debugging.