How to use
==========
A datapack for linking entities. Each entity can conccurently have up to two links, each divided into it's channel. 

A channel can be thought like a frequency spectrum where an link is a frequency in that channel and everyone in with that frequency is linked. So to have concurent links, we add more channels.
  - Channel   -->   scoreboard = ch<X>_olink
  - Frequency -->   link = a specific scoreboard value

Also, each channel is divided into players IDs (0..300) and others (301..k) ids. Each channel is interacted by calling the cuntions olink:ch<X>/<function>.

new_link()
  - starts a new link for @s in the channel X
  - Use:
      1. run:                               function olink:ch<X>/new_link

join_link()
  - links all entities that run the function to the given link in channel X
  - Use: 
      (after new_link/find_linked/count_linked -> the .id score is automatically updated)
        1. run as entities to join link:    execute as @<*> run function function olink:ch<X>/join_link
      (after a new link has been created)
        1. save the entity link id:         scoreboard players operation .id ch<X>_olink = @<l> ch<X>_olink
        2. run as entities to join link:    execute as @<*> run function function olink:ch<X>/join_link

      A better, more efficient way and in one line equivalent:
        1. scoreboard players operation @<*> ch<X>_olink__id = @<l> ch<X>_olink

find_linked()
  - mark all the entities in the @s link with the tag ch<X>_linked
  - Use:
      1. run as entity in link:             function olink:ch<X>/find_linked
      2. run as linked entities             execute as @<*>[tag=ch<X>_elinked]

count_linked()
  - Returns the number of entities in that channel link.
  - Use:
      1. run as entities in link:           function olink:ch<X>/count_linked
      2. get how many in link:              scoreboard players get .count ch1_olink

find_count_linked()
  - combines the functionalities of find_linked and count_linked

exit_link()
  - the enetity running the command exits it's current link in the given X channel
  - Usage:
        1. run:                             function olink:ch<X>/exit_link

in_link (predicate)
  - The predicate passes if the player has alwready a link in ch<X>
  - Use:
      1. run:                               execute if predicate olink:ch<x>/in_link run <...>

Legend
======
  - @<l>: entity with/in a link
  - @<*>: entities selected
  - ch<X>_olink: X channel scoreboard
  - ch<X>_linked: tag given to linked entities when finding them

Supporting more concurent links
===============================
You simply need to add the new channel scoreboard at the load function, duplicate a channel function and predicate foders and edit the scoreboards and tags.

Other
=====
This lib is a modified version of the Cloud Wolf olink generator: https://www.youtube.com/watch?v=dNBtFw1M5oA
