Closed magicus closed 3 years ago
This is because cooldown. Install OldCombatMechanics for a (temp?) fix.
I'm not sure what you mean by that? Killing a sheep is a one-hit business with an unenchanted diamond sword in my book. I just verified that this works as expected in PE 1.9 on a local world, and with the PC client against the same server.
But with PE client using PSPE it takes, as I said, 5-6 hits. Seems like we scale the efficiency of the weapon wrong.
Yes. There's also probably a bug with another piece of code than just cooldown but installing OCM works so...
I confirm that OCM mitigates the issue. However, it's not related to cooldown. I have OCM with all modules set enable
to false (including disable-attack-cooldown), except old-tool-damage, which is enabled, with the default set of damage values.
So while this is a functioning workaround, it's still an annoyance, and it should not be needed.
So, I've been researching this a bit. It turns out that the damage dealt by PE is almost, but not quite, 5 times too low. More precisely, it is about 4.96820355142 (!) times too low. I've imitated the behavior of OCM in PSPS, but replaced the old-style logic with just a multiplication of the above factor. This got me pretty close for most tested weapons:
diamond sword: 7.000000000189475 (should be 7) iron sword: 6.000000000162408 (should be 6) stone sword: 5.00000000013534 (should be 5) gold sword: 4.000000000108272 (should be 4)
The last few digits is just rounding errors.
However, bare hand attacking was off by 3% using this formula: 1.0333863600165767 (should be 1)
It's close enough to work for now. I'm planning to push this hack to PSPS, as a work-around.
However, this is solving stuff in the wrong place. Overall, the whole behavior baffles me. Is the minecraft server trusting the client in determining weapons damage? Do PE encode damage differently? Is bare hand really 3% more efficient on PE? And where/how to the server get this idea of yielding only 1/5 damage?!
The server calculates the damage based on item and time since last attack/hand swing. The reason why this happens is most likely because pe sends hand swing before entity interact (Same with pc <= 1.9 versions). If this is ineed the case, all you need is just to add packet reoreded to inbound packet processing.
@Shevchik Interesting hypothesis. Definitely worth investigating.
Due to Bedrock using UDP, I can easily guess this is very likely a packet order issue.
@CtrlAltCuteness no its because mc java there combat is diffrent since mc java 1.9 using a plugin to revert that fixes that issue
Notting todo with UDP or packet order
Understood. That floating point error may also be due to C++ perhaps?
@CtrlAltCuteness This is because cooldown. Install OldCombatMechanics for a (temp?) fix.
and its not because c++ because why is nukkit fine then
@WesleyVanNeck Nukkit was made specifically for serving Bedrock clients. Some of the difficulty comes from the Java rules being the main factor.
@CtrlAltCuteness I know that ..... not only that mc java 1.9 the combat update introduced a cooldown that you got disable because the cooldown counts also for bedrock it got nothing to do with code language or other things you said
Something is seriously wrong with the fighting mechanics. I have a diamond sword with Sharpness V, and it takes me 5 to 6 hits to kill a sheep or a pig! It would be funny if it was not making the game almost unplayable. :-(
This is with PE 1.9 on the latest PSPE.
Edit: WORKAROUND: Install OldCombatMechanics, and set the
old-tool-damage
module to enabled. (You can leave the rest disabled, unless you want them for other reasons.)