Package org.bukkit.entity
Interface Item
- All Superinterfaces:
- Audience,- CommandSender,- Entity,- Frictional,- HoverEventSource<HoverEvent.ShowEntity>,- Metadatable,- Nameable,- Permissible,- PersistentDataHolder,- Pointered,- ServerOperator,- Sound.Emitter
Represents a dropped item.
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.bukkit.entity.EntityEntity.Spigot
- 
Method SummaryModifier and TypeMethodDescriptionbooleanGets if non-player entities can pick this Item upbooleanGets whether the player can pickup the item or notintGets the health of item stack.Gets the item stack associated with this item drop.getOwner()Get the owner of this item.intGets the delay before this Item is available to be picked up by playersGet the thrower of this item.booleanGets if this Item lives forevervoidsetCanMobPickup(boolean canMobPickup) Sets if non-player entities can pick this Item upvoidsetCanPlayerPickup(boolean canPlayerPickup) Sets whether the item can be picked up or not.voidsetHealth(int health) Sets the health of the item stack.voidsetItemStack(@NotNull ItemStack stack) Sets the item stack associated with this item drop.voidSets the owner of this item.voidsetPickupDelay(int delay) Sets the delay before this Item is available to be picked up by playersvoidsetThrower(@Nullable UUID uuid) Set the thrower of this item.voidsetUnlimitedLifetime(boolean unlimited) Sets if this Item should live forevervoidsetWillAge(boolean willAge) Sets whether the item will age or not.booleanwillAge()Gets whether the item will age and despawn from being on the ground too longMethods inherited from interface net.kyori.adventure.audience.AudienceclearTitle, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendTitlePart, showBossBar, showTitle, stopSound, stopSoundMethods inherited from interface org.bukkit.command.CommandSendergetName, name, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlainMessage, sendRichMessage, sendRichMessageMethods inherited from interface org.bukkit.entity.EntityaddPassenger, addScoreboardTag, asHoverEvent, collidesAt, eject, fromMobSpawner, getBoundingBox, getChunk, getEntityId, getEntitySpawnReason, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPistonMoveReaction, getPitch, getPortalCooldown, getPose, getScheduler, getScoreboardEntryName, getScoreboardTags, getServer, getSpawnCategory, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTicksLived, getTrackedPlayers, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, getX, getY, getYaw, getZ, hasFixedPose, hasGravity, isCustomNameVisible, isDead, isEmpty, isFreezeTickingLocked, isFrozen, isGlowing, isInBubbleColumn, isInLava, isInPowderedSnow, isInRain, isInsideVehicle, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isOnGround, isPersistent, isSilent, isSneaking, isTicking, isUnderWater, isValid, isVisibleByDefault, isVisualFire, leaveVehicle, lockFreezeTicks, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setPose, setPose, setRotation, setSilent, setSneaking, setTicksLived, setVelocity, setVisibleByDefault, setVisualFire, spawnAt, spawnAt, spigot, teamDisplayName, teleport, teleport, teleport, teleport, teleport, teleport, teleportAsync, teleportAsync, wouldCollideUsingMethods inherited from interface io.papermc.paper.entity.FrictionalgetFrictionState, setFrictionStateMethods inherited from interface net.kyori.adventure.text.event.HoverEventSourceasHoverEventMethods inherited from interface org.bukkit.metadata.MetadatablegetMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface org.bukkit.NameablecustomName, customName, getCustomName, setCustomNameMethods inherited from interface org.bukkit.permissions.PermissibleaddAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, permissionValue, permissionValue, recalculatePermissions, removeAttachmentMethods inherited from interface org.bukkit.persistence.PersistentDataHoldergetPersistentDataContainerMethods inherited from interface net.kyori.adventure.pointer.Pointeredget, getOrDefault, getOrDefaultFrom, pointersMethods inherited from interface org.bukkit.permissions.ServerOperatorisOp, setOp
- 
Method Details- 
getItemStackGets the item stack associated with this item drop.- Returns:
- An item stack.
 
- 
setItemStackSets the item stack associated with this item drop.- Parameters:
- stack- An item stack.
 
- 
getPickupDelayint getPickupDelay()Gets the delay before this Item is available to be picked up by players- Returns:
- Remaining delay
 
- 
setPickupDelayvoid setPickupDelay(int delay) Sets the delay before this Item is available to be picked up by players- Parameters:
- delay- New delay
 
- 
setUnlimitedLifetimevoid setUnlimitedLifetime(boolean unlimited) Sets if this Item should live forever- Parameters:
- unlimited- true if the lifetime is unlimited
 
- 
isUnlimitedLifetimeboolean isUnlimitedLifetime()Gets if this Item lives forever- Returns:
- true if the lifetime is unlimited
 
- 
setOwnerSets 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
 
- 
getOwnerGet the owner of this item.- Returns:
- UUID of owner
 
- 
setThrowerSet 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
 
- 
getThrowerGet the thrower of this item. The thrower is the entity which dropped the item.- Returns:
- UUID of thrower
 
- 
canMobPickupboolean canMobPickup()Gets if non-player entities can pick this Item up- Returns:
- True if non-player entities can pickup
 
- 
setCanMobPickupvoid setCanMobPickup(boolean canMobPickup) Sets if non-player entities can pick this Item up- Parameters:
- canMobPickup- True to allow non-player entity pickup
 
- 
canPlayerPickupboolean canPlayerPickup()Gets whether the player can pickup the item or not- Returns:
- True if a player can pickup the item
 
- 
setCanPlayerPickupvoid setCanPlayerPickup(boolean canPlayerPickup) Sets whether the item can be picked up or not. Modifies the pickup delay value to do so.- Parameters:
- canPlayerPickup- True if the player can pickup the item
 
- 
willAgeboolean willAge()Gets whether the item will age and despawn from being on the ground too long- Returns:
- True if the item will age
 
- 
setWillAgevoid setWillAge(boolean willAge) Sets whether the item will age or not. If the item is not ageing, it will not despawn by being on the ground for too long.- Parameters:
- willAge- True if the item should age
 
- 
getHealthint getHealth()Gets the health of item stack.Currently the default max health is 5. - Returns:
- the health
 
- 
setHealthvoid setHealth(int health) Sets the health of the item stack. If the value is non-positive the itemstack's normal "on destroy" functionality will be run.Currently, the default max health is 5. - Parameters:
- health- the health, a non-positive value will destroy the entity
 
 
-