Struct Item
#[non_exhaustive]pub struct Item {
pub id: String,
pub template: String,
pub max_stack_size: Option<u8>,
pub rarity: Option<Rarity>,
pub components: Vec<(String, Option<Tag>)>,
pub crafting_remainder: Option<String>,
pub block: Option<String>,
pub arm_pose: Option<ArmPose>,
}Expand description
An unvalidated draft; Content::declare validates it at load.
Refused drafts are reported by the content admission path as
native blocks and items of <namespace>: <reason>, without admitting part of that namespace.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringIdentifier in the declaring mod’s namespace.
template: StringThe vanilla item it copies, minecraft:<path>.
max_stack_size: Option<u8>Maximum stack size, validated as 1 to 99 at admission.
rarity: Option<Rarity>Rarity overriding the template’s.
components: Vec<(String, Option<Tag>)>An ordered component patch over the template: Some(tag) sets, None removes.
Component names are namespaced identifiers, without a removal prefix !.
crafting_remainder: Option<String>What it leaves in the crafting grid (Item.Properties.craftRemainder):
a vanilla item or one of the mod’s own.
block: Option<String>The block placed by this item, if any.
arm_pose: Option<ArmPose>The arm pose a humanoid takes holding it, in place of vanilla’s (ArmPose).