Interface BlockBehaviour
public interface BlockBehaviour
The server-side logic of a block type: how it is placed and how it interacts with light.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault Keykey()Returns the key of the block type this behaviour drives.default intlightEmission(BlockData data) Returns the light level the state emits, from0to15.default intlightOpacity(BlockData data) Returns how much light the state absorbs, from0(transparent) to15(opaque).placementState(BlockPlaceContext context) Chooses the state a player places, for instance facing the player.type()Returns the block type this behaviour drives.
-
Method Details
-
type
BlockType type()Returns the block type this behaviour drives.- Returns:
- the block type this behaviour drives
- Since:
- 0.1.0
-
key
Returns the key of the block type this behaviour drives.- Returns:
- the key of the block type this behaviour drives
- Since:
- 0.1.0
-
placementState
Chooses the state a player places, for instance facing the player.- Parameters:
context- where and how the block is being placed- Returns:
- the state to place, or
nullto refuse the placement - Since:
- 0.1.0
-
lightEmission
Returns the light level the state emits, from0to15.- Parameters:
data- the state- Returns:
- the light level the state emits, from
0to15 - Since:
- 0.1.0
-
lightOpacity
Returns how much light the state absorbs, from0(transparent) to15(opaque).- Parameters:
data- the state- Returns:
- how much light the state absorbs, from
0(transparent) to15(opaque) - Since:
- 0.1.0
-