ItemEntity
Link to itementity
Importare la Classe
Link to importare-la-classe
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 Copyimport 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
Constructors
Link to constructors
ZenScript Copynew ItemEntity(level as Level, x as double, y as double, z as double, stack as ItemStack) as ItemEntity
Parametro | Tipo |
---|---|
Parametro level | Tipo Level |
Parametro x | Tipo double |
Parametro y | Tipo double |
Parametro z | Tipo double |
Parametro stack | Tipo ItemStack |
Metodi
Link to metodi
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();
Name: hasPickUpDelay
Return Type: boolean
ZenScript Copy// ItemEntity.hasPickUpDelay() as boolean
myItemEntity.hasPickUpDelay();
Name: setDefaultPickUpDelay
ZenScript Copy// ItemEntity.setDefaultPickUpDelay()
myItemEntity.setDefaultPickUpDelay();
Name: setItem
Sets the IItemStack inside this ItemEntity.
ZenScript Copy// ItemEntity.setItem(stack as IItemStack)
myItemEntity.setItem(<item:minecraft:diamond>);
Parametro | Tipo | Descrizione |
---|---|---|
Parametro stack | Tipo IItemStack | Descrizione The new IItemStack. |
Name: setNeverPickUp
ZenScript Copy// ItemEntity.setNeverPickUp()
myItemEntity.setNeverPickUp();
Name: setNoPickUpDelay
ZenScript Copy// ItemEntity.setNoPickUpDelay()
myItemEntity.setNoPickUpDelay();
Name: setPickUpDelay
ZenScript CopyItemEntity.setPickUpDelay(ticks as int)
Parametro | Tipo |
---|---|
Parametro ticks | Tipo int |
Proprietà
Link to proprietà
Nome | Tipo | Ha Getter | Ha Setter | Descrizione |
---|---|---|---|---|
Nome hasPickupDelay | Tipo boolean | Ha Getter sì | Ha Setter no | Descrizione |
Nome item | Tipo IItemStack | Ha Getter sì | Ha Setter sì | Descrizione Gets the IItemStack inside this ItemEntity. |