The Entity and TileEntity classes
- class litemapy.Entity(str_or_nbt: str | Compound)
A Minecraft entity. Each entity is identified by a type identifier (e.g. minecraft:skeleton) and has a position within a region, as well as a rotation and a velocity vector. Most also have arbitrary data depending on their type (e.g. a sheep has a tag for its color and one indicating whether it has been sheared).
- Parameters:
str_or_nbt – either the entity identifier as a string, in which case all other tag will be default, or an bnt compound tag with the entitie’s data.
- static from_nbt(nbt: Compound) Entity
Read an entity from an nbt tag.
- Parameters:
nbt – An NBT tag with the entity’s data
- class litemapy.TileEntity(nbt: Compound)
A tile entity, also often referred to as block entities, is a type of entity which complements a block state to store additional data (e.g. containers like chest both have a block state that stores properties like their id ( minecraft:chest ) and orientation, and tile entity that stores their content. For this reason, the
TileEntityclass does not store an ID but only a position. The ID can be inferred by looking up theBlockStateas the same position in theRegion.- static from_nbt(nbt: Compound) TileEntity
Reads a tile entity from an NBT tag.
- Parameters:
nbt – the tile entity’s data as an NBT tag
- static fromnbt(nbt: Compound) TileEntity
Reads a tile entity from an NBT tag.
- Parameters:
nbt – the tile entity’s data as an NBT tag