Interface OnyxBlock

All Superinterfaces:
OnyxElement
All Known Implementing Classes:
OnyxBlockImpl

public interface OnyxBlock extends OnyxElement
Represents a custom block. Acts as the builder for itself.
  • Method Details

    • baseBlock

      OnyxBlock baseBlock(Material material)
      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

      OnyxBlock displayName(String name)
      Sets the display name using a legacy string with no italics.
      Parameters:
      name - The display name.
      Returns:
      This OnyxBlock instance.
    • displayName

      OnyxBlock displayName(net.kyori.adventure.text.Component component)
      Sets the display name using an Adventure Component.
      Parameters:
      component - The display name component.
      Returns:
      This OnyxBlock instance.
    • blockDisplay

      OnyxBlock blockDisplay(Consumer<OnyxBlockDisplay> builder)
      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

      OnyxBlock model(String path)
      Sets the relative path to the developer made JSON item model. The path is relative to assets//models/ in your plugin jar.
      Parameters:
      path - The path without extension (e.g., "blocks/chair")
      Returns:
      This OnyxBlock instance.
    • rotates

      OnyxBlock rotates(boolean 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

      Block place(Location location)
      Places an OnyxBlock at a given location.
      Parameters:
      location - The location of the OnyxBlock to be placed.
      Returns:
      The Block after placement.