Easy NPC

Easy NPC

2M Downloads

[Bug] Kick players if there is a customised villager with Velocity [FORGE] 1.20.1

superhealing opened this issue · 18 comments

commented

Minecraft and Mod version 🐞
1.20.1, forge 47.3.22,
easynpc 2.9.0
modpack : Legendary Edition 2.2

Describe the bug 🐞
It appears that whatever i explore (especially a structure that contains easy_npc) for example villager (obviously designed by modpack dev), as soon easy npc spawns i get kick with message Internal Exception: io.netty.handler.codec.DecoderException: Unknown serializer type 85
However it happens on Yoga import on villager
To Reproduce ⚙️
Steps to reproduce the behavior:

Get two servers, one for velocity and one for server (the modpack or probably you need some few mods with easynpc addition)
Configure in a way that you can connect thru proxy -> server
Once you do that and you can connect, then spawn an villager npc, use npc wand import yoga default settings, then you get kick with message : Internal Exception: io.netty.handler.codec.DecoderException: Unknown serializer type 85 (or contact me and i will give you a test server to not go all that hassle)
Expected behavior ✔️
It should not kick after spawning/importing yoga preset
Screenshots 📸
If applicable, add screenshots to help explain your problem.
https://i.imgur.com/gJKxEz1.png
Debugging 🛠️
https://pastebin.com/RGpaQgvP
Enabled but i have feeling is not related.
Server report no issues, proxy server report no issues, however client reports this :
(after setting connectivity to report more log)
https://hasteb.in/CaSKeZDKbihfgfw
Is the issue happening in combination with other mods? (If yes, please provide a full list) 🧩
I have feeling is not related since after disabling easynpc i could spawn any mobs/exploration (obviously these structures have no easynpc in) therefore not related to other mods (i could be wrong, however we are using Legendary Edition)
Additional context 📝
If you need more context or easy messaging, you can contact me at discord alpderps (thats my nickname) or email (if you need it)

commented

The Legendary Edition modpack new version revolves around the Easy NPC mod, which basically carries the entire questline and custom content of the modpack.
As the modpack popularity is increasing drastically these last weeks, we want to provide to the players a high quality content with custom voice acting, multiple choices dialog system and connectivity with the rest of our content (skills to unlock new dialogs, etc...)
Right now, the pack is the seventh most relevant modpack to download on curseforge, behind giants like RLCraft or Better MC, which makes it one of the most anticipated modpacks on the platform.
https://github.com/user-attachments/assets/a09b70fb-8ac8-464d-b6e5-f55541a7ad9c

This issue has drove the devs working on the project mad for the past days, and it's taking so long to troubleshoot, the content added to the game with Easy NPC is just enormous. We are talking about the possibility of removing this mod from our content, but it is basically removing a pillar of the adventure.

I think it would profit both the modpack AND the mod to work together and try to find a way to fix this issue, as we are not the only ones having this problem apparently : #404

I made a small compil of some of the uses we make with your mod, and the potential we could get from it for the adventure : https://streamable.com/9gtdqb

If you are willing to, we can grant you access to the private dev discussion around this subject on our discord server, where you can get all the details about this very peculiar and important issue. Maybe as a watcher, you'll have a better understanding of what your mod is doing and why it is having so much trouble being compatible with other mods on servers.

Here is the discord link : https://discord.gg/vFx9bu76
You can contact me (Krampus) or Armkath, as we are both initial mod authors, so we can give you a dev tag and add you to the discussion.

Thank you for your work, hope we find a way together to fix this issue and keep Easy NPC as one of our most interesting contents.

commented

Thanks for the report!

This issue is most likely related to another mod not registering client-side network packets correctly.

You can verify this by checking the server and client logs for any ID mismatches. A good reference is this comment:
🔗 GitHub Issue #370 - Comment

In some cases, updating the mods on both the server and client can resolve the issue.

For Easy NPC, the mod logs the registration of entity data serializers on both the server and client.
Reviewing the full logs can help determine if the issue originates from the Easy NPC mod or elsewhere.

commented

Alright, i'm going to upload full debug.log and latest.log logs. As you can see by removing easy_npc from server it allowed me to connect. Therefore is more likely to be the npc themselves that a mod might touch or even this one but i'm not 100% sure.
Tried to remove supplementaries and moon_light as well (including all addons/mods that require the mods that deleted), and unfortunately didn't work.
By just removing easynpc it would 100% resolve the issue or by removing the entity themselves would resolve the issue.
Least extreme case might be someone trying to modify the name of mob, maybe autoleveling, (edit, i just spawned easy npc pig and autoleveling tagged the mob lvl 3, https://i.imgur.com/suNIozW.png likely to be an incompatibility with villager themselves?)
I'm just out of idea.
Server logs :
debug.log : https://mclo.gs/CoZeXes
latest.log : https://mclo.gs/JzKmjf9
Client logs :
debug.log : https://mclo.gs/vQPDbSM
latest.log : https://mclo.gs/foszIlp

I would note that is not my first time to create servers with proxy/velocity, i added all necessary configurations and mods that make it working for proxy environment.

[EDIT_2]
More information, looks like as soon you have some text in dialogdata (my initial suspect) is the problem. https://i.imgur.com/JlCQ34o.png

[EDIT_3]
False alarm, dialog is not the problem is the textures the problem if you apply a skin/model = kick with unknown serializer type 85
This seems best fix, basically stripping all models/skins of all easy_npc, i hope that narrowed down for y'all on developing side.

commented

Thanks for sharing the full logs!

After reviewing them, it looks like the issue stems from a mismatch between the client and server network packet registrations.

What I Found:

  • The server and client logs show that entity data serializers are registered with different IDs.
  • Server:
    Registered entity data serializer ActionEventSet with id 28
    Registered entity data serializer CustomAttributes with id 29
    ...
    Registered entity data serializer UUID with id 46
    
  • Client:
    Registered entity data serializer ActionEventSet with id 29
    Registered entity data serializer CustomAttributes with id 30
    ...
    Registered entity data serializer UUID with id 47
    

As you can see, the IDs are off by one. This mismatch can lead to the Unknown serializer type error you're experiencing.

Why This Happens:

The discrepancy typically occurs when a mod registers a client-side network package but fails to register the same package on the server. As a result, the IDs become misaligned, causing connection issues when certain entities (like NPCs) spawn.

Important Notes:

  • The logs show that Easy NPC’s network packages are registered between IDs 29 and 47.
  • The error screenshot you previously shared referenced serializer type 69, which is outside Easy NPC’s registered range. This suggests the issue isn’t directly caused by Easy NPC.
  • Additionally, logs from the Connectivity mod reference ID 83, which also falls outside Easy NPC’s scope.

Next Steps to Resolve the Issue:

  1. Identify the Conflicting Mod:

    • Since Easy NPC alone doesn’t seem to cause the issue, it’s likely another mod in the modpack is responsible.
    • Try isolating the mod by temporarily removing mods one by one (or in small groups) to see which mod causes the mismatch.
  2. Update Mods:

    • Ensure both the server and client mods are on the same version to prevent desynchronization.

Conclusion:

Unfortunately, since the issue isn’t originating from Easy NPC directly, I won’t be able to troubleshoot the entire modpack. However, I recommend isolating the problematic mod by narrowing down the conflicting packet (likely associated with serializer ID 69).

commented

Thank you for incredible response and being helpful in this matter.
After painstaking 5 days spend to diagnose and narrow down the couple mods that may or may not cause issue. I have strongly to believe that this issue is far more related to codebase have slightly problems with syncing and among other things, the error 69 i got is because of importing a model, lets skip a bit. You believed that there is another mod that cause this problem, therefore i took your comment and applied to current case. I did some research and in past seems has a few more github issues in this repo that has some tangency with linux server. (as issue)
To be absolutely clear and factual.
IF you play same mods, and same configs and other things ON windows as server you have absolutely NO issue to play or continue to experience modified skins with different configurations that modpack developer made. However the issue PRESIST if you have A linux server WITH SAME server file that was on windows. Only difference would be CPU and software, although software is very much not likely to affect due nature of JVM engine since they are cross-play and thus less likely to cause problem, and even more less likely in specifically context relating networking since linux is a king one, the issue doesn't not involve graphics issue therefore linux is not compatible with easynpc WITH extra mods, i tested with absolutely easynpc and forge and nothing else and just works, this baffled me. Windows server works, but linux no? Clean forge server with just one mod, easy npc and works on linux and windows? (By i mean works i can edit villager NPC and start to import default skin texture the blue one).
So i thought is extreme possible that modpack has some incompatibilities between mods therefore i took action for past 5 days to do a binary search, I managed to reduce it to 181 mods out of 205.
My binary search consisted having same mods and same config on server and client (client is windows machine and server is a linux machine), disable mods (and same time to delete world since you remove mods that contain content) spawn villager npc and edited to import skin, repeat in small groups until you don't get error 85, i got success narrowed down some incompatibilities, however, i started slowly to enable in groups of 3 mods to reach 205 faster since i though i narrowed down, but fate strike back, every time i try to enable back even one mod above 181, for example logprotect mod or JeiTweaker or ftblibrary (is a library for god sake) or cleanview mod (that is just a mod that remove particles... and codebase has less than 100 odd lines absolutely zero tangency with easynpc) still getting Unknown serializer type 85, i tried to replicate it just easynpc and ftblibrary, it doesn't not happen, so only if you have more than 181 mods therefore i lost my time and energy to diagnose further. Please helps us with your knowledge in your codebase or you can have a linux server or probably you can replicate that with a ubuntu wsl or anything like that, is a 50% chance that will work or not)
I need to remind this issue appears only randomly, for some it doesn't, for some it does. Please advise on this matter, to facilitate better contact and best of help to resolve this issue i would like to go some faster method of communication that is less frustrated than this and perhaps fix the core issue that many many other people have may or may have this issue indirectly/directly.
This video below only happens on linux, if you do in windows (as forge server) and client has no issue replicating that in video. https://github.com/user-attachments/assets/422e8326-3121-4c64-b749-526d373651e1
Also this only appears as lottery ticket, for some works for some doesn't work, i have no idea and how to narrow it down.

Thanks for read and i'm sorry for my language and for any disrespect that i may accidentally conveyed, i just having frustrating experience.

commented

Thank you for sharing the full logs and for the incredible effort you’ve put into troubleshooting this issue.

I can completely understand the frustration, and I appreciate the detailed breakdown of your testing process.
Based on what you've described, it does seem like the issue is related to how mods interact on Linux, possibly tied to network packet registration or synchronization with larger modpacks.

Observations:

  • I regularly test all my mods using a dedicated server running in a Docker container on Linux, and I haven’t encountered this issue or noticed any significant differences between Linux and Windows environments. This makes the issue even more puzzling, as the core setup should behave similarly across platforms.

  • The discrepancy in serializer IDs between the client and server strongly indicates a network packet mismatch. However, the fact that the issue only appears when surpassing 181 mods points to a potential registry size limit, race condition, or mod interaction rather than an Easy NPC-specific problem.

Next Steps / Testing Offer:

If you're willing to perform some additional testing, I can offer the following:

  1. Custom Mod Version (No Network Messages):

    • I can provide a lightweight version of the mod that removes all custom network messages. This version will only allow configuring NPCs via command-line commands (no GUI interaction).
    • This will help determine whether the issue is specifically tied to network message handling. If the light version still triggers the issue, we can rule out network messages as the root cause.
  2. Focus on Environment Differences:

    • If the light version works without issues, we can narrow down the problem to the custom GUI network packets and look for potential incompatibilities with how Linux handles certain mod interactions.

Additional Recommendations:

  • JVM Testing:

    • If you haven't already, consider testing with a different JVM (e.g., Adoptium, Oracle) to see if JVM-specific differences contribute to the issue.
  • Registry/Mod Count Check:

    • Since the issue occurs with 181+ mods, try testing with a slightly smaller modpack to see if the problem scales with the number of mods. This could help determine if it's related to registry overflow or mod limits.

I hope this helps move things forward.

Let me know if you'd like the lightweight version of the mod for testing, and I’d be happy to prepare it for you.

Thank you again for your dedication and patience – I really appreciate it!

commented

Thank you for providing the additional details and sharing your testing setup.
Unfortunately, I cannot join your Discord server as it requires phone number verification, which I avoid for privacy reasons.

Clarification

The issue is not caused by the Easy NPC mod itself. As demonstrated by former logs and analysis, the root cause lies in other mods interfering with Easy NPC entities when they shouldn’t.
These mods inject or modify entity data in ways that cause conflicts.

For example, consider the following log entry:

java.lang.IllegalStateException: Invalid entity data item type for field 26 on entity Villager['Default (None)'/1067, l='ClientLevel', x=63.50, y=64.00, z=-213.50]: old=de.markusbordihn.easynpc.data.sound.SoundDataSet@351a2849(class de.markusbordihn.easynpc.data.sound.SoundDataSet), new=SkinDataEntry{name=, type=DEFAULT, url=, uuid=00000000-0000-0000-0000-000000000000, content=, timestamp=1737033047874}(class de.markusbordihn.easynpc.data.skin.SkinDataEntry)
	at net.minecraft.network.syncher.SynchedEntityData.m_135375_(SynchedEntityData.java:205) ~[client-1.20.1-20230612.114412-srg.jar%23634!/:?] 
at net.minecraft.network.syncher.SynchedEntityData.m_135375_(SynchedEntityData.java:205) ~[client-1.20.1-20230612.114412-srg.jar%23634!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:core.SynchedEntityDataMixin,pl:mixin:APP:alltheleaks.mixins.json:main.SynchedEntityDataMixin,pl:mixin:APP:canary.mixins.json:entity.data_tracker.use_arrays.SynchedEntityDataMixin,pl:mixin:APP:tumbleweed.mixins.json:SynchedDataAccessor,pl:mixin:APP:canary.mixins.json:entity.data_tracker.no_locks.SynchedEntityDataMixin,pl:mixin:A}

The mixins listed here show that multiple mods are interacting with SynchedEntityData, including:

  • modernfix-common.mixins.json:core.SynchedEntityDataMixin Ref
  • alltheleaks.mixins.json:main.SynchedEntityDataMixin
  • canary.mixins.json:entity.data_tracker.use_arrays.SynchedEntityDataMixin
  • tumbleweed.mixins.json:SynchedDataAccessor
  • canary.mixins.json:entity.data_tracker.no_locks.SynchedEntityDataMixin

Any one of these could introduce the conflict leading to the crash.

Next Steps

To isolate the issue further, I recommend using the Modpack Troubleshooter I created specifically for this case.

Steps to Use the Troubleshooter:

  1. Download the Modpack Troubleshooter:
    Modpack Troubleshooter on CurseForge

  2. Install It on Client and Server:

    • Add the mod to both your client and server setup.
  3. Start and Test:

    • Launch the server and connect using the client.
    • Attempt to reproduce the issue (e.g., spawning NPCs, editing their skins/models).
  4. Collect Logs:

    • Retrieve the full client and server logs from the test.
    • Ensure you save logs from both working and non-working setups for comparison.

What the Troubleshooter Provides:

  • Mod Overview: A list of all mods on the client and server, ensuring compatibility.
  • Entity Data Serializers: A detailed report on registered serializers to detect mismatches.
  • Synched Entity Data: Insights into which entity data are added to detect mismatches.

Goal:

By comparing these logs, we can identify whether:

  • There are mismatched Entity Data Serializers or Synched Entity Data between the client and server.
  • Mismatching mod files.

Note

The troubleshooting process requires collaboration and systematic testing.
With the Modpack Troubleshooter, we should be able to pinpoint the conflicting mod or issue accross all mods in the mod pack.

commented

Server debug log : https://hasteb.in/rZPzAQTdc96WaJl
Server latest log : https://hasteb.in/yHULow22FdqR0BR

Client debug log : https://hasteb.in/rUpdZJBXUU9zkFQ
Client latest log : https://hasteb.in/1nJQnF5JISNucIb

Comparasion : i noticed that mowzie mod entities ID changes between client and server, to my surprise removing that mod worked for us.
https://i.imgur.com/vHT5h0z.png

The server AND client with mowzie mod removed works just pleasantly fine with easynpc. I appreciate your modpack troubleshooter, looks like that ID's change can really mess up the networking sense. Thank you for your time and appreciation.

commented

Thanks so much for the feedback and for sharing the detailed log files!

After reviewing the logs and your findings, I noticed something interesting regarding ModernFix.
It appears that their mixin modifies the order of SynchedEntityData, as seen in their GitHub code.
According to their comments and implementation, they adjust the order of SynchedEntityData, which could explain the issues you're experiencing.

This means the problem might not be directly related to Mowzie’s Mobs directly, but instead could stem from ModernFix's "Fix".
It’s worth investigating whether ModernFix has an option to disable this specific adjustment to test compatibility with Mowzie’s Mobs and Easy NPC.

I’m glad to hear the Modpack Troubleshooter helped identify the issue and conflicting mod.
Over the next few days, I’ll be finalizing the tool with more specific tests to make it even more effective for diagnosing complex compatibility issues. I hope it continues to be a valuable resource for modpack creators like you.

Thanks again for your patience and positive feedback. 😊

commented

There is no such config unfortunately, with mowsie mod enabled and modernfix disabled on client + mod.
The result of this is failure.
I stash some logs, to my conclusion seems that mowsie mobs is the clear culprit.

Server debug log : https://hasteb.in/elhJSJcadwF3M11
Server latest log : https://hasteb.in/CUnnkc1nFCEw4wq

Client debug log : https://hasteb.in/vmwv259MwUgclZo
Client latest log : https://hasteb.in/qpTnaMYg2Kgs4om

Either way we will try to contact mowsie mod developer.

commented

Hello Markus,
I'm developper on Legendary Edition modpack.
When do you think you could release this custom mod Version without network messages ?
We're looking forward to test it with the modpack and maybe fix this issue with you mod

commented

Thank you for reaching out and sharing detailed insights into your project and the challenges you’re facing with Easy NPC in the Legendary Edition modpack.

After thoroughly reviewing the shared logs and running extensive performance tests, it’s important to clarify that the issue does not stem from the Easy NPC mod itself.
The logs and tests consistently show that the mod operates as intended under standard conditions.
This suggests that the problem arises from compatibility or configuration issues within the larger modpack ecosystem.

Regarding issue #404, it’s worth noting that it isn’t a suitable comparison for the current situation.
That report involves mods like Sinytra Connector, which explicitly states in its documentation:

"Connector is currently in beta state, and many mods may not work as expected, or might be broken completely."

This adds further unpredictability and should not be used as a baseline to evaluate Easy NPC’s functionality.

I want to emphasize that whenever there is a clear, reproducible issue, I prioritize resolving it, whether it’s for an individual user, a small group, or a large modpack. Collaboration and addressing bugs are core principles I stand by.

To assist with your troubleshooting efforts, I’ve attached a custom .jar file with a modified version of Easy NPC that includes only limited network messages (4 in total).

Modified Mod: easy_npc-forge-1.20.1-5.9.0-testing.zip

Source Code: https://github.com/MarkusBordihn/BOs-Easy-NPC/tree/testing

Code Change: 9a8501d

This version is strictly for testing purposes and not intended for production. It must be unzipped and used on both the server and client sides. The purpose of this version is to determine whether the network messages are contributing to the reported issues.

Please keep me updated on your findings.
I’m happy to work alongside with you to ensure Easy NPC remains a cornerstone of your modpack’s adventure content.

commented

Hello Markus,
Issue still occurs.
Are you aware that this issue online appears when npcs have custom skin / models ?
This info might change the point of view you have on what's going wrong there.
Could you investigate this part specifically ?

Thanks again for your effort, we hope to quickly find a fix for this, and intensively use your mod in our modpack
Best

commented

Thank you for the feedback, it confirms that the issue is not directly related to the network messages in the Easy NPC mod itself.

To better understand the problem, could you clarify whether the issue arises specifically from using custom skins, custom models, or a combination of both? These are two distinct scenarios involving different mechanics:

  1. Custom Skins
    Custom skins are merely text references and should not cause any significant issues. They are lightweight and primarily client-side.

  2. Custom Models
    Custom models, on the other hand, involve third-party entities. These entities are rendered into the world and may introduce complexities, particularly if other mods are interacting with or modifying their behavior.

That said, this doesn’t change my assessment that another mod is contributing to this issue.
From the logs and behavior, it seems the problem is cause from another mod attempting to add or modify data in NPC entities, entities they don’t "own", which results in unexpected conflicts.

Currently, there’s little more I can troubleshoot from the code side of the Easy NPC mod.
However, I may have an idea to isolate the issue further. Let me run some tests and gather additional insights before providing more details.

Thank you for your patience and collaboration.

commented

It occurs with the "edit skin > custom" feature of EasyNPC
Thanks for your help !

commented

Hello Markus,
Any idea in the troubleshoot of this issue ?
Have you been able to check the custom skin feature already ?
Best

commented

Hi, like said before this only happens on certain hardware/devices or anything like that. It might not to your end, however i build a dockerfile for you and client for easiest testing. I used your development jar to remove GUI and issue still persisted.
This issue happens ONLY if you have a model/skin (either way get same error).
I used legendary edition modpack version 2.5, removed connector and fabric api (which you said it might cause issue) I tested without them and has same fate.
This docker file below should be used only for development purpose :
https://hastebin.skyra.pw/acakejatij.dockerfile
Client you can find here : https://downloads.valhallamc.io/public/downloads/legendary_client_for_testing_easynpc.zip
If you don't trust the client, just download from curseforge legendary edition modpack version 2.5 then remove following mods :
Connector-1.0.0-beta.46+1.20.1.jar
fabric-api-0.92.2+1.11.9+1.20.1.jar
Once you done, launch the server and client, load into server get villager npc, edit to use default skin/model. It should give you kick, there is a video for easier understanding :

https://github.com/user-attachments/assets/9a50fafe-6673-42e0-8e92-351ac036eb2d
error in reduced form :
https://hasteb.in/7wi5RdckxPuazqE
IF you don't get the issue, congratulations you are part of greater luck island. I can provide you server for all testing to see why for you IF you don't get the issue. Therefore you can DM me or join discord server and dm anyone in modpack author and i will get setup for you.

commented

Hello ! Here is a datapack with all the NPC ingame WITHOUT any custom skin/model/texture
Here is how they all will look like :

Image

And here is the datapack that you can use to override the modpack datapack :

Minecraft_Legendary_Datapack_No_Custom_NPC.zip

This might help understand why the npcs have troubles with custom skin/textures