I use event,setCanceled(true) in various events, because i need to know if vanilla change something, actually i cancel:
Regeneration Event
Damage event
Hurt event
Attack event
Some of the Gui event
I dont know it that affect somehow, other events, i fix when i found error.
I have some packets, to sync all player capability and try to do same for all living entity, but it is hard, for that way i have another problem, when player leave and join again, something go wrong and max life dont render correctly, now i will work to fix that, and i dont know how to do for living entity dont leave and join again with the level, so they dont get all capability again, that change their rank capability, life, level and armor.
Sorry, first time that i request help, so i dont know that, sure, i have always upload github project.
Code start in line 837
https://github.com/JuanHernandezMorani/Perfect-Minecraft-rpg-1.19.2/blob/main/src/main/java/net/cheto97/rpgcraftmod/event/ModEvents.java