Entity
directly 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 ItemStack
there is a thing named EntityMeta
that allows you to change what the client sees. This article will talk in detail about the implementations of EntityMeta
.Entity
is 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.LivingEntity
extends Entity
and 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.EntityCreature
extends LivingEntity
and also provides you with the navigation and AI API.Player
that extends LivingEntity
and handles equipment and a bunch of other things; EntityProjectile
that extends Entity
and 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#setInstance(Instance, Position)
.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#remove()
.Entity#switchEntityType(EntityType)
and will nullify all the metadata the entity previously had.EntityMeta
at 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 false
before your first metadata update and then with true
right 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.