Struct Block
#[non_exhaustive]pub struct Block {Show 23 fields
pub id: String,
pub template: String,
pub properties: BlockProperties,
pub shapes: Option<BlockShapes>,
pub collision_shapes: Option<BlockShapes>,
pub outline_context_shapes: BTreeMap<ShapeEntityKind, BlockShapes>,
pub collision_context_shapes: BTreeMap<ShapeEntityKind, BlockShapes>,
pub interaction_shapes: Option<BlockShapes>,
pub state_properties: BTreeMap<String, BlockStateProperty>,
pub default_state: BTreeMap<String, String>,
pub item: bool,
pub open_sound: Option<String>,
pub close_sound: Option<String>,
pub block_item: Option<String>,
pub pick_item: Option<String>,
pub components: Vec<(String, Option<Tag>)>,
pub connects_to: Option<String>,
pub thickness: Option<f32>,
pub wood_type: Option<String>,
pub wall_block: Option<String>,
pub sign_text_color: Option<String>,
pub sign_text_glow: Option<bool>,
pub base_block: Option<String>,
}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: String<mod id>:<path>.
template: StringThe vanilla block it copies, minecraft:<path>.
properties: BlockPropertiesproperties.
shapes: Option<BlockShapes>shapes.
collision_shapes: Option<BlockShapes>collision shapes.
outline_context_shapes: BTreeMap<ShapeEntityKind, BlockShapes>Outline overrides for actual entity queries; omitted kinds use the default.
collision_context_shapes: BTreeMap<ShapeEntityKind, BlockShapes>Collision overrides for actual entity queries; omitted kinds use the default.
interaction_shapes: Option<BlockShapes>Ray-face override, without replacing the outline hit point or creating a hit.
state_properties: BTreeMap<String, BlockStateProperty>State properties of its own, which its template does not have.
default_state: BTreeMap<String, String>State properties overlaid on the template default.
item: boolAlso add a block item with the same id.
open_sound: Option<String>The sound event a fence gate plays opening, instead of its wood’s
(WoodType.fenceGateOpen); needs a *_fence_gate template.
close_sound: Option<String>The sound event a fence gate plays closing (WoodType.fenceGateClose).
block_item: Option<String>The item this block is, for pick-block and Block.asItem, when
it is not a block item of its own: an item of this mod or a vanilla
one, checked to exist when the content loads. Needs item false.
pick_item: Option<String>The item pick-block takes from this block (getCloneItemStack), when it is not
the block’s item: a mature crop picks its seed. An item of this mod or a vanilla
one, checked to exist when the content loads. Absent is the block’s item.
components: Vec<(String, Option<Tag>)>Its item’s ordered component patch: Some(tag) sets a component, None removes it.
Component names do not include the removal prefix !.
connects_to: Option<String>A connecting block (template minecraft:chorus_plant, a PipeBlock
without the chorus plant’s rules): the block tag, without #, whose
blocks it joins besides itself (a cable’s machines).
thickness: Option<f32>A connecting block’s width in pixels (2 to 14): its shapes, the chorus plant’s (10) when unset.
wood_type: Option<String>A sign’s WoodType (template a vanilla sign), which names its editor’s
background: <namespace>:<path> a mod’s texture, a bare name vanilla’s.
The template’s when unset.
wall_block: Option<String>The block a standing or ceiling sign’s item places on a wall
(StandingAndWallBlockItem.wallBlock): one of this mod’s blocks, whose
template is the matching wall sign and which has no item. The
template’s when unset.
sign_text_color: Option<String>A sign’s new text colour (SignBlockEntity.createDefaultSignText): a DyeColor name,
black when unset. Applies to a sign when it is placed, front and back.
sign_text_glow: Option<bool>Whether a new sign’s text glows, false when unset.
base_block: Option<String>The block farmland turns into; the template’s base when unset.