Skip to main content

Protocol: Entity

A live Minecraft entity exposed through a QuestScript-owned facade.

class Entity(Protocol)

Related API: Dimension, DimensionInput, Vector3, Vector3Like

Properties

name_tag

name_tag: str

Mutable custom name shown by Minecraft.

id

@property
def id(self) -> str:

Stable runtime entity identifier.

type_id

@property
def type_id(self) -> str:

Namespaced entity type identifier.

dimension

@property
def dimension(self) -> Dimension:

Dimension currently containing the entity.

Related API: Dimension

location

@property
def location(self) -> Vector3:

Current world-space location.

Related API: Vector3

is_valid

@property
def is_valid(self) -> bool:

Whether the underlying entity can still be accessed.

Methods

teleport

def teleport(self, location: Vector3Like, *, dimension: Optional[DimensionInput]=...) -> None:

Move the entity to a location and optional destination dimension.

Related API: DimensionInput, Vector3Like

kill

def kill(self) -> None:

Apply the entity's normal lethal damage path.

remove

def remove(self) -> None:

Remove the entity without applying normal death behaviour.

extinguish

def extinguish(self) -> None:

Extinguish the entity if it is on fire.

add_tag

def add_tag(self, tag: str) -> bool:

Add an entity tag and report whether it changed.

remove_tag

def remove_tag(self, tag: str) -> bool:

Remove an entity tag and report whether it changed.

has_tag

def has_tag(self, tag: str) -> bool:

Return whether the entity has a tag.

get_tags

def get_tags(self) -> Sequence[str]:

Return a copy of all entity tags.