PlayerEx

PlayerEx

5M Downloads

Strange damage effect bug

githubbingitup opened this issue ยท 5 comments

commented

I might have found a bug in the latest version. I initially had mods when finding the bug, but I removed them all other than Fabric API and PlayerEx and still had the issue so I don't think its a conflict.

I was just testing a bunch of random things and at one point when I removed stats, my character started flinching as if they were taking damage. I had probably 2k skill points.

In another instance, I joined a world. Left. Rejoined and had the same effect. I had my luck at +6 at that point and probably like 2k skill points again. Upon resetting my skill points to 0, the effect went away. I tried adding them back in and rejoining to see if the bug would come back, but it didn't.

The log seems to just keep spamming potion resist every time my character flinches.
latest.log

also, I don't think this is serious enough to create another bug but I saw my inventory buttons from InventoryProfiles showing through the PlayerEx screen. I feel like that's probably due to how they made the buttons and not specifically an issue with PlayerEx? But not sure.

commented

Deprecated

commented

Ah okay, I understand now. The log is showing errors caused by the removal of mods that were present at world creation. In modded minecraft, you can't just create a world with mods, remove the mods, open the world and then expect it to work. 9/10 times it won't.

So when you created a world with a bunch of mods, they imparted a whole bunch of data to the world, and to the player. That data persists regardless of if the mods are installed or not, because it's saved to the world and to the player with nbt and whatever else mc uses for disk read/writes. When you then delete those mods, open the world with just PlayerEx, that data is still there, and when the game reads that data, it causes errors because it can't match that data to anything in code (because the mods that use that data are no longer present). This does two things:

  • It corrupts the worldsave file(s)
  • It corrupts the playerdata file

The latter of which is required for PlayerEx to work, as it heavily uses playerdata. The log spam/problem is caused by the corruption of the save/playerdata; the corruption messes up datapack loading in minecraft. When a datapack can't be loaded, it has a knock-on effect on all other data loaded from jsons - as you can probably tell, this is why PlayerEx is causing logspam/problems. It's because PlayerEx needs that sweet sweet datapack json data to work, and it can't get it because of the corruption. Remove PlayerEx and even though there's corruption, there's nothing trying to access the datapacks anymore, so no issues.

All that being said, the original cause must have been a mod incompatibility then, correct? Since the problem first occurred when a bunch of other mods were installed, and you only removed the mods to try and narrow it down and find the incompatibility. Reloading the same world whilst gradually reducing the number of mods installed is a recipe for trouble. A more surefire way of finding the incompatibility would be to create a new world every time you change your mod configuration.

I hope that made some sense, sometimes I'm bad at explaining things.
Thanks.

commented

Hi there,
Okay so for InventoryProfiles, I know exactly what's causing it to add buttons to the PlayerEx screen - the issue is here. The PlayerEx screen is not completely clientside, it's an extension of the player's inventory, and therefor is an instance of ContainerScreen. InventoryProfiles adds sorting buttons to anything that's a ContainerScreen, but fails to check if said container actually has an inventory. Unfortunately, I can't do much about this other than (yet again) rework PlayerEx to not have a serverside container component, which is silly since it shouldn't be assumed that every container instance will have an inventory holding stacks to sort.

As for the other issue, I can't reproduce it with just PlayerEx installed. Looking at the log, there are a lot of other mods installed - the spam is also not from PlayerEx, no where does PlayerEx implement potion resist, nor does PlayerEx take advantage of console logs/outputs (maybe to my disadvantage in retrospect).

I have some suspicions, however: it could be that you loaded a world with just PlayerEx that was created previously with other mods installed? Or, something corrupted the playerdata file and that's causing the issue? Or, somewhere a json got corrupted, and that's causing an issue.

Finally, it could be (small chance though) that some weird interaction with attribute value limits occurred. This is something I'll look into more - my thoughts on this is basically that the function clamping the attribute's value to a min/max range broke somehow, which would cause all kind of groovy bugs.

No idea tbh,
thanks anyway!

commented

I figured as much that it'd be more on InventoryProfiles and its way of adding the button. Not too big a deal.

There weren't any other mods installed in the log I sent you, unless it was the wrong one. Just PlayerEx and FabricAPI.
If you are seeing other mods in the log, its because they were there at world creation. I began removing them to try and find the cause of conflict, but the only mod I ended up with was PlayerEx and it was still happening.

Upon removing PlayerEx, the spam completely goes away and the problem stops. Removing the other mods in the pack doesn't fix it. Only removing PlayerEx fixes it.

If its a mod conflict, its strange to me that the problem wouldn't stop from removal of the other mods and only from removing PlayerEx. I don't think I've ever seen a mod conflict that persisted after removal of one of the conflicting mods, but I'm sure its possible if some form of data is tampered with. The problem is also quite random in when it happens.

I can send you the world and its player data if you want to look at it, but I'll try to troubleshoot more later.

commented

I think its being caused by Eldritch mobs. Its likely linked to a mob because when I kill one, the effect seems to stop. Eldritch mods adds special effects to mobs at random and I noticed as soon as one of those appeared in front of me it started doing it. They also have the potion effect floating around them to mark that they're special. That might have something to do with it. I can't get the bug to happen without PlayerEx.

will post again when I know for sure as I want to test a bit more without Eldritch mobs to make sure removing it fixed it, but just taking a break for now.