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

ZenScript
Copy
import crafttweaker.api.entity.type.item.ItemEntity;

Extending Entity

Link to extending-entity

ItemEntity extends Entity. That means all methods available in Entity are also available in ItemEntity

ZenScript
Copy
new ItemEntity(level as invalid, x as double, y as double, z as double, stack as ItemStack) as ItemEntity
ParameterTypeDescription
Parameter
level
Type
invalid
Description
No description provided
Parameter
x
Type
double
Description
No description provided
Parameter
y
Type
double
Description
No description provided
Parameter
z
Type
double
Description
No description provided
Parameter
stack
Type
Pila de objetos
Description
No description provided

Link to g-

Name: getItem

Gets the IItemStack inside this ItemEntity.

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

ZenScript
Copy
// ItemEntity.getItem() as IItemStack

myItemEntity.getItem();

Link to g--1

Name: hasPickUpDelay

Return Type: boolean

ZenScript
Copy
// ItemEntity.hasPickUpDelay() as boolean

myItemEntity.hasPickUpDelay();

Link to g--2

Name: setDefaultPickUpDelay

Return Type: void

ZenScript
Copy
// ItemEntity.setDefaultPickUpDelay() as void

myItemEntity.setDefaultPickUpDelay();

Name: setItem

Sets the IItemStack inside this ItemEntity.

Return Type: void

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

myItemEntity.setItem(<item:minecraft:diamond>);
ParameterTypeDescription
Parameter
stack
Type
IItemStack
Description
The new IItemStack.

Link to g--4

Name: setNeverPickUp

Return Type: void

ZenScript
Copy
// ItemEntity.setNeverPickUp() as void

myItemEntity.setNeverPickUp();

Link to g--5

Name: setNoPickUpDelay

Return Type: void

ZenScript
Copy
// ItemEntity.setNoPickUpDelay() as void

myItemEntity.setNoPickUpDelay();

Link to g--6

Name: setPickUpDelay

Return Type: void

ZenScript
Copy
ItemEntity.setPickUpDelay(ticks as int) as void
ParameterTypeDescription
Parameter
ticks
Type
int
Description
No Description Provided
NombreTypeHas GetterHas SetterDescription
Nombre
hasPickupDelay
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Nombre
item
Type
IItemStack
Has Getter
true
Has Setter
true
Description
Gets the IItemStack inside this ItemEntity.