Inventory
Link to 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 Copyimport crafttweaker.api.entity.type.player.Inventory;
Implemented Interfaces
Link to implemented-interfaces
Inventory implements the following interfaces. That means all methods defined in these interfaces are also available in Inventory
Методы
Link to методы
Name: add
Return Type: boolean
ZenScript CopyInventory.add(stack as ItemStack) as boolean
Параметр | Тип |
---|---|
Параметр stack | Тип ItemStack |
Name: add
Return Type: boolean
ZenScript CopyInventory.add(index as int, stack as ItemStack) as boolean
Параметр | Тип |
---|---|
Параметр index | Тип int |
Параметр stack | Тип ItemStack |
Name: contains
Return Type: boolean
ZenScript CopyInventory.contains(stack as ItemStack) as boolean
Параметр | Тип |
---|---|
Параметр stack | Тип ItemStack |
Name: contains
Return Type: boolean
ZenScript CopyInventory.contains(tag as KnownTag<ItemDefinition>) as boolean
Параметр | Тип |
---|---|
Параметр tag | Тип KnownTag<ItemDefinition> |
Name: dropAll
ZenScript Copy// Inventory.dropAll()
myInventory.dropAll();
Name: findSlotMatchingItem
Return Type: int
ZenScript CopyInventory.findSlotMatchingItem(stack as ItemStack) as int
Параметр | Тип |
---|---|
Параметр stack | Тип ItemStack |
Name: findSlotMatchingUnusedItem
Return Type: int
ZenScript CopyInventory.findSlotMatchingUnusedItem(stack as ItemStack) as int
Параметр | Тип |
---|---|
Параметр stack | Тип ItemStack |
Name: getArmor
Return Type: ItemStack
ZenScript CopyInventory.getArmor(armorIndex as int) as ItemStack
Параметр | Тип |
---|---|
Параметр armorIndex | Тип int |
Name: getFreeSlot
Return Type: int
ZenScript Copy// Inventory.getFreeSlot() as int
myInventory.getFreeSlot();
Name: getSelected
Return Type: ItemStack
ZenScript Copy// Inventory.getSelected() as ItemStack
myInventory.getSelected();
Name: getSlotWithRemainingSpace
Return Type: int
ZenScript CopyInventory.getSlotWithRemainingSpace(stack as ItemStack) as int
Параметр | Тип |
---|---|
Параметр stack | Тип ItemStack |
Name: getSuitableHotbarSlot
Return Type: int
ZenScript Copy// Inventory.getSuitableHotbarSlot() as int
myInventory.getSuitableHotbarSlot();
Name: getTimesChanged
Return Type: int
ZenScript Copy// Inventory.getTimesChanged() as int
myInventory.getTimesChanged();
Name: hurtArmor
ZenScript CopyInventory.hurtArmor(source as DamageSource, damage as float, armorSlots as int[])
Параметр | Тип |
---|---|
Параметр источник | Тип DamageSource |
Параметр damage | Тип float |
Параметр armorSlots | Тип int[] |
Name: pickSlot
ZenScript CopyInventory.pickSlot(index as int)
Параметр | Тип |
---|---|
Параметр index | Тип int |
Name: removeItem
ZenScript CopyInventory.removeItem(stack as ItemStack)
Параметр | Тип |
---|---|
Параметр stack | Тип ItemStack |
Name: setPickedItem
ZenScript CopyInventory.setPickedItem(stack as ItemStack)
Параметр | Тип |
---|---|
Параметр stack | Тип ItemStack |
Свойства
Link to свойства
Название | Тип | Имеет Getter | Имеет Setter |
---|---|---|---|
Название freeSlot | Тип int | Имеет Getter true | Имеет Setter false |
Название selected | Тип ItemStack | Имеет Getter true | Имеет Setter false |
Название suitableHotbarSlot | Тип int | Имеет Getter true | Имеет Setter false |
Название timesChanged | Тип int | Имеет Getter true | Имеет Setter false |