aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/packets/game/c_update_attributes.rs
blob: 7c8e9e12f1b4b195ab62e998099d614d31cc669f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use azalea_buf::AzBuf;
use azalea_inventory::components::AttributeModifier;
use azalea_protocol_macros::ClientboundGamePacket;
use azalea_registry::builtin::Attribute;
use azalea_core::entity_id::MinecraftEntityId;

#[derive(AzBuf, ClientboundGamePacket, Clone, Debug, PartialEq)]
pub struct ClientboundUpdateAttributes {
    #[var]
    pub entity_id: MinecraftEntityId,
    pub values: Vec<AttributeSnapshot>,
}

#[derive(AzBuf, Clone, Debug, PartialEq)]
pub struct AttributeSnapshot {
    pub attribute: Attribute,
    pub base: f64,
    pub modifiers: Vec<AttributeModifier>,
}