Interface CustomBlock

All Superinterfaces:
Metadatable, PersistentStorage.Holder, SpecialBlock

public interface CustomBlock extends SpecialBlock
A type created for devs being able to create custom blocks with custom handler Use SpecialBlockAddEvent if you're looking to remove it when you think that the conditions aren't met (like when e.g. the material of the block isn't the needed one)
  • Method Details

    • getId

      String getId()
      Returns the type id of this custom block.
      A plugin might have custom blocks but it's also important to be able to distinguish them
      Returns:
      The type id of this custom block
    • setId

      void setId(String id)
      Set the type id of this custom block.
      A plugin might have custom blocks but it's also important to be able to distinguish them
      Parameters:
      id - The new type id
    • getHandler

      @Nullable CustomBlock.Handler getHandler()
      Returns the handler of this CustomBlock. The handler is responsible for adding live to the block
      Returns:
      The set handler. null when hasHandler() returns false
    • setHandler

      void setHandler(@Nullable CustomBlock.Handler handler)
      Set the handler of this CustomBlock. The handler is responsible for adding live to the block
      Parameters:
      handler - The new handler. null to remove the handler
    • hasHandler

      default boolean hasHandler()
      Returns if a handler has been set for this block with setHandler(Handler)
      Returns:
      If a handler has been set