Quite an interesting plugin you have made here. I've seen parented entities disappear and it's nice to see that there is a solution. Are you intending to add functionality to fix child entities attached to moving vehicles?
Is it feasible to attach a component to the vehicles themselves, so if the vehicle moves far enough, it refreshes the positions of any child entities? Was thinking that it might use less resources than subscribing to frequently called hooks. I played with the idea a bit but I'm new to all this client/server networking stuff.
Component for vehicles to fix child entities when they move.
I am considering adding functionality to address moving entities disappearing. The approach I had in mind is similar to what you described: Attaching a behavior to the entities, and doing distance checks (distance may depend on entity type). When an entity exceeds a certain distance, the plugin will send a simple message to terminate the entity on clients and then send a new network snapshot to clients. This approach is fairly straight forward and works, but I haven't prioritized it yet, since I have many other projects I'm interested in, and people haven't asked for this feature until recently (boom boxes on vehicles).
As for potential performance gains, terminating and resending entities after they have moved won't actually solve the original problem of clients caching the incorrect rendering origin, so the current implementation of the plugin is still necessary. However, a possibly acceptable workaround that does not use the current implementation would be to periodically terminate the parented entities even when they haven't moved. When resending the entities, if they are sent as two snapshots (one unparented and one parented), then clients who observe this effect will see the entity.
Depending on the frequency of these updates, you will be trading off between primarily performance and visibility. For example, with infrequent updates, when a new client subscribes to an entity, they may not see it for some time until the next periodic update. There are some potential optimizations that can be done around this, such as tracking these entities in a short list per network group, and detecting when a player subscribes to said network group, in order to perform an early update or perhaps client-specific update. There are also a side effect that can happen with certain entities, where the terminating and recreating the entity on the client causes the client to randomly generate a new texture (dirt in different places), and this effect is noticeable.
Feel free to contribute this functionality to this plugin via a pull request on the GitHub repo if you have the time. If you are planning on doing this, I can provide pointers on how I would go about it.