An ItemGroup is a group of Items that is shown in the Creative mode inventory.

Импорт класса

Link to импорт-класса

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

ZenScript
Copy
import crafttweaker.api.item.ItemGroup;

Name: fill

Fills the given List with this ItemGroup's Items.

Return Type: void

ZenScript
Copy
// ItemGroup.fill(items as stdlib.List<IItemStack>) as void

<itemgroup:misc>.fill(new List<IItemStack>(););
ПараметрТипОписание
Параметр
items
Тип
stdlib.List<IItemStack>
Описание
The list to fill.

Name: getGroupName

Gets the translated ItemGroup name.

Returns: The translated ItemGroup name.
Return Type: MCTextComponent

ZenScript
Copy
// ItemGroup.getGroupName() as MCTextComponent

<itemgroup:misc>.getGroupName();

Name: getItems

Gets the items in this ItemGroup.

Returns: A list containing all the items in this ItemGroup.
Return Type: stdlib.List<IItemStack>

ZenScript
Copy
// ItemGroup.getItems() as stdlib.List<IItemStack>

<itemgroup:misc>.getItems();

Name: getLabelColor

Gets the color of the ItemGroup's name.

Returns: The color of the ItemGroup's name.
Return Type: int

ZenScript
Copy
// ItemGroup.getLabelColor() as int

<itemgroup:misc>.getLabelColor();

Name: getPath

Gets the path of this ItemGroup. The path is the name of the ItemGroup.

Returns: The path of this ItemGroup.
Return Type: string

ZenScript
Copy
// ItemGroup.getPath() as string

<itemgroup:misc>.getPath();

Link to getRelevantEnchantmentTypes

Name: getRelevantEnchantmentTypes

Gets the relevant EnchantmentTypes of this ItemGroup. The EnchantmentTypes are used to determine what enchanted books should be put in the tab.

Returns: This ItemGroup's enchantment types.
Return Type: EnchantmentType[]

ZenScript
Copy
// ItemGroup.getRelevantEnchantmentTypes() as EnchantmentType[]

<itemgroup:misc>.getRelevantEnchantmentTypes();

Link to getSearchbarWidth

Name: getSearchbarWidth

Gets the width of the searchbar.

Returns: The width of the searchbar.
Return Type: int

ZenScript
Copy
// ItemGroup.getSearchbarWidth() as int

<itemgroup:misc>.getSearchbarWidth();

Name: getSlotColor

Gets the slot color that this ItemGroup uses.

Returns: The slot color that this ItemGroup uses.
Return Type: int

ZenScript
Copy
// ItemGroup.getSlotColor() as int

<itemgroup:misc>.getSlotColor();

Name: getTabPage

Gets the page in the Creative Menu that this ItemGroup is on.

Returns: The page that this ItemGroup is on.
Return Type: int

ZenScript
Copy
// ItemGroup.getTabPage() as int

<itemgroup:misc>.getTabPage();

Link to hasRelevantEnchantmentType

Name: hasRelevantEnchantmentType

Checks if this ItemGroup has the given EnchantmentType.

Returns: True if it contains the EnchantmentType. False otherwise.
Return Type: boolean

ZenScript
Copy
// ItemGroup.hasRelevantEnchantmentType(enchantmentType as EnchantmentType?) as boolean

<itemgroup:misc>.hasRelevantEnchantmentType(EnchantmentType.ARMOR);
ПараметрТипОписание
Параметр
enchantmentType
Тип
EnchantmentType?
Описание
The EnchantmentType to check.

Name: hasSearchBar

Checks if this ItemGroup has a search bar.

Returns: True if this ItemGroup has a search bar. False otherwise.
Return Type: boolean

ZenScript
Copy
// ItemGroup.hasSearchBar() as boolean

<itemgroup:misc>.hasSearchBar();

Свойства

Link to свойства

НазваниеТипИмеет GetterИмеет SetterОписание
Название
commandString
Тип
string
Имеет Getter
true
Имеет Setter
false
Описание
No Description Provided
Название
groupName
Тип
Компонент MCTextcomponent
Имеет Getter
true
Имеет Setter
false
Описание
Gets the translated ItemGroup name.
Название
items
Тип
stdlib.List<IItemStack>
Имеет Getter
true
Имеет Setter
false
Описание
Gets the items in this ItemGroup.
Название
labelColor
Тип
int
Имеет Getter
true
Имеет Setter
false
Описание
Gets the color of the ItemGroup's name.
Название
page
Тип
int
Имеет Getter
true
Имеет Setter
false
Описание
Gets the page in the Creative Menu that this ItemGroup is on.
Название
path
Тип
string
Имеет Getter
true
Имеет Setter
false
Описание
Gets the path of this ItemGroup.
The path is the name of the ItemGroup.
Название
relevantEnchantmentTypes
Тип
EnchantmentType[]
Имеет Getter
true
Имеет Setter
false
Описание
Gets the relevant EnchantmentTypes of this ItemGroup.
The EnchantmentTypes are used to determine what enchanted books should be put in the tab.
Название
searchBar
Тип
boolean
Имеет Getter
true
Имеет Setter
false
Описание
Checks if this ItemGroup has a search bar.
Название
searchBarWidth
Тип
int
Имеет Getter
true
Имеет Setter
false
Описание
Gets the width of the searchbar.
Название
slotColor
Тип
int
Имеет Getter
true
Имеет Setter
false
Описание
Gets the slot color that this ItemGroup uses.