public interface BlockType extends CatalogType, Translatable
Blocks are further differentiated using a BlockState
. Complex
data, such as inventory contents, are considered data, which is provided
via DataHolder
.
Modifier and Type | Method and Description |
---|---|
boolean |
areStatisticsEnabled()
Gets if a block should be counted for statistics gathering.
|
BlockState |
getDefaultState()
Return the default state for this block.
|
float |
getEmittedLight()
Gets the amount of light emitted by this block type.
|
Optional<ItemBlock> |
getHeldItem()
Gets the equivalent
ItemBlock for this BlockType. |
String |
getName()
Return the internal ID for the block.
|
boolean |
getTickRandomly()
Gets if this BlockType is set to receive random block ticks.
|
boolean |
isAffectedByGravity()
Gets if this block is affected by gravity (if it will fall when
unsupported).
|
boolean |
isGaseous()
Gets if a block type is a gas, like air.
|
boolean |
isLiquid()
Gets if the block type is representing a liquid.
|
boolean |
isReplaceable()
Gets if a block type can be replaced by other block types when placed.
|
boolean |
isSolidCube()
Gets if a block type is a full and solid block.
|
void |
setTickRandomly(boolean tickRandomly)
Sets if the BlockType should receive random block ticks.
|
getId
getTranslation
String getName()
The format of the internal ID may vary between implementations
but in Minecraft, it follows the format of domain:type
, an
example being minecraft:stone
.
getName
in interface CatalogType
BlockState getDefaultState()
boolean getTickRandomly()
Random block ticks are most commonly used for growth of plants.
void setTickRandomly(boolean tickRandomly)
Random block ticks are most commonly used for growth of plants.
tickRandomly
- If the BlockType should tick randomly.boolean isLiquid()
boolean isSolidCube()
boolean isGaseous()
boolean isReplaceable()
boolean isAffectedByGravity()
boolean areStatisticsEnabled()
float getEmittedLight()