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.

Diese Klasse importieren

Link to diese-klasse-importieren

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.

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

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");
ParameterTypeBeschreibung
Parameter
name
Type
String
Beschreibung
New name of the stack.

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);
ParameterTypeBeschreibung
Parameter
damage
Type
int
Beschreibung
the new damage value

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"]}});
ParameterTypeBeschreibung
Parameter
tag
Type
crafttweaker.api.data.IData
Beschreibung
The tag to set.
NameTypeHas GetterHas Setter
Name
amount
Type
int
Has Getter
true
Has Setter
false
Name
burnTime
Type
int
Has Getter
true
Has Setter
true
Name
commandString
Type
String
Has Getter
true
Has Setter
false
Name
damageable
Type
boolean
Has Getter
true
Has Setter
false
Name
damaged
Type
boolean
Has Getter
true
Has Setter
false
Name
displayName
Type
String
Has Getter
true
Has Setter
false
Name
empty
Type
boolean
Has Getter
true
Has Setter
false
Name
food
Type
crafttweaker.api.food.MCFood
Has Getter
true
Has Setter
true
Name
getOrCreate
Type
crafttweaker.api.data.IData
Has Getter
true
Has Setter
false
Name
getRepairCost
Type
int
Has Getter
true
Has Setter
false
Name
hasDisplayName
Type
boolean
Has Getter
true
Has Setter
false
Name
hasEffect
Type
boolean
Has Getter
true
Has Setter
false
Name
hasTag
Type
boolean
Has Getter
true
Has Setter
false
Name
isCrossbow
Type
boolean
Has Getter
true
Has Setter
false
Name
isEnchantable
Type
boolean
Has Getter
true
Has Setter
false
Name
isEnchanted
Type
boolean
Has Getter
true
Has Setter
false
Name
items
Type
crafttweaker.api.item.IItemStack[]
Has Getter
true
Has Setter
false
Name
maxDamage
Type
int
Has Getter
true
Has Setter
false
Name
maxStackSize
Type
int
Has Getter
true
Has Setter
false
Name
registryName
Type
String
Has Getter
true
Has Setter
false
Name
stackable
Type
boolean
Has Getter
true
Has Setter
false
Name
tag
Type
crafttweaker.api.data.IData
Has Getter
true
Has Setter
false
Name
translationKey
Type
String
Has Getter
true
Has Setter
false
Name
useDuration
Type
int
Has Getter
true
Has Setter
false

Sets the amount of the ItemStack

ZenScript
Copy
<item:minecraft:dirt> * amount as int
<item:minecraft:dirt> * 3
ParameterTypeBeschreibung
Parameter
amount
Type
int
Beschreibung
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