amulet.api.block_entity
module¶
- class amulet.api.block_entity.BlockEntity(namespace, base_name, x, y, z, nbt)[source]¶
A class to contain all the data to define a BlockEntity.
- __init__(namespace, base_name, x, y, z, nbt)[source]¶
Constructs a
BlockEntity
instance.- Parameters
namespace (
str
) – The namespace of the block entity eg “minecraft”base_name (
str
) – The base name of the block entity eg “chest”x (
int
) – The x coordinate of the block entityy (
int
) – The y coordinate of the block entityz (
int
) – The z coordinate of the block entitynbt (
NamedTag
) – The NBT stored with the block entity
- new_at_location(x, y, z)[source]¶
Creates a copy of this BlockEntity at a new location BlockEntities are stored in the chunk based on their location so location cannot be mutable
- Return type
- 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