Hytale server uses a pattern called Entity Component System (ECS). This is very different from standard Object-Oriented Programming (OOP). In standard OOP, you might have a Player class that extends Entity. In ECS, a "Player" isn't a single class; it's just an ID that has a bag of data attached to it.
A Ref (short for reference) is a safe, persistent handle pointing to a specific entity within a Store. While the Store uses integer IDs internally to manage data efficiently, these IDs can change as entities are moved in memory. A Ref abstracts this away and acts as a stable pointer that tracks the entity's validity and current location. It's the primary key for interaction, whenever you need to read or write specific data such as health or position, you must pass the corresponding Ref to the Store.
You will frequently see Refs typed as Ref or Ref. This generic type parameter defines the context of that reference, instead of the type of content as you may e
