IItemStack
Link to iitemstack
This represents an item. It can be retrieved using an Item BEP. Is an crafttweaker.api.item.IIngredient
This class was added by a mod with mod-id crafttweaker
. So you need to have this mod installed if you want to use this feature.
Importing the class
Link to importing-the-class
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.
ZenScript Copycrafttweaker.api.item.IItemStack
Implemented Interfaces
Link to implemented-interfaces
IItemStack implements the following interfaces. That means any method available to them can also be used on this class.
Methods
Link to methods
clearCustomName
Link to clearcustomname
Clears any custom name set for this ItemStack
ZenScript Copy<item:minecraft:dirt>.clearCustomName();
getRemainingItem
Link to getremainingitem
When this ingredient stack is crafted, what will remain in the grid? Does not check if the stack matches though! Used e.g. in CrT's net.minecraft.item.crafting.ICraftingRecipe
Returns crafttweaker.api.item.IItemStack
ZenScript Copy<item:minecraft:dirt>.getRemainingItem(stack as crafttweaker.api.item.IItemStack);
<item:minecraft:dirt>.getRemainingItem(<item:minecraft:iron_ingot>);
Parameter | Type | Description |
---|---|---|
Parameter stack | Type crafttweaker.api.item.IItemStack | Description The stack to provide for this ingredient. |
matches
Link to matches
Does the given stack match the ingredient?
Returns boolean
ZenScript Copy<item:minecraft:dirt>.matches(stack as crafttweaker.api.item.IItemStack);
<item:minecraft:dirt>.matches(<item:minecraft:iron_ingot>);
Parameter | Type | Description |
---|---|---|
Parameter stack | Type crafttweaker.api.item.IItemStack | Description The stack to check |
setDisplayName
Link to setdisplayname
Sets the display name of the ItemStack
Returns crafttweaker.api.item.IItemStack
ZenScript Copy<item:minecraft:dirt>.setDisplayName(name as String);
<item:minecraft:dirt>.setDisplayName("totally not dirt");
Parameter | Type | Description |
---|---|---|
Parameter name | Type String | Description New name of the stack. |
withDamage
Link to withdamage
Sets the damage of the ItemStack
Returns crafttweaker.api.item.IItemStack
ZenScript Copy<item:minecraft:dirt>.withDamage(damage as int);
<item:minecraft:dirt>.withDamage(10);
Parameter | Type | Description |
---|---|---|
Parameter damage | Type int | Description the new damage value |
withTag
Link to withtag
Sets the tag for the ItemStack.
Returns crafttweaker.api.item.IItemStack
ZenScript Copy<item:minecraft:dirt>.withTag(tag as crafttweaker.api.data.IData);
<item:minecraft:dirt>.withTag({Display: {lore: ["Hello"]}});
Parameter | Type | Description |
---|---|---|
Parameter tag | Type crafttweaker.api.data.IData | Description The tag to set. |
Properties
Link to properties
이름 | Type | Has Getter | Has Setter |
---|---|---|---|
이름 amount | Type int | Has Getter true | Has Setter false |
이름 burnTime | Type int | Has Getter true | Has Setter true |
이름 commandString | Type String | Has Getter true | Has Setter false |
이름 damageable | Type boolean | Has Getter true | Has Setter false |
이름 damaged | Type boolean | Has Getter true | Has Setter false |
이름 displayName | Type String | Has Getter true | Has Setter false |
이름 empty | Type boolean | Has Getter true | Has Setter false |
이름 food | Type crafttweaker.api.food.MCFood | Has Getter true | Has Setter true |
이름 getOrCreate | Type crafttweaker.api.data.IData | Has Getter true | Has Setter false |
이름 getRepairCost | Type int | Has Getter true | Has Setter false |
이름 hasDisplayName | Type boolean | Has Getter true | Has Setter false |
이름 hasEffect | Type boolean | Has Getter true | Has Setter false |
이름 hasTag | Type boolean | Has Getter true | Has Setter false |
이름 isCrossbow | Type boolean | Has Getter true | Has Setter false |
이름 isEnchantable | Type boolean | Has Getter true | Has Setter false |
이름 isEnchanted | Type boolean | Has Getter true | Has Setter false |
이름 items | Type crafttweaker.api.item.IItemStack[] | Has Getter true | Has Setter false |
이름 maxDamage | Type int | Has Getter true | Has Setter false |
이름 maxStackSize | Type int | Has Getter true | Has Setter false |
이름 registryName | Type String | Has Getter true | Has Setter false |
이름 stackable | Type boolean | Has Getter true | Has Setter false |
이름 tag | Type crafttweaker.api.data.IData | Has Getter true | Has Setter false |
이름 translationKey | Type String | Has Getter true | Has Setter false |
이름 useDuration | Type int | Has Getter true | Has Setter false |
연산자
Link to 연산자
MUL
Link to mul
Sets the amount of the ItemStack
ZenScript Copy<item:minecraft:dirt> * amount as int
<item:minecraft:dirt> * 3
Parameter | Type | Description |
---|---|---|
Parameter amount | Type int | Description new amount |
Casters
Link to casters
반환 자료형 | 암묵적 |
---|---|
반환 자료형 crafttweaker.api.data.IData | 암묵적 true |
반환 자료형 crafttweaker.api.data.MapData | 암묵적 true |
반환 자료형 crafttweaker.api.item.IItemStack | 암묵적 false |