Data Types#
- class minecraft.datatypes.Advancement(parent_id: String | None = None, display_data: DataProxy | None = None, criteria: dict[minecraft.datatypes.Identifier, None] | None = None, requirements: list[list[minecraft.datatypes.String]] | None = None)#
Bases:
DataTypeRepresents an advancement.
- Variables:
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.AdvancementDisplay(title: Chat, description: Chat, icon: Identifier, frame_type: frame, flags: Int, background_texture: Identifier | None, x: Float, y: Float)#
Bases:
DataTypeRepresents an advancement display.
- Variables:
title (Chat) – The advancement’s title.
description (Chat) – The advancement’s description.
icon (Identifier) – The advancement’s icon.
frame_type (FrameType) – The advancement’s frame type.
flags (Int) – The advancement’s flags.
background_texture (Identifier | None) – The advancement’s background texture.
x (float) – The advancement’s X position.
y (float) – The advancement’s Y position.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.AdvancementProgress(criterion: dict[minecraft.datatypes.Identifier, minecraft.datatypes.CriterionProgress])#
Bases:
DataTypeRepresents progress towards an advancement.
- Variables:
identifier (Identifier) – The advancement’s identifier.
progress (CriterionProgress) – The advancement’s progress.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Angle(value: UnsignedByte)#
Bases:
DataTypeRepresents an angle.
- Variables:
value (UnsignedByte) – The angle.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.BitSet(longs: list[minecraft.datatypes.Long])#
Bases:
DataTypeRepresents a bit set.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.BlockEntity(xz: Byte, y: Short, type: Varint, data: NBT)#
Bases:
DataTypeRepresents a block entity.
- Variables:
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Boolean(value: bool)#
Bases:
DataTypeRepresents a boolean value.
- Variables:
value (bool) – The value of this data type.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Byte(value: int)#
Bases:
DataTypeRepresents a byte.
- Variables:
value (int) – The value of this data type.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.ByteArray(data: bytes)#
Bases:
DataTypeRepresents a byte array.
- Variables:
data (bytes) – The data in this byte array.
- classmethod from_bytes(data: BytesIO, *, length: int = None) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Chat(value: str)#
Bases:
StringRepresents chat data.
- Variables:
value (str) – The value of this data type.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.CommandNode(flags: Byte, children: list[Varint], redirect: Varint | None = None, name: String | None = None, parser: CommandParser | None = None, properties: bytes | None = None, suggestions_type: Identifier | None = None)#
Bases:
DataTypeRepresents a command node.
- Variables:
flags (Byte) – The flags of this command node.
children (list[Varint]) – The children of this command node.
redirect (Varint | None) – The redirect of this command node.
name (String | None) – The name of this command node.
parser (CommandParser | None) – The parser of this command node.
properties (bytes | None) – The properties of this command node.
suggestions_type (Identifier | None) – The suggestions type of this command node.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.CommandSuggestionMatch(match: String, tooltip: Chat | None = None)#
Bases:
DataTypeRepresents a command suggestion match.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.CriterionProgress(achieved: Boolean, date: Long | None = None)#
Bases:
DataTypeRepresents progress for a criterion.
- Variables:
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.DataProxy(**attrs)#
Bases:
objectA proxy class for data types that do not have their own class.
All attributes on this class are dynamic.
- class minecraft.datatypes.DataType#
Bases:
objectThe base class for all data types.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Double(value: float)#
Bases:
DataTypeRepresents a double.
- Variables:
value (int) – The value of this data type.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.EntityMetadata(entries: list[minecraft.datatypes.EntityMetadataEntry])#
Bases:
DataTypeRepresents an entity’s metadata.
- Variables:
entries (list[EntityMetadataEntry]) – The entries in this entity’s metadata.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.EntityMetadataEntry(index: UnsignedByte, type: Varint, value: DataType)#
Bases:
objectRepresents entity metadata.
- Variables:
index (UnsignedByte) – The index key for this entry.
type (Varint) – The type of index.
value (DataType) – The value of this entry.
- classmethod from_bytes(data: BytesIO, index: UnsignedByte) Self#
- class minecraft.datatypes.Float(value: float)#
Bases:
DataTypeRepresents a float.
- Variables:
value (int) – The value of this data type.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Identifier(value: str)#
Bases:
StringRepresents an identifier.
- Variables:
value (str) – The value of this data type.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Int(value: int)#
Bases:
DataTypeRepresents an integer.
- Variables:
value (int) – The value of this data type.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Long(value: int)#
Bases:
DataTypeRepresents a long.
- Variables:
value (int) – The value of this data type.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.MapIcon(type: MapIconType, x: Byte, y: Byte, direction: Byte, display_name: Chat | None)#
Bases:
DataTypeRepresents a map icon.
- Variables:
type (MapIconType) – The type of this map icon.
x (Byte) – The x coordinate of this map icon.
y (Byte) – The y coordinate of this map icon.
direction (Byte) – The direction this icon is pointing.
display_name (Chat) – The display name of this map icon.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.NBT(data: BytesIO, tag_id: int)#
Bases:
NBTFileRepresents NBT data. This inherits from
nbt.NBTFile.- parse_file()#
Completely parse a file, extracting all tags.
- class minecraft.datatypes.ParticleType(name: Identifier, id: Varint, data: bytes)#
Bases:
DataTypeRepresents a particle.
- Variables:
name (Identifier) – The name of this particle.
id (Varint) – The ID of this particle.
data (bytes) – The particle’s data.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.PlayerInfoUpdatePlayer(uuid: UUID, add_player: DataProxy | None = None, initialize_chat: DataProxy | None = None, update_gamemode: DataProxy | None = None, update_listed: DataProxy | None = None, update_latency: DataProxy | None = None, update_display_name: DataProxy | None = None)#
Bases:
DataTypeRepresents a player info update for a single player.
- Variables:
uuid (UUID) – The UUID of the player.
add_player (DataProxy) – The add player data.
initialize_chat (DataProxy) – The initialize chat data.
update_gamemode (DataProxy) – The update gamemode data.
update_listed (DataProxy) – The update listed data.
update_latency (DataProxy) – The update latency data.
update_display_name (DataProxy) – The update display name data.
Data Proxy Attributes
initialize_chat:has_signature_data (
Boolean) - Whether the object has signature data. Other attributes will beNoneif this isFalse.chat_session_id (
UUID| None) - The chat session ID.public_key_expiry (
Long| None) - The public key expiry.public_key (
ByteArray| None) - The public key.public_key_signature (
ByteArray| None) - The signature.
update_gamemode:gamemode (
VarInt) - The gamemode of the player.
update_listed:listed (
Boolean) - Whether the player is listed.
update_latency:latency (
VarInt) - The latency of the player.
- classmethod from_bytes(data: BytesIO, actions: Byte) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Position(x: Int, y: Int, z: Int)#
Bases:
DataTypeRepresents a position in a world.
- Variables:
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Property(name: String, value: String, signature: String | None = None)#
Bases:
DataTypeRepresents a property.
- Variables:
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Quaternion(x: Float, y: Float, z: Float, w: Float)#
Bases:
DataTypeRepresents a quaternion.
- Variables:
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Recipe(recipe_type: Identifier, recipe_id: Identifier, data: DataProxy)#
Bases:
DataTypeRepresents a recipe.
- Variables:
recipe_type (Identifier) – The recipe type.
recipe_id (Identifier) – The recipe ID.
data (DataProxy) – The recipe data.
TODO
Add recipe types and their respective data proxy values.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Short(value: int)#
Bases:
DataTypeRepresents a short.
- Variables:
value (int) – The value of this data type.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Slot(present: Boolean, item_id: Varint | None = None, count: Byte | None = None, _nbt: NBT | None = None)#
Bases:
DataTypeRepresents an item slot.
- Variables:
present (Boolean) – Whether there is an item in this slot.
item_id (Varint | None) – The ID of the item in this slot.
count (UnsignedByte | None) – The count of the item in this slot.
nbt (NBT | None) – The NBT data of the item in this slot.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Statistic(category: StatCategory, stat_id: StatID, value: Varint)#
Bases:
DataTypeRepresents a statistic.
- Variables:
category (StatCategory) – The category of this statistic.
stat_id (StatID) – The ID of this statistic.
value (Varint) – The value of this statistic.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.String(value: str)#
Bases:
DataTypeRepresents a string.
- Variables:
value (str) – The value of this data type.
- classmethod from_bytes(data: BytesIO, *, max_length: int = None) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Trade(input_item_1: Slot, output_item: Slot, input_item_2: Slot, trade_disabled: Boolean, trade_uses: Int, max_trade_uses: Int, xp: Int, special_price: Int, price_multiplier: Float, demand: Int)#
Bases:
DataTypeRepresents a villager trade.
- Variables:
input_item_1 (Slot) – The first input item of this trade.
output_item (Slot) – The output item of this trade.
input_item_2 (Slot) – The second input item of this trade.
trade_disabled (Boolean) – Whether this trade is disabled.
trade_uses (Int) – The number of times this trade has been used.
max_trade_uses (Int) – The maximum number of times this trade can be used.
xp (Int) – The amount of experience this trade gives.
special_price (Int) – The special price of this trade.
price_multiplier (Float) – The price multiplier of this trade.
demand (Int) – The demand of this trade.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.UUID(most: Unsigned64Int, least: Unsigned64Int)#
Bases:
DataTypeRepresents a UUID. For a normal representation of this, see the
uuidproperty.- Variables:
most (Unsigned64Int) – The most significant bits of this UUID.
least (Unsigned64Int) – The least significant bits of this UUID.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.UnsignedByte(value: int)#
Bases:
DataTypeRepresents an unsigned byte.
- Variables:
value (int) – The value of this data type.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.UnsignedShort(value: int)#
Bases:
DataTypeRepresents an unsigned short.
- Variables:
value (int) – The value of this data type.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Varint(value: int)#
Bases:
DataTypeRepresents a variable integer.
- Variables:
value (int) – The value of this data type.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Varlong(value: int)#
Bases:
DataTypeRepresents a variable long.
- Variables:
value (int) – The value of this data type.
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.Vector3(x: Float, y: Float, z: Float)#
Bases:
DataTypeRepresents a 3D vector.
- Variables:
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type:
- class minecraft.datatypes.VillagerData(type: Varint, profession: Varint, level: Varint)#
Bases:
DataTypeRepresents villager data.
- Variables:
- classmethod from_bytes(data: BytesIO) Self#
Creates a new instance of this data type from the given bytes.
- Parameters:
data (io.BytesIO) – The bytes to read from.
- Returns:
The new instance.
- Return type: