Overview
Entities represent all moving objects in Minestom including players, mobs, items, and projectiles.Entity Class
Base class for all entities in the game.Entity Creation
Creates a new entity with a random UUID.Parameters:
entityType- The type of entity to create
Creates an entity with a specific UUID.Parameters:
entityType- The entity typeuuid- The entity UUID
Spawning & Despawning
Spawns the entity in an instance at the specified position.Parameters:
instance- The instance to spawn inspawnPosition- The spawn position
Changes the entity’s instance, keeping current position.Parameters:
instance- The new instance
Removes the entity temporarily (can respawn).
Removes the entity with optional permanent removal.Parameters:
permanent- true for permanent removal
Position & Movement
Teleports the entity to a position.Parameters:
position- The target position
Teleports with velocity.Parameters:
position- Target positionvelocity- New velocity vector
Gets the current entity position.Returns: The entity position (includes yaw/pitch)
Sets the entity velocity and fires EntityVelocityEvent.Parameters:
velocity- The velocity in blocks/second
Gets the entity velocity.Returns: Velocity vector in blocks/second
Changes the entity’s view direction.Parameters:
yaw- Horizontal rotationpitch- Vertical rotation
Makes the entity look at a specific position.Parameters:
point- The point to look at
Makes the entity look at another entity.Parameters:
entity- The entity to look at
Entity Properties
Gets the unique entity ID (server-wide, changes on restart).Returns: The entity ID
Gets the entity UUID.Returns: The entity UUID
Gets the entity type.Returns: The EntityType
Gets the entity’s current instance.Returns: The instance, or null if not spawned
Gets the chunk the entity is in.Returns: The current chunk, or null
Checks if the entity is on the ground.Returns: true if on ground
Checks if the entity has been removed.Returns: true if removed
Checks if the entity has been added to an instance.Returns: true if active (spawned)
Physics
Checks if physics calculations are enabled.Returns: true if physics are enabled
Enables or disables physics calculations.Parameters:
hasPhysics- true to enable physics
Checks if the entity ignores gravity.Returns: true if gravity is disabled
Sets whether the entity should ignore gravity.Parameters:
noGravity- true to disable gravity
Gets the entity’s collision bounding box.Returns: The BoundingBox
Sets the entity bounding box dimensions.Parameters:
width- Box width (X)height- Box height (Y)depth- Box depth (Z)
Passengers & Vehicles
Adds a passenger to this entity.Parameters:
entity- The entity to add as passenger
Removes a passenger.Parameters:
entity- The passenger to remove
Gets all passengers.Returns: Unmodifiable set of passengers
Gets the entity this entity is riding.Returns: The vehicle entity, or null
Metadata & Visual
Gets the entity metadata object for modification.Returns: The EntityMeta
Checks if the entity is invisible.Returns: true if invisible
Makes the entity invisible or visible.Parameters:
invisible- true to make invisible
Checks if the entity has the glowing effect.Returns: true if glowing
Enables or disables the glowing effect.Parameters:
glowing- true to make glow
Gets the current entity pose.Returns: The EntityPose (STANDING, SNEAKING, SWIMMING, etc.)
Sets the entity pose.Parameters:
pose- The new pose
LivingEntity Class
Extends Entity with health, equipment, and damage handling.Health & Damage
Gets the current health.Returns: Current health points
Sets the entity health.Parameters:
health- The new health value
Damages the entity.Parameters:
damage- The damage source and amount
Kills the entity, triggering the death event and animation.
Checks if the entity is dead.Returns: true if dead
Equipment
Gets the item in the main hand.Returns: The ItemStack
Sets the main hand item.Parameters:
itemStack- The item to set
Gets the off-hand item.Returns: The ItemStack
Sets the off-hand item.Parameters:
itemStack- The item to set
Gets the helmet.Returns: The helmet ItemStack
Sets the helmet.Parameters:
itemStack- The helmet item
Gets the chestplate.Returns: The chestplate ItemStack
Sets the chestplate.Parameters:
itemStack- The chestplate item
Gets the leggings.Returns: The leggings ItemStack
Sets the leggings.Parameters:
itemStack- The leggings item
Gets the boots.Returns: The boots ItemStack
Sets the boots.Parameters:
itemStack- The boots item
Gets equipment in a specific slot.Parameters:
slot- The equipment slot
Sets equipment in a specific slot.Parameters:
slot- The equipment slotitemStack- The item to equip
Attributes
Gets an attribute instance for modification.Parameters:
attribute- The attribute to get
Gets the current value of an attribute.Parameters:
attribute- The attribute
Fire & Effects
Gets remaining fire ticks.Returns: Fire duration in ticks
Sets the entity on fire.Parameters:
ticks- Duration in ticks
Checks if the entity is invulnerable.Returns: true if invulnerable
Makes the entity invulnerable or vulnerable.Parameters:
invulnerable- true for invulnerability
Player Class
Extends LivingEntity with player-specific functionality.Player Information
Gets the player’s username.Returns: The username
Gets the display name shown in tab list.Returns: Display name component, or null for username
Sets the tab list display name.Parameters:
displayName- The display name (null for username)
Gets the player’s skin.Returns: The PlayerSkin, or null for default
Changes the player’s skin (respawns player for all viewers).Parameters:
skin- The new skin (null for UUID default)
Game Mode & Abilities
Gets the player’s game mode.Returns: The GameMode
Sets the game mode.Parameters:
gameMode- The new game mode
Checks if the player is flying.Returns: true if flying
Sets the player flying state.Parameters:
flying- true to make fly
Checks if the player can fly.Returns: true if flight is allowed
Allows or disallows flight.Parameters:
allowFlying- true to allow flying
Inventory
Gets the player’s inventory.Returns: The PlayerInventory
Opens an inventory GUI for the player.Parameters:
inventory- The inventory to open
Closes the currently open inventory.
Gets the currently open inventory.Returns: The open inventory, or null
Food & Experience
Gets the food level (0-20).Returns: Food level
Sets the food level.Parameters:
food- Food level (0-20)
Gets food saturation.Returns: Saturation level
Sets food saturation.Parameters:
foodSaturation- Saturation (0-20)
Gets the experience level.Returns: The level
Sets the experience level.Parameters:
level- The new level
Respawn
Gets the respawn point.Returns: The respawn position
Sets the respawn point.Parameters:
respawnPoint- The new respawn position
Respawns the player if dead.
Communication
Sends a chat message to the player.Parameters:
message- The message component
Kicks the player from the server.Parameters:
reason- The kick reason
Sends a packet to the player.Parameters:
packet- The packet to send
EntityType
Represents a type of entity (autogenerated from Minecraft data).Gets an EntityType by namespaced key.Parameters:
key- The entity key (e.g., “minecraft:zombie”)
Gets all registered entity types.Returns: Collection of all EntityTypes
