Entitydirectly or from their subclasses. The Entity class mainly provides developers with a serverside API that doesn't have much of an effect on the client. Similarly to
ItemStackthere is a thing named
EntityMetathat allows you to change what the client sees. This article will talk in detail about the implementations of
Entityis the most barebones version of an entity. It provides you with a minimal API (and minimal overhead), including spawning packet handling, metadata support, default physics.
Entityand also allows you to grant your entity liveliness. The type of entity doesn't matter, minestom doesn't restrict you to what Mojang intends. If you give it health, it will have health. This subclass also provides an API to modify the entity's equipment and attributes.
LivingEntityand also provides you with the navigation and AI API.
LivingEntityand handles equipment and a bunch of other things;
Entityand has its own physics and collision code.
Entity#getEntityMeta(). Casting this to the proper type, depending on the entity type you specified on instantiation, allows you to change the way your entity will be displayed on clients.
Entity#setAutoViewable(boolean)that will automatically track whether this entity is in the viewable range of the players of the instance it's in and send spawn/destruction packets to them. All entities are auto-viewable by default.
Entity#switchEntityType(EntityType)and will nullify all the metadata the entity previously had.
EntityMetaat once. There is an issue here because every time you modify the meta, a packet is being sent to all its viewers. To reduce network bandwidth and send all updates at once there is a
EntityMeta#setNotifyAboutChanges(boolean)method. Call it with
falsebefore your first metadata update and then with
trueright after the last one: all performed changes will be sent at once. If you need more on this subject, look into the associated method documentation: it's rich.