Skip to main content
Version: Minecraft 26.2

dev.polymodloader.api.content.block.state

Generated

This page is generated from the source's Javadoc by ./gradlew apiReference. Do not edit it; fix the source comment and generate it again.

TypeKindDescription
BlockPropertyinterfaceA block state property such as lit=true, level=3, or facing=north.
BlockProperty.BooleanPropertyrecordA boolean property.
BlockProperty.ChoicePropertyrecordA property with named values.
BlockProperty.DirectionPropertyrecordA direction property.
BlockProperty.IntegerPropertyrecordAn integer property.
BlockProperty.NamesclassName validation shared by the property records.
BlockStateViewinterfaceA block together with the values of its properties; an immutable snapshot.

BlockProperty​

interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier

public sealed interface BlockProperty<T>

A block state property such as lit=true, level=3, or facing=north. Each combination of values is one block state; blockstate files in the resource pack select models by these names and values. Property names use a-z 0-9 _. The same property object may be read from any block that has a property with the same name and value type, including the game's own blocks (for example facing of a furnace).

A choice property has named values (shape=round); it also reads the game's own named properties such as half of stairs or axis of logs.

name()​

String name()

Since 0.1.0-alpha.4 or earlier

Property name used in blockstate files and commands.

Returns String

defaultValue()​

T defaultValue()

Since 0.1.0-alpha.4 or earlier

Value of the block's default state.

Returns T

values()​

List<T> values()

Since 0.1.0-alpha.4 or earlier

Every allowed value, in the game's order.

Returns List<T>

bool(String)​

static BlockProperty.BooleanProperty bool(String name)

Since 0.1.0-alpha.4 or earlier

A true/false property, default false.

ParameterTypeDescription
nameString—

Returns BlockProperty.BooleanProperty

integer(String, int, int)​

static BlockProperty.IntegerProperty integer(String name, int min, int max)

Since 0.1.0-alpha.4 or earlier

A whole-number property in [min, max] with 0 <= min < max <= min + 255, default min.

ParameterTypeDescription
nameString—
minint—
maxint—

Returns BlockProperty.IntegerProperty

horizontalFacing(String)​

static BlockProperty.DirectionProperty horizontalFacing(String name)

Since 0.1.0-alpha.4 or earlier

A horizontal facing (north, south, west, east), default north.

ParameterTypeDescription
nameString—

Returns BlockProperty.DirectionProperty

direction(String)​

static BlockProperty.DirectionProperty direction(String name)

Since 0.1.0-alpha.4 or earlier

Any of the six directions, default north.

ParameterTypeDescription
nameString—

Returns BlockProperty.DirectionProperty

choice(String, String[])​

static BlockProperty.ChoiceProperty choice(String name, String... values)

Since 0.1.0-alpha.4 or earlier

A property with named values, in this order; the first is the default. Values use a-z 0-9 _.

ParameterTypeDescription
nameString—
valuesString[]—

Returns BlockProperty.ChoiceProperty

BlockProperty.BooleanProperty​

record · Since 0.1.0-alpha.4 or earlier

public static record BooleanProperty(String name, Boolean defaultValue) implements BlockProperty<Boolean>

A boolean property.

ComponentTypeDescription
nameString—
defaultValueBoolean—

Supertypes: BlockProperty

values()​

public List<Boolean> values()

Since 0.1.0-alpha.4 or earlier

Every allowed value, in the game's order.

Returns List<Boolean>

withDefault(boolean)​

public BlockProperty.BooleanProperty withDefault(boolean value)

Since 0.1.0-alpha.4 or earlier

The same property with another default.

ParameterTypeDescription
valueboolean—

Returns BlockProperty.BooleanProperty

name()​

public String name()

Since 0.1.0-alpha.4 or earlier

Property name used in blockstate files and commands.

Returns String

defaultValue()​

public Boolean defaultValue()

Since 0.1.0-alpha.4 or earlier

Value of the block's default state.

Returns Boolean

BlockProperty.ChoiceProperty​

record · Since 0.1.0-alpha.4 or earlier

public static record ChoiceProperty(String name, List<String> values, String defaultValue) implements BlockProperty<String>

A property with named values.

ComponentTypeDescription
nameString—
valuesList<String>—
defaultValueString—

Supertypes: BlockProperty

withDefault(String)​

public BlockProperty.ChoiceProperty withDefault(String value)

Since 0.1.0-alpha.4 or earlier

The same property with another default.

ParameterTypeDescription
valueString—

Returns BlockProperty.ChoiceProperty

name()​

public String name()

Since 0.1.0-alpha.4 or earlier

Property name used in blockstate files and commands.

Returns String

values()​

public List<String> values()

Since 0.1.0-alpha.4 or earlier

Every allowed value, in the game's order.

Returns List<String>

defaultValue()​

public String defaultValue()

Since 0.1.0-alpha.4 or earlier

Value of the block's default state.

Returns String

BlockProperty.DirectionProperty​

record · Since 0.1.0-alpha.4 or earlier

public static record DirectionProperty(String name, boolean horizontalOnly, Direction defaultValue) implements BlockProperty<Direction>

A direction property.

ComponentTypeDescription
nameString—
horizontalOnlyboolean—
defaultValueDirection—

Supertypes: BlockProperty

values()​

public List<Direction> values()

Since 0.1.0-alpha.4 or earlier

Every allowed value, in the game's order.

Returns List<Direction>

withDefault(Direction)​

public BlockProperty.DirectionProperty withDefault(Direction value)

Since 0.1.0-alpha.4 or earlier

The same property with another default.

ParameterTypeDescription
valueDirection—

Returns BlockProperty.DirectionProperty

name()​

public String name()

Since 0.1.0-alpha.4 or earlier

Property name used in blockstate files and commands.

Returns String

defaultValue()​

public Direction defaultValue()

Since 0.1.0-alpha.4 or earlier

Value of the block's default state.

Returns Direction

BlockProperty.IntegerProperty​

record · Since 0.1.0-alpha.4 or earlier

public static record IntegerProperty(String name, int min, int max, Integer defaultValue) implements BlockProperty<Integer>

An integer property.

ComponentTypeDescription
nameString—
minint—
maxint—
defaultValueInteger—

Supertypes: BlockProperty

values()​

public List<Integer> values()

Since 0.1.0-alpha.4 or earlier

Every allowed value, in the game's order.

Returns List<Integer>

withDefault(int)​

public BlockProperty.IntegerProperty withDefault(int value)

Since 0.1.0-alpha.4 or earlier

The same property with another default.

ParameterTypeDescription
valueint—

Returns BlockProperty.IntegerProperty

name()​

public String name()

Since 0.1.0-alpha.4 or earlier

Property name used in blockstate files and commands.

Returns String

defaultValue()​

public Integer defaultValue()

Since 0.1.0-alpha.4 or earlier

Value of the block's default state.

Returns Integer

BlockProperty.Names​

class · Since 0.1.0-alpha.4 or earlier

public static final class Names

Name validation shared by the property records.

BlockStateView​

interface · Stability PREVIEW · Since 0.1.0-alpha.4 or earlier

public interface BlockStateView

A block together with the values of its properties; an immutable snapshot.

block()​

ResourceId block()

Since 0.1.0-alpha.4 or earlier

The block, for example minecraft:furnace.

Returns ResourceId

has(BlockProperty<?>)​

boolean has(BlockProperty<?> property)

Since 0.1.0-alpha.4 or earlier

Whether the block has a property with this name and value type.

ParameterTypeDescription
propertyBlockProperty<?>—

Returns boolean

get(BlockProperty<T>)​

<T> T get(BlockProperty<T> property)

Since 0.1.0-alpha.4 or earlier

The property's value.

ParameterTypeDescription
propertyBlockProperty<T>—

Returns T

Throws IllegalArgumentException — when the block has no such property

find(BlockProperty<T>)​

default <T> Optional<T> find(BlockProperty<T> property)

Since 0.1.0-alpha.4 or earlier

The property's value, or empty when the block has no such property.

ParameterTypeDescription
propertyBlockProperty<T>—

Returns Optional<T>

with(BlockProperty<T>, T)​

<T> BlockStateView with(BlockProperty<T> property, T value)

Since 0.1.0-alpha.4 or earlier

This state with one property changed; this snapshot stays as it is. It does not change the world: use WorldView.setProperty for that.

ParameterTypeDescription
propertyBlockProperty<T>—
valueT—

Returns BlockStateView

Throws IllegalArgumentException — when the block has no such property or the value is not allowed

Buy me a coffee