A
Admincraftโ€ข2mo ago
Ashank

Patch item swapping

Axe stunning, mace swapping, sword swapping etc. how to fix?
17 Replies
Admincraft Meta
Admincraft Metaโ€ข2mo ago
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close !close !solved !answered
Requested by ashanki#0
Cubicake
Cubicakeโ€ข2mo ago
um english plz?
Ashank
AshankOPโ€ข2mo ago
Sword swapping in hypixel
Cubicake
Cubicakeโ€ข2mo ago
you want to patch an issue in hypixel???
Ashank
AshankOPโ€ข2mo ago
No. It's the same bug In pepper *paper
Cubicake
Cubicakeโ€ข2mo ago
whats the bug? In hypixel its their fancy projectile weapons taking the stat of whatever's in ur hand right
Ashank
AshankOPโ€ข2mo ago
Yes Lemme send video
Ashank
AshankOPโ€ข2mo ago
Scilan Gaming
YouTube
This bug will change PvP FOREVER
A quick stream explaining a cool bug.A bug known as:Attribute swapping1 tickingsword disablinghit swappingsword swappingthe cooldown trickbreach swappingIt g...
Cubicake
Cubicakeโ€ข2mo ago
Why does that suddenly become a kenadian vid a few mins in lol
๐๐ข๐ช๐ฎ๐š๐ญ๐ž๐ซ๐ง๐ข๐จ๐ง๐ฌ
You think this might be related? Doesnโ€™t seem like it according to the video (at least the start, I havenโ€™t watched it completely) https://github.com/PaperMC/Paper/issues/11552
GitHub
Swapping items and attacking will (for a split second) make player....
Expected behavior Code Using EntityDamageByEntityEvent: if (attackingPlayer.getAttackCooldown() == 1.0) { damagedPlayer.setFoodLevel(Math.max(damagedPlayer.getFoodLevel() - foodLevelReduction, 0));...
Ashank
AshankOPโ€ข2mo ago
The start is the only important thingy Yeah that seems like it
Cooleg
Coolegโ€ข2mo ago
yeah so basically heres the thing right something like this would to my knowledge require either extreme overhauls of how minecraft manages items or alternatively adding a 1 tick delay to item swaps in relation to attacking (or any other action related to attributes updating) the problem is theres countless ways an item can have an attribute changed and it would be essentially impossible to track it well oh or the other option is add checks anywhere that attributes apply to ensure it actually matches with the held items (but not too many places or it might lag stuff out) which would probably be a pain im kinda curious just how much this would affect perf, might test it
Ashank
AshankOPโ€ข2mo ago
hm might need to test that as well
Cooleg
Coolegโ€ข2mo ago
i didnt do the most thorough job with this so the performance impact will def be worse than it needs to be but have fun https://github.com/TrollsterCooleg/PaperTest/releases/tag/patchitemswap
Cooleg
Coolegโ€ข2mo ago
it almost definitely does more checks than it needs to an ideal ideal solution would be like 20x harder so oh well, it still overall performs fine and the perf isnt actually noticably worse anyways its a tiny difference really (@Ashank just gonna ping you in case you actually want to use it)
Ashank
AshankOPโ€ข2mo ago
Ty
Cooleg
Coolegโ€ข2mo ago
depending on if im bored enough i may in theory continue updating this if anyone asks for it in here (ping me!) but no guarentees at least until someone smarter or more patient than me does it a better way so it has a legitimate chance to be merged into paper unless im not feeling bored enough to continue maintaining it in which case if someone else is desperate to use this low quality fix they can maintain it themselves

Did you find this page helpful?