valence_protocol/packets/play/
entity_attributes_s2c.rs
1use std::borrow::Cow;
2
3use uuid::Uuid;
4use valence_ident::Ident;
5
6use crate::{Decode, Encode, Packet, VarInt};
7
8#[derive(Clone, Debug, Encode, Decode, Packet)]
9pub struct EntityAttributesS2c<'a> {
10 pub entity_id: VarInt,
11 pub properties: Vec<AttributeProperty<'a>>,
12}
13
14#[derive(Clone, PartialEq, Debug, Encode, Decode)]
15pub struct AttributeProperty<'a> {
16 pub key: Ident<Cow<'a, str>>,
17 pub value: f64,
18 pub modifiers: Vec<AttributeModifier>,
19}
20
21#[derive(Clone, PartialEq, Debug, Encode, Decode)]
22pub struct AttributeModifier {
23 pub uuid: Uuid,
24 pub amount: f64,
25 pub operation: u8,
26}