Interface OnyxBlock
- All Superinterfaces:
OnyxElement
- All Known Implementing Classes:
OnyxBlockImpl
Represents a custom block.
Acts as the builder for itself.
-
Method Summary
Modifier and TypeMethodDescriptionDefines the underlying vanilla Minecraft block underneath this custom block.blockDisplay(Consumer<OnyxBlockDisplay> builder) Configures the visual faces of the custom block using a block display builder.displayName(String name) Sets the display name using a legacy string with no italics.displayName(net.kyori.adventure.text.Component component) Sets the display name using an Adventure Component.Sets the relative path to the developer made JSON item model.Places an OnyxBlock at a given location.rotates(boolean rotates) Determines if the custom block should rotate to face the player upon placement.Methods inherited from interface OnyxElement
create, create, getId, getKey
-
Method Details
-
baseBlock
Defines the underlying vanilla Minecraft block underneath this custom block.- Parameters:
material- The vanilla block Material to use (must be a placeable block)- Returns:
- This OnyxBlock instance.
- Throws:
IllegalArgumentException- If provided Material is not a valid block.
-
displayName
-
displayName
Sets the display name using an Adventure Component.- Parameters:
component- The display name component.- Returns:
- This OnyxBlock instance.
-
blockDisplay
Configures the visual faces of the custom block using a block display builder. Note: If this method is invoked, all relevant faces of the block must be explicitly defined, otherwise an error will be thrown during resource pack generation.- Parameters:
builder- A consumer managing the texture mappings for the block's faces.- Returns:
- This OnyxBlock instance.
-
model
-
rotates
Determines if the custom block should rotate to face the player upon placement.- Parameters:
rotates- True if the custom block should face the player when placed, false otherwise.- Returns:
- This OnyxBlock instance.
-
place
-