Package noppes.npcs.api.entity
Interface IEntityItem<T extends net.minecraft.entity.item.EntityItem>
-
- Type Parameters:
T
- The underlying Minecraft EntityItem type.
- All Superinterfaces:
IEntity<T>
public interface IEntityItem<T extends net.minecraft.entity.item.EntityItem> extends IEntity<T>
Represents an item entity in the world. Provides methods to manage pickup delay, age, ownership, and the contained item.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getAge()
IItemStack
getItem()
int
getLifeSpawn()
java.lang.String
getOwner()
Returns the owner name of the item.int
getPickupDelay()
java.lang.String
getThrower()
Returns the thrower (entity that threw the item).void
setAge(long age)
Sets the age of the item.void
setItem(IItemStack item)
Sets the item contained in this entity.void
setLifeSpawn(int age)
Sets the age threshold at which the item will despawn.void
setOwner(java.lang.String name)
Sets the owner name of the item.void
setPickupDelay(int delay)
Sets the delay before the item can be picked up.void
setThrower(java.lang.String name)
Sets the thrower (entity that threw the item).-
Methods inherited from interface noppes.npcs.api.entity.IEntity
capturesDrops, clearStoredData, clearTempData, despawn, dropItem, extinguish, getAllNbt, getBlockX, getBlockY, getBlockZ, getCapturedDrops, getDimension, getEntityId, getHeight, getMCEntity, getMotion, getMotionX, getMotionY, getMotionZ, getMount, getNbt, getNbtOptional, getPitch, getPosition, getRider, getRotation, getStoredData, getStoredDataKeys, getSurroundingEntities, getSurroundingEntities, getTempData, getTempDataKeys, getType, getTypeName, getUniqueID, getWidth, getWorld, getX, getY, getYOffset, getZ, hasCollided, hasCollidedHorizontally, hasCollidedVertically, hasStoredData, hasTempData, inFire, inLava, inWater, isAirborne, isAlive, isBurning, isSneaking, isSprinting, knockback, knockback, knockback, removeStoredData, removeTempData, setBurning, setCapturedDrops, setCapturesDrops, setDimension, setImmune, setInvisible, setMotion, setMotion, setMotionX, setMotionY, setMotionZ, setMount, setNbt, setPitch, setPosition, setPosition, setRider, setRotation, setRotation, setSneaking, setSprinting, setStoredData, setTempData, setX, setY, setZ, spawnParticle, storeAsClone, typeOf, updateEntity
-
-
-
-
Method Detail
-
getOwner
java.lang.String getOwner()
Returns the owner name of the item. Only the owner can pick the item up (unless the age is very low).- Returns:
- the owner's name.
-
setOwner
void setOwner(java.lang.String name)
Sets the owner name of the item.- Parameters:
name
- the owner's name.
-
getThrower
java.lang.String getThrower()
Returns the thrower (entity that threw the item).- Returns:
- the thrower's name.
-
setThrower
void setThrower(java.lang.String name)
Sets the thrower (entity that threw the item).- Parameters:
name
- the thrower's name.
-
getPickupDelay
int getPickupDelay()
- Returns:
- Ticks remaining before the item can be picked up. (32767 indicates an infinite delay.)
-
setPickupDelay
void setPickupDelay(int delay)
Sets the delay before the item can be picked up.- Parameters:
delay
- the pickup delay in ticks (32767 for infinite delay).
-
getAge
long getAge()
-
setAge
void setAge(long age)
Sets the age of the item.- Parameters:
age
- the new age (−32767 indicates infinite age).
-
getLifeSpawn
int getLifeSpawn()
- Returns:
- The lifespan threshold; when the age reaches this, the item despawns.
-
setLifeSpawn
void setLifeSpawn(int age)
Sets the age threshold at which the item will despawn.- Parameters:
age
- the lifespan in ticks.
-
getItem
IItemStack getItem()
- Returns:
- The item contained in this entity.
-
setItem
void setItem(IItemStack item)
Sets the item contained in this entity.- Parameters:
item
- the item to set.
-
-