pub struct PotionContents {
pub potion: Option<String>,
pub effects: Vec<PotionEffect>,
pub color: Option<String>,
}Expand description
A potion-bearing kit item’s minecraft:potion_contents component (DSL v0.8),
modelled field for field on vanilla rather than invented: a named potion,
a list of custom effects, or both, plus the bottle-colour override.
Vanilla resolves a drink as the named potion’s effects followed by the custom
ones, and derives the bottle colour from those effects unless color
overrides it — so {"potion": "minecraft:strong_healing"} is literally the
Potion of Healing II a player would brew, not an approximation of one.
Fields§
§potion: Option<String>A named vanilla potion id (minecraft:strong_healing,
minecraft:long_night_vision, …), validated against the pinned 1.21.11
potion registry (DW0486).
effects: Vec<PotionEffect>Custom effects applied on top of (or instead of) the named potion — the escape hatch for a recovery item vanilla has no brew for.
color: Option<String>Bottle-colour override, #rrggbb (vanilla custom_color). Absent → the
colour vanilla derives from the effects themselves.
Trait Implementations§
Source§impl Clone for PotionContents
impl Clone for PotionContents
Source§impl Debug for PotionContents
impl Debug for PotionContents
Source§impl<'de> Deserialize<'de> for PotionContents
impl<'de> Deserialize<'de> for PotionContents
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for PotionContents
impl JsonSchema for PotionContents
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more