Skip to main content

Block

Struct Block 

Source
pub struct Block(/* private fields */);
Expand description

A 1.8 block type (registry id 0..=197).

Implementations§

Source§

impl Block

Block constants.

Source

pub const AIR: Self

air (Air).

Source

pub const STONE: Self

stone (Stone).

Source

pub const GRASS: Self

grass (Grass Block).

Source

pub const DIRT: Self

dirt (Dirt).

Source

pub const COBBLESTONE: Self

cobblestone (Cobblestone).

Source

pub const PLANKS: Self

planks (Wood Planks).

Source

pub const SAPLING: Self

sapling (Sapling).

Source

pub const BEDROCK: Self

bedrock (Bedrock).

Source

pub const FLOWING_WATER: Self

flowing_water (Water).

Source

pub const WATER: Self

water (Stationary Water).

Source

pub const FLOWING_LAVA: Self

flowing_lava (Lava).

Source

pub const LAVA: Self

lava (Stationary Lava).

Source

pub const SAND: Self

sand (Sand).

Source

pub const GRAVEL: Self

gravel (Gravel).

Source

pub const GOLD_ORE: Self

gold_ore (Gold Ore).

Source

pub const IRON_ORE: Self

iron_ore (Iron Ore).

Source

pub const COAL_ORE: Self

coal_ore (Coal Ore).

Source

pub const LOG: Self

log (Wood).

Source

pub const LEAVES: Self

leaves (Leaves).

Source

pub const SPONGE: Self

sponge (Sponge).

Source

pub const GLASS: Self

glass (Glass).

Source

pub const LAPIS_ORE: Self

lapis_ore (Lapis Lazuli Ore).

Source

pub const LAPIS_BLOCK: Self

lapis_block (Lapis Lazuli Block).

Source

pub const DISPENSER: Self

dispenser (Dispenser).

Source

pub const SANDSTONE: Self

sandstone (Sandstone).

Source

pub const NOTEBLOCK: Self

noteblock (Note Block).

Source

pub const BED: Self

bed (Bed).

Source

pub const GOLDEN_RAIL: Self

golden_rail (Powered Rail).

Source

pub const DETECTOR_RAIL: Self

detector_rail (Detector Rail).

Source

pub const STICKY_PISTON: Self

sticky_piston (Sticky Piston).

Source

pub const WEB: Self

web (Cobweb).

Source

pub const TALLGRASS: Self

tallgrass (Grass).

Source

pub const DEADBUSH: Self

deadbush (Dead Bush).

Source

pub const PISTON: Self

piston (Piston).

Source

pub const PISTON_HEAD: Self

piston_head (Piston Head).

Source

pub const WOOL: Self

wool (Wool).

Source

pub const PISTON_EXTENSION: Self

piston_extension (Block moved by Piston).

Source

pub const YELLOW_FLOWER: Self

yellow_flower (Dandelion).

Source

pub const RED_FLOWER: Self

red_flower (Poppy).

Source

pub const BROWN_MUSHROOM: Self

brown_mushroom (Brown Mushroom).

Source

pub const RED_MUSHROOM: Self

red_mushroom (Red Mushroom).

Source

pub const GOLD_BLOCK: Self

gold_block (Block of Gold).

Source

pub const IRON_BLOCK: Self

iron_block (Block of Iron).

Source

pub const DOUBLE_STONE_SLAB: Self

double_stone_slab (Double Stone Slab).

Source

pub const STONE_SLAB: Self

stone_slab (Stone Slab).

Source

pub const BRICK_BLOCK: Self

brick_block (Bricks).

Source

pub const TNT: Self

tnt (TNT).

Source

pub const BOOKSHELF: Self

bookshelf (Bookshelf).

Source

pub const MOSSY_COBBLESTONE: Self

mossy_cobblestone (Moss Stone).

Source

pub const OBSIDIAN: Self

obsidian (Obsidian).

Source

pub const TORCH: Self

torch (Torch).

Source

pub const FIRE: Self

fire (Fire).

Source

pub const MOB_SPAWNER: Self

mob_spawner (Monster Spawner).

Source

pub const OAK_STAIRS: Self

oak_stairs (Oak Wood Stairs).

Source

pub const CHEST: Self

chest (Chest).

Source

pub const REDSTONE_WIRE: Self

redstone_wire (Redstone Wire).

Source

pub const DIAMOND_ORE: Self

diamond_ore (Diamond Ore).

Source

pub const DIAMOND_BLOCK: Self

diamond_block (Block of Diamond).

Source

pub const CRAFTING_TABLE: Self

crafting_table (Crafting Table).

Source

pub const WHEAT: Self

wheat (Wheat).

Source

pub const FARMLAND: Self

farmland (Farmland).

Source

pub const FURNACE: Self

furnace (Furnace).

Source

pub const LIT_FURNACE: Self

lit_furnace (Burning Furnace).

Source

pub const STANDING_SIGN: Self

standing_sign (Standing Sign).

Source

pub const WOODEN_DOOR: Self

wooden_door (Oak Door).

Source

pub const LADDER: Self

ladder (Ladder).

Source

pub const RAIL: Self

rail (Rail).

Source

pub const STONE_STAIRS: Self

stone_stairs (Cobblestone Stairs).

Source

pub const WALL_SIGN: Self

wall_sign (Wall Sign).

Source

pub const LEVER: Self

lever (Lever).

Source

pub const STONE_PRESSURE_PLATE: Self

stone_pressure_plate (Stone Pressure Plate).

Source

pub const IRON_DOOR: Self

iron_door (Iron Door).

Source

pub const WOODEN_PRESSURE_PLATE: Self

wooden_pressure_plate (Wooden Pressure Plate).

Source

pub const REDSTONE_ORE: Self

redstone_ore (Redstone Ore).

Source

pub const LIT_REDSTONE_ORE: Self

lit_redstone_ore (Glowing Redstone Ore).

Source

pub const UNLIT_REDSTONE_TORCH: Self

unlit_redstone_torch (Redstone Torch (inactive)).

Source

pub const REDSTONE_TORCH: Self

redstone_torch (Redstone Torch (active)).

Source

pub const STONE_BUTTON: Self

stone_button (Stone Button).

Source

pub const SNOW_LAYER: Self

snow_layer (Snow (layer)).

Source

pub const ICE: Self

ice (Ice).

Source

pub const SNOW: Self

snow (Snow).

Source

pub const CACTUS: Self

cactus (Cactus).

Source

pub const CLAY: Self

clay (Clay).

Source

pub const REEDS: Self

reeds (Sugar Cane).

Source

pub const JUKEBOX: Self

jukebox (Jukebox).

Source

pub const FENCE: Self

fence (Fence).

Source

pub const PUMPKIN: Self

pumpkin (Pumpkin).

Source

pub const NETHERRACK: Self

netherrack (Netherrack).

Source

pub const SOUL_SAND: Self

soul_sand (Soul Sand).

Source

pub const GLOWSTONE: Self

glowstone (Glowstone).

Source

pub const PORTAL: Self

portal (Nether Portal).

Source

pub const LIT_PUMPKIN: Self

lit_pumpkin (Jack o’Lantern).

Source

pub const CAKE: Self

cake (Cake).

Source

pub const UNPOWERED_REPEATER: Self

unpowered_repeater (Redstone Repeater (inactive)).

Source

pub const POWERED_REPEATER: Self

powered_repeater (Redstone Repeater (active)).

Source

pub const STAINED_GLASS: Self

stained_glass (Stained Glass).

Source

pub const TRAPDOOR: Self

trapdoor (Trapdoor).

Source

pub const MONSTER_EGG: Self

monster_egg (Monster Egg).

Source

pub const STONEBRICK: Self

stonebrick (Stone Bricks).

Source

pub const BROWN_MUSHROOM_BLOCK: Self

brown_mushroom_block (Brown Mushroom (block)).

Source

pub const RED_MUSHROOM_BLOCK: Self

red_mushroom_block (Red Mushroom (block)).

Source

pub const IRON_BARS: Self

iron_bars (Iron Bars).

Source

pub const GLASS_PANE: Self

glass_pane (Glass Pane).

Source

pub const MELON_BLOCK: Self

melon_block (Melon).

Source

pub const PUMPKIN_STEM: Self

pumpkin_stem (Pumpkin Stem).

Source

pub const MELON_STEM: Self

melon_stem (Melon Stem).

Source

pub const VINE: Self

vine (Vines).

Source

pub const FENCE_GATE: Self

fence_gate (Fence Gate).

Source

pub const BRICK_STAIRS: Self

brick_stairs (Brick Stairs).

Source

pub const STONE_BRICK_STAIRS: Self

stone_brick_stairs (Stone Brick Stairs).

Source

pub const MYCELIUM: Self

mycelium (Mycelium).

Source

pub const WATERLILY: Self

waterlily (Lily Pad).

Source

pub const NETHER_BRICK: Self

nether_brick (Nether Brick).

Source

pub const NETHER_BRICK_FENCE: Self

nether_brick_fence (Nether Brick Fence).

Source

pub const NETHER_BRICK_STAIRS: Self

nether_brick_stairs (Nether Brick Stairs).

Source

pub const NETHER_WART: Self

nether_wart (Nether Wart).

Source

pub const ENCHANTING_TABLE: Self

enchanting_table (Enchantment Table).

Source

pub const BREWING_STAND: Self

brewing_stand (Brewing Stand).

Source

pub const CAULDRON: Self

cauldron (Cauldron).

Source

pub const END_PORTAL: Self

end_portal (End Portal).

Source

pub const END_PORTAL_FRAME: Self

end_portal_frame (End Portal Block).

Source

pub const END_STONE: Self

end_stone (End Stone).

Source

pub const DRAGON_EGG: Self

dragon_egg (Dragon Egg).

Source

pub const REDSTONE_LAMP: Self

redstone_lamp (Redstone Lamp (inactive)).

Source

pub const LIT_REDSTONE_LAMP: Self

lit_redstone_lamp (Redstone Lamp (active)).

Source

pub const DOUBLE_WOODEN_SLAB: Self

double_wooden_slab (Double Wooden Slab).

Source

pub const WOODEN_SLAB: Self

wooden_slab (Wooden Slab).

Source

pub const COCOA: Self

cocoa (Cocoa).

Source

pub const SANDSTONE_STAIRS: Self

sandstone_stairs (Sandstone Stairs).

Source

pub const EMERALD_ORE: Self

emerald_ore (Emerald Ore).

Source

pub const ENDER_CHEST: Self

ender_chest (Ender Chest).

Source

pub const TRIPWIRE_HOOK: Self

tripwire_hook (Tripwire Hook).

Source

pub const TRIPWIRE: Self

tripwire (Tripwire).

Source

pub const EMERALD_BLOCK: Self

emerald_block (Block of Emerald).

Source

pub const SPRUCE_STAIRS: Self

spruce_stairs (Spruce Wood Stairs).

Source

pub const BIRCH_STAIRS: Self

birch_stairs (Birch Wood Stairs).

Source

pub const JUNGLE_STAIRS: Self

jungle_stairs (Jungle Wood Stairs).

Source

pub const COMMAND_BLOCK: Self

command_block (Command Block).

Source

pub const BEACON: Self

beacon (Beacon).

Source

pub const COBBLESTONE_WALL: Self

cobblestone_wall (Cobblestone Wall).

Source

pub const FLOWER_POT: Self

flower_pot (Flower Pot).

Source

pub const CARROTS: Self

carrots (Carrot).

Source

pub const POTATOES: Self

potatoes (Potato).

Source

pub const WOODEN_BUTTON: Self

wooden_button (Wooden Button).

Source

pub const SKULL: Self

skull (Mob head).

Source

pub const ANVIL: Self

anvil (Anvil).

Source

pub const TRAPPED_CHEST: Self

trapped_chest (Trapped Chest).

Source

pub const LIGHT_WEIGHTED_PRESSURE_PLATE: Self

light_weighted_pressure_plate (Weighted Pressure Plate (Light)).

Source

pub const HEAVY_WEIGHTED_PRESSURE_PLATE: Self

heavy_weighted_pressure_plate (Weighted Pressure Plate (Heavy)).

Source

pub const UNPOWERED_COMPARATOR: Self

unpowered_comparator (Redstone Comparator).

Source

pub const POWERED_COMPARATOR: Self

powered_comparator (Redstone Comparator (deprecated)).

Source

pub const DAYLIGHT_DETECTOR: Self

daylight_detector (Daylight Sensor).

Source

pub const REDSTONE_BLOCK: Self

redstone_block (Block of Redstone).

Source

pub const QUARTZ_ORE: Self

quartz_ore (Nether Quartz Ore).

Source

pub const HOPPER: Self

hopper (Hopper).

Source

pub const QUARTZ_BLOCK: Self

quartz_block (Block of Quartz).

Source

pub const QUARTZ_STAIRS: Self

quartz_stairs (Quartz Stairs).

Source

pub const ACTIVATOR_RAIL: Self

activator_rail (Activator Rail).

Source

pub const DROPPER: Self

dropper (Dropper).

Source

pub const STAINED_HARDENED_CLAY: Self

stained_hardened_clay (Stained Clay).

Source

pub const STAINED_GLASS_PANE: Self

stained_glass_pane (Stained Glass Pane).

Source

pub const LEAVES2: Self

leaves2 (Leaves (Acacia/Dark Oak)).

Source

pub const LOG2: Self

log2 (Wood (Acacia/Dark Oak)).

Source

pub const ACACIA_STAIRS: Self

acacia_stairs (Acacia Wood Stairs).

Source

pub const DARK_OAK_STAIRS: Self

dark_oak_stairs (Dark Oak Wood Stairs).

Source

pub const SLIME: Self

slime (Slime Block).

Source

pub const BARRIER: Self

barrier (Barrier).

Source

pub const IRON_TRAPDOOR: Self

iron_trapdoor (Iron Trapdoor).

Source

pub const PRISMARINE: Self

prismarine (Prismarine).

Source

pub const SEA_LANTERN: Self

sea_lantern (Sea Lantern).

Source

pub const HAY_BLOCK: Self

hay_block (Hay Bale).

Source

pub const CARPET: Self

carpet (Carpet).

Source

pub const HARDENED_CLAY: Self

hardened_clay (Hardened Clay).

Source

pub const COAL_BLOCK: Self

coal_block (Block of Coal).

Source

pub const PACKED_ICE: Self

packed_ice (Packed Ice).

Source

pub const DOUBLE_PLANT: Self

double_plant (Large Flowers).

Source

pub const STANDING_BANNER: Self

standing_banner (Standing Banner).

Source

pub const WALL_BANNER: Self

wall_banner (Wall Banner).

Source

pub const DAYLIGHT_DETECTOR_INVERTED: Self

daylight_detector_inverted (Inverted Daylight Sensor).

Source

pub const RED_SANDSTONE: Self

red_sandstone (Red Sandstone).

Source

pub const RED_SANDSTONE_STAIRS: Self

red_sandstone_stairs (Red Sandstone Stairs).

Source

pub const DOUBLE_STONE_SLAB2: Self

double_stone_slab2 (Double Red Sandstone Slab).

Source

pub const STONE_SLAB2: Self

stone_slab2 (Red Sandstone Slab).

Source

pub const SPRUCE_FENCE_GATE: Self

spruce_fence_gate (Spruce Fence Gate).

Source

pub const BIRCH_FENCE_GATE: Self

birch_fence_gate (Birch Fence Gate).

Source

pub const JUNGLE_FENCE_GATE: Self

jungle_fence_gate (Jungle Fence Gate).

Source

pub const DARK_OAK_FENCE_GATE: Self

dark_oak_fence_gate (Dark Oak Fence Gate).

Source

pub const ACACIA_FENCE_GATE: Self

acacia_fence_gate (Acacia Fence Gate).

Source

pub const SPRUCE_FENCE: Self

spruce_fence (Spruce Fence).

Source

pub const BIRCH_FENCE: Self

birch_fence (Birch Fence).

Source

pub const JUNGLE_FENCE: Self

jungle_fence (Jungle Fence).

Source

pub const DARK_OAK_FENCE: Self

dark_oak_fence (Dark Oak Fence).

Source

pub const ACACIA_FENCE: Self

acacia_fence (Acacia Fence).

Source

pub const SPRUCE_DOOR: Self

spruce_door (Spruce Door).

Source

pub const BIRCH_DOOR: Self

birch_door (Birch Door).

Source

pub const JUNGLE_DOOR: Self

jungle_door (Jungle Door).

Source

pub const ACACIA_DOOR: Self

acacia_door (Acacia Door).

Source

pub const DARK_OAK_DOOR: Self

dark_oak_door (Dark Oak Door).

Source§

impl Block

Source

pub const fn from_id(id: u8) -> Option<Block>

The block with this registry id, if it exists in 1.8.

Source

pub fn from_name(name: &str) -> Option<Block>

Looks a block up by registry name ("stone", no namespace).

Source

pub const fn id(self) -> u8

Registry id.

Source

pub fn info(self) -> &'static BlockInfo

Static information (names, hardness, drops, physics).

Source

pub fn name(self) -> &'static str

Registry name.

Source

pub fn physics(self) -> &'static BlockPhysics

Physics properties (slipperiness, climbable, …).

Source

pub fn vanilla(self) -> &'static VanillaProps

Vanilla 1.8.9 shape and material flags.

Source

pub fn material(self) -> Material

Vanilla material (shorthand for self.vanilla().material).

Source

pub fn full_cube(self) -> bool

Block.isFullCube() (shorthand for self.vanilla().full_cube).

Source

pub fn shape_dependency(self) -> ShapeDependency

What the collision shape depends on besides (id, meta).

Source

pub const fn with_meta(self, meta: u8) -> BlockState

The state with this metadata (meta & 15).

Source

pub const fn default_state(self) -> BlockState

The state with metadata 0.

Source

pub fn all() -> impl ExactSizeIterator<Item = Block>

All blocks in id order.

Trait Implementations§

Source§

impl Clone for Block

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Block

Source§

impl Debug for Block

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Block

Source§

impl Hash for Block

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Block

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for Block

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl PartialOrd for Block

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for Block

Auto Trait Implementations§

§

impl Forget for Block

§

impl Freeze for Block

§

impl RefUnwindSafe for Block

§

impl Send for Block

§

impl Sync for Block

§

impl Unpin for Block

§

impl UnsafeUnpin for Block

§

impl UnwindSafe for Block

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.