aboutsummaryrefslogtreecommitdiff
path: root/azalea-entity/src/attributes.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-12-15 14:59:26 +0700
committermat <git@matdoes.dev>2025-12-15 14:59:26 +0700
commit0569ffd2d85585eb69de9068ab3f62e768bce4e7 (patch)
treee20d7faf8df7ede4eb3f52d3223b27782a964be0 /azalea-entity/src/attributes.rs
parent232f1a434406d77dc5ef1d19edcdf006e32491e8 (diff)
downloadazalea-drasl-0569ffd2d85585eb69de9068ab3f62e768bce4e7.tar.xz
write/update docs for several items
Diffstat (limited to 'azalea-entity/src/attributes.rs')
-rw-r--r--azalea-entity/src/attributes.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/azalea-entity/src/attributes.rs b/azalea-entity/src/attributes.rs
index 6060af9f..b26f61ba 100644
--- a/azalea-entity/src/attributes.rs
+++ b/azalea-entity/src/attributes.rs
@@ -1,4 +1,6 @@
-//! See <https://minecraft.wiki/w/Attribute>.
+//! Attributes and modifiers for entities.
+//!
+//! Also see <https://minecraft.wiki/w/Attribute>.
use std::collections::{HashMap, hash_map};
@@ -45,6 +47,8 @@ impl Attributes {
}
}
+/// An individual attribute for an entity, which may have any number of
+/// modifiers attached to it.
#[derive(Clone, Debug)]
pub struct AttributeInstance {
pub base: f64,
@@ -52,6 +56,8 @@ pub struct AttributeInstance {
// TODO: add cache
}
+/// An error for when we try to call [`AttributeInstance::try_insert`] when the
+/// modifier is already present.
#[derive(Clone, Debug, Error)]
#[error("A modifier with this ID is already present.")]
pub struct AlreadyPresentError;