Patch item swapping

Axe stunning, mace swapping, sword swapping etc. how to fix?
17 Replies
Admincraft Meta
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
Cubicake2w ago
um english plz?
Ashank
AshankOP2w ago
Sword swapping in hypixel
Cubicake
Cubicake2w ago
you want to patch an issue in hypixel???
Ashank
AshankOP2w ago
No. It's the same bug In pepper *paper
Cubicake
Cubicake2w ago
whats the bug? In hypixel its their fancy projectile weapons taking the stat of whatever's in ur hand right
Ashank
AshankOP2w ago
Yes Lemme send video
Ashank
AshankOP2w 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
Cubicake2w ago
Why does that suddenly become a kenadian vid a few mins in lol
duolingo se acerca
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
AshankOP7d ago
The start is the only important thingy Yeah that seems like it
Cooleg
Cooleg5d 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
AshankOP5d ago
hm might need to test that as well
Cooleg
Cooleg5d 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
Cooleg5d 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
AshankOP5d ago
Ty
Cooleg
Cooleg3d 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?