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
Copy
crafttweaker.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.

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>);
ParameterTypeDescription
Parameter
stack
Type
crafttweaker.api.item.IItemStack
Description
The stack to provide for this ingredient.

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>);
ParameterTypeDescription
Parameter
stack
Type
crafttweaker.api.item.IItemStack
Description
The stack to check

ItemStackに表示される名前を設定します。

Returns crafttweaker.api.item.IItemStack

ZenScript
Copy
<item:minecraft:dirt>.setDisplayName(name as String);
<item:minecraft:dirt>.setDisplayName("totally not dirt");
ParameterTypeDescription
Parameter
name
Type
文字列型
Description
stackの新しい名前

ItemStackのダメージ(耐久値)を設定します。

Returns crafttweaker.api.item.IItemStack

ZenScript
Copy
<item:minecraft:dirt>.withDamage(damage as int);
<item:minecraft:dirt>.withDamage(10);
ParameterTypeDescription
Parameter
damage
Type
int
Description
新しいダメージの値

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"]}});
ParameterTypeDescription
Parameter
tag
Type
crafttweaker.api.data.IData
Description
タグを設定
名称TypeHas GetterHas 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

ItemStackの数量(スタック数)を設定します。

ZenScript
Copy
<item:minecraft:dirt> * amount as int
<item:minecraft:dirt> * 3
ParameterTypeDescription
Parameter
amount
Type
int
Description
new amount
Result typeIs 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