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
ItemStackに設定されているカスタムネームを取り除きます。
ZenScript Copy<item:minecraft:dirt>.clearCustomName();
getRemainingItem
Link to getremainingitem
この材料スタックでクラフトが行われると、グリッド上になにが残るか? ただし、スタックが一致するかどうかのチェックは行いません! Craft Tweakerでの使用例,
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
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 文字列型 | Description stackの新しい名前 |
withDamage
Link to withdamage
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 新しいダメージの値 |
withTag
Link to withtag
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 タグを設定 |
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 文字列型 | 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 文字列型 | 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 文字列型 | 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 文字列型 | Has Getter true | Has Setter false |
名称 useDuration | Type int | Has Getter true | Has Setter false |
演算子
Link to 演算子
MUL
Link to mul
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
Result type | Is Implicit |
---|---|
Result type crafttweaker.api.data.IData | Is Implicit true |
Result type crafttweaker.api.data.MapData | Is Implicit true |
Result type crafttweaker.api.item.IItemStack | Is Implicit false |