Package org.bukkit.entity
Interface ExperienceOrb
- All Superinterfaces:
Audience
,CommandSender
,Entity
,HoverEventSource<HoverEvent.ShowEntity>
,Metadatable
,Nameable
,Permissible
,PersistentDataHolder
,PersistentDataViewHolder
,Pointered
,ServerOperator
,Sound.Emitter
Represents an Experience Orb.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Reasons for why this Experience Orb was spawnedNested classes/interfaces inherited from interface org.bukkit.entity.Entity
Entity.Spigot
-
Method Summary
Modifier and TypeMethodDescriptionint
getCount()
Get the stacked count for this experience orb.int
Gets how much experience is contained within this orbIf this experience orb was spawned in relation to another entity, such as a player or other living entity death, or breeding, return the source entity UUID.Gets the reason that this experience orb was spawned.If this experience orb was triggered to be spawned by an entity such as a player, due to events such as killing entity, breaking blocks, smelting in a furnace, etc, this will return the UUID of the entity that triggered this orb to drop.default boolean
Deprecated.Use getSpawnReason() == EXP_BOTTLEvoid
setCount
(int count) Sets the stacked count for this experience orb.void
setExperience
(int value) Sets how much experience is contained within this orbMethods inherited from interface net.kyori.adventure.audience.Audience
clearResourcePacks, clearTitle, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendResourcePacks, sendResourcePacks, sendResourcePacks, sendTitlePart, showBossBar, showTitle, stopSound, stopSound
Methods inherited from interface org.bukkit.command.CommandSender
getName, name, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlainMessage, sendRichMessage, sendRichMessage
Methods inherited from interface org.bukkit.entity.Entity
addPassenger, addScoreboardTag, asHoverEvent, broadcastHurtAnimation, collidesAt, copy, copy, createSnapshot, eject, fromMobSpawner, getAsString, getBoundingBox, getChunk, getEntityId, getEntitySpawnReason, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPistonMoveReaction, getPitch, getPortalCooldown, getPose, getRider, getScheduler, getScoreboardEntryName, getScoreboardTags, getServer, getSpawnCategory, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTicksLived, getTrackedBy, getTrackedPlayers, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, getX, getY, getYaw, getZ, hasFixedPose, hasGravity, hasNoPhysics, hasRider, isCustomNameVisible, isDead, isEmpty, isFreezeTickingLocked, isFrozen, isGlowing, isImmuneToFire, isInBubbleColumn, isInDaylight, isInLava, isInPowderedSnow, isInRain, isInsideVehicle, isInvisible, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isInWorld, isOnGround, isPersistent, isRidable, isRidableInWater, isSilent, isSneaking, isTicking, isUnderWater, isValid, isVisibleByDefault, isVisualFire, leaveVehicle, lockFreezeTicks, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setImmuneToFire, setInvisible, setInvulnerable, setLastDamageCause, setNoPhysics, setPassenger, setPersistent, setPortalCooldown, setPose, setPose, setRotation, setSilent, setSneaking, setTicksLived, setVelocity, setVisibleByDefault, setVisualFire, spawnAt, spawnAt, spigot, teamDisplayName, teleport, teleport, teleport, teleport, teleport, teleport, teleportAsync, teleportAsync, teleportAsync, wouldCollideUsing
Methods inherited from interface net.kyori.adventure.text.event.HoverEventSource
asHoverEvent
Methods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
Methods inherited from interface org.bukkit.Nameable
customName, customName, getCustomName, setCustomName
Methods inherited from interface org.bukkit.permissions.Permissible
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, permissionValue, permissionValue, recalculatePermissions, removeAttachment
Methods inherited from interface org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer
Methods inherited from interface net.kyori.adventure.pointer.Pointered
get, getOrDefault, getOrDefaultFrom, pointers
Methods inherited from interface org.bukkit.permissions.ServerOperator
isOp, setOp
-
Method Details
-
getExperience
int getExperience()Gets how much experience is contained within this orb- Returns:
- Amount of experience
-
setExperience
void setExperience(int value) Sets how much experience is contained within this orb- Parameters:
value
- Amount of experience
-
getCount
int getCount()Get the stacked count for this experience orb.- Returns:
- the count
-
setCount
void setCount(int count) Sets the stacked count for this experience orb.- Parameters:
count
- the new count
-
isFromBottle
Deprecated.Use getSpawnReason() == EXP_BOTTLECheck if this orb was spawned from aThrownExpBottle
- Returns:
- if orb was spawned from a bottle
-
getTriggerEntityId
If this experience orb was triggered to be spawned by an entity such as a player, due to events such as killing entity, breaking blocks, smelting in a furnace, etc, this will return the UUID of the entity that triggered this orb to drop. In the case of an entity being killed, this will be the killers UUID.- Returns:
- UUID of the player that triggered this orb to drop, or null if unknown/no triggering entity
-
getSourceEntityId
If this experience orb was spawned in relation to another entity, such as a player or other living entity death, or breeding, return the source entity UUID. In the case of breeding, this will be the new baby entities UUID. In the case of an entity being killed, this will be the dead entities UUID.- Returns:
- The UUID of the entity that sourced this experience orb
-
getSpawnReason
Gets the reason that this experience orb was spawned. For any case that we do not know, such as orbs spawned before this API was added, UNKNOWN is returned.- Returns:
- The reason for this orb being spawned.
-