pub fn deduplicate_entities(
    commands: Commands<'_, '_>,
    query: Query<'_, '_, (Entity, &MinecraftEntityId, &WorldName), (Changed<MinecraftEntityId>, Without<Local>)>,
    loaded_by_query: Query<'_, '_, &mut LoadedBy>,
    instance_container: Res<'_, InstanceContainer>
)
Expand description

Remove new entities that have the same id as an existing entity, and increase the reference counts.

This is the reason why spawning entities into the ECS when you get a spawn entity packet is okay. This system will make sure the new entity gets combined into the old one.