Class ItemContext.ItemContextBuilder

java.lang.Object
dev.aurelium.auraskills.api.item.ItemContext.ItemContextBuilder
Enclosing class:
ItemContext

public static class ItemContext.ItemContextBuilder extends Object
  • Constructor Details

    • ItemContextBuilder

      public ItemContextBuilder()
  • Method Details

    • material

      public ItemContext.ItemContextBuilder material(String material)
      Defines the base material of the context item. This should be a valid Minecraft item name such as diamond_block.
      Parameters:
      material - the material
      Returns:
      the builder
    • pos

      Defines the exact position/slot of the context in the menu. Two formats are possible: 1. A comma-separated "row,column" format where the row and columns start at 0,0 at the top left of the menu. 2. A single integer (as a String) that defines the slot number from 0-54 going left to right, top to bottom.
      Parameters:
      pos - the pos value in either format
      Returns:
      the builder
    • group

      public ItemContext.ItemContextBuilder group(String group)
      Defines the context group this context is part of. Together with order, it is an alternative to specifying a static pos. When a group and order is specified, items are positioned within the rectangle created by the start and end of the group defined in the menu configuration file and positioned based on their order and align.
      Parameters:
      group - the group name as defined in the menu file
      Returns:
      the builder
    • order

      public ItemContext.ItemContextBuilder order(int order)
      Defines the order within the context group this context is part of. You must also use group to define the group name. Lower order numbers will be positioned to the left and top of contexts with higher order numbers but the exact position is based on the "align" of the group.
      Parameters:
      order - the order of the context
      Returns:
      the builder
    • set

      public ItemContext.ItemContextBuilder set(String key, Object value)
      Adds any custom key-value pair to the context in order to specify special item metas like enchantments, nbt, etc.
      Parameters:
      key - the key of the entry to set, should be a valid Slate menu file item context key
      value - the value of the entry
      Returns:
      the builder
    • build

      public ItemContext build()
      Builds the context.
      Returns:
      the context