Package org.bukkit.entity
Interface Item
- All Superinterfaces:
CommandSender
,Entity
,Metadatable
,Nameable
,Permissible
,PersistentDataHolder
,ServerOperator
Represents a dropped item.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bukkit.entity.Entity
Entity.Spigot
-
Method Summary
Modifier and TypeMethodDescriptionGets the item stack associated with this item drop.getOwner()
Get the owner of this item.int
Gets the delay before this Item is available to be picked up by playersGet the thrower of this item.boolean
Gets if this Item lives forevervoid
setItemStack
(ItemStack stack) Sets the item stack associated with this item drop.void
Sets the owner of this item.void
setPickupDelay
(int delay) Sets the delay before this Item is available to be picked up by playersvoid
setThrower
(UUID uuid) Set the thrower of this item.void
setUnlimitedLifetime
(boolean unlimited) Sets if this Item should live foreverMethods inherited from interface org.bukkit.command.CommandSender
getName, sendMessage, sendMessage, sendMessage, sendMessage
Methods inherited from interface org.bukkit.entity.Entity
addPassenger, addScoreboardTag, copy, copy, createSnapshot, eject, getAsString, getBoundingBox, getEntityId, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getSpawnCategory, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTicksLived, getTrackedBy, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isFrozen, isGlowing, isInsideVehicle, isInvulnerable, isInWater, isInWorld, isOnGround, isPersistent, isSilent, isValid, isVisibleByDefault, isVisualFire, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setTicksLived, setVelocity, setVisibleByDefault, setVisualFire, spigot, teleport, teleport, teleport, teleport
Methods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
Methods inherited from interface org.bukkit.Nameable
getCustomName, setCustomName
Methods inherited from interface org.bukkit.permissions.Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment
Methods inherited from interface org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer
Methods inherited from interface org.bukkit.permissions.ServerOperator
isOp, setOp
-
Method Details
-
getItemStack
Gets the item stack associated with this item drop.- Returns:
- An item stack.
-
setItemStack
Sets the item stack associated with this item drop.- Parameters:
stack
- An item stack.
-
getPickupDelay
int getPickupDelay()Gets the delay before this Item is available to be picked up by players- Returns:
- Remaining delay
-
setPickupDelay
void setPickupDelay(int delay) Sets the delay before this Item is available to be picked up by players- Parameters:
delay
- New delay
-
setUnlimitedLifetime
void setUnlimitedLifetime(boolean unlimited) Sets if this Item should live forever- Parameters:
unlimited
- true if the lifetime is unlimited
-
isUnlimitedLifetime
boolean isUnlimitedLifetime()Gets if this Item lives forever- Returns:
- true if the lifetime is unlimited
-
setOwner
Sets the owner of this item. Other entities will not be able to pickup this item when an owner is set.- Parameters:
owner
- UUID of new owner
-
getOwner
Get the owner of this item.- Returns:
- UUID of owner
-
setThrower
Set the thrower of this item. The thrower is the entity which dropped the item. This affects the trigger criteria for item pickups, for things such as advancements.- Parameters:
uuid
- UUID of thrower
-
getThrower
Get the thrower of this item. The thrower is the entity which dropped the item.- Returns:
- UUID of thrower
-