Inventory
Link to inventory
Importare la Classe
Link to importare-la-classe
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;
Interfacce Implementate
Link to interfacce-implementate
Inventory implements the following interfaces. That means all methods defined in these interfaces are also available in Inventory
Metodi
Link to metodi
Name: add
Return Type: boolean
ZenScript CopyInventory.add(stack as ItemStack) as boolean
Parametro | Tipo | Descrizione |
---|---|---|
Parametro stack | Tipo ItemStack | Descrizione No Description Provided |
Name: add
Return Type: boolean
ZenScript CopyInventory.add(index as int, stack as ItemStack) as boolean
Parametro | Tipo | Descrizione |
---|---|---|
Parametro indice | Tipo int | Descrizione No Description Provided |
Parametro stack | Tipo ItemStack | Descrizione No Description Provided |
Name: contains
Return Type: boolean
ZenScript CopyInventory.contains(stack as ItemStack) as boolean
Parametro | Tipo | Descrizione |
---|---|---|
Parametro stack | Tipo ItemStack | Descrizione No Description Provided |
Name: contains
Return Type: boolean
ZenScript CopyInventory.contains(tag as MCTag<ItemDefinition>) as boolean
Parametro | Tipo | Descrizione |
---|---|---|
Parametro tag | Tipo MCTag<ItemDefinition> | Descrizione No Description Provided |
Name: dropAll
Return Type: void
ZenScript Copy// Inventory.dropAll() as void
myInventory.dropAll();
Name: findSlotMatchingItem
Return Type: int
ZenScript CopyInventory.findSlotMatchingItem(stack as ItemStack) as int
Parametro | Tipo | Descrizione |
---|---|---|
Parametro stack | Tipo ItemStack | Descrizione No Description Provided |
Name: findSlotMatchingUnusedItem
Return Type: int
ZenScript CopyInventory.findSlotMatchingUnusedItem(stack as ItemStack) as int
Parametro | Tipo | Descrizione |
---|---|---|
Parametro stack | Tipo ItemStack | Descrizione No Description Provided |
Name: getArmor
Return Type: ItemStack
ZenScript CopyInventory.getArmor(armorIndex as int) as ItemStack
Parametro | Tipo | Descrizione |
---|---|---|
Parametro armorIndex | Tipo int | Descrizione No Description Provided |
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
Parametro | Tipo | Descrizione |
---|---|---|
Parametro stack | Tipo ItemStack | Descrizione No Description Provided |
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
Return Type: void
ZenScript CopyInventory.hurtArmor(source as DamageSource, damage as float, armorSlots as int[]) as void
Parametro | Tipo | Descrizione |
---|---|---|
Parametro sorgente | Tipo DamageSource | Descrizione No Description Provided |
Parametro damage | Tipo float | Descrizione No Description Provided |
Parametro armorSlots | Tipo int[] | Descrizione No Description Provided |
Name: pickSlot
Return Type: void
ZenScript CopyInventory.pickSlot(index as int) as void
Parametro | Tipo | Descrizione |
---|---|---|
Parametro indice | Tipo int | Descrizione No Description Provided |
Name: removeItem
Return Type: void
ZenScript CopyInventory.removeItem(stack as ItemStack) as void
Parametro | Tipo | Descrizione |
---|---|---|
Parametro stack | Tipo ItemStack | Descrizione No Description Provided |
Name: setPickedItem
Return Type: void
ZenScript CopyInventory.setPickedItem(stack as ItemStack) as void
Parametro | Tipo | Descrizione |
---|---|---|
Parametro stack | Tipo ItemStack | Descrizione No Description Provided |
Proprietà
Link to proprietà
Nome | Tipo | Ha Getter | Ha Setter | Descrizione |
---|---|---|---|---|
Nome freeSlot | Tipo int | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |
Nome selected | Tipo ItemStack | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |
Nome suitableHotbarSlot | Tipo int | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |
Nome timesChanged | Tipo int | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |