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 at the very top of the file.

ZenScript
Copy
import crafttweaker.api.entity.MCItemEntity;

Extending MCEntity

Link to extending-mcentity

MCItemEntity extends MCEntity. That means all methods available in MCEntity are also available in MCItemEntity

ZenScript
Copy
new MCItemEntity(world as MCWorld, x as double, y as double, z as double, stack as ItemStack) as MCItemEntity
ParameterTypeBeschreibung
Parameter
world
Type
MCWorld
Beschreibung
No description provided
Parameter
x
Type
double
Beschreibung
No description provided
Parameter
y
Type
double
Beschreibung
No description provided
Parameter
z
Type
double
Beschreibung
No description provided
Parameter
stack
Type
Artikel-Stack
Beschreibung
No description provided

Name: getItem

Gets the IItemStack inside this ItemEntity.

Returns: The IItemStack inside this ItemEntity.
Return Type: IItemStack

ZenScript
Copy
// MCItemEntity.getItem() as IItemStack

itemEntity.getItem();

Name: setItem

Sets the IItemStack inside this ItemEntity.

Return Type: void

ZenScript
Copy
// MCItemEntity.setItem(stack as IItemStack) as void

itemEntity.setItem(<item:minecraft:diamond>);
ParameterTypeBeschreibung
Parameter
stack
Type
IItemStack
Beschreibung
The new IItemStack.
NameTypeHas GetterHas SetterBeschreibung
Name
item
Type
IItemStack
Has Getter
true
Has Setter
true
Beschreibung
Gets the IItemStack inside this ItemEntity.