amulet.api.entity module

class amulet.api.entity.Entity(namespace, base_name, x, y, z, nbt)[source]

A class to contain all the data to define an Entity.

__init__(namespace, base_name, x, y, z, nbt)[source]

Constructs a Entity instance.

Parameters
  • namespace (str) – The namespace of the entity eg “minecraft”

  • base_name (str) – The base name of the entity eg “creeper”

  • x (float) – The x coordinate of the entity

  • y (float) – The y coordinate of the entity

  • z (float) – The z coordinate of the entity

  • nbt (NamedTag) – The NBT stored with the entity

property x: float[source]

The x location of the Entity.

property y: float[source]

The y location of the Entity.

property base_name: str[source]

The base name of the block entity represented by the BlockEntity object (eg: creeper, pig)

Returns

The base name of the block entity

property namespace: str[source]

The namespace of the block entity represented by the BlockEntity object (eg: minecraft)

Returns

The namespace of the block entity

property namespaced_name: str[source]

The namespace:base_name of the entity represented by the object (eg: minecraft:creeper)

If the given namespace is an empty string it will just return the base name.

Returns

The namespace:base_name of the block entity or just base_name if no namespace

property nbt: NamedTag[source]

The NBT behind the object

Getter

Get the NBT data stored in the object

Setter

Set the NBT data stored in the object

Returns

A NamedTag

property z: float[source]

The z location of the Entity.

property location: Tuple[float, float, float][source]

The location of the Entity.