Package org.bukkit.entity

# Interface ExperienceOrb

All Superinterfaces:
  `Audience`, `CommandSender`, `Entity`, `HoverEventSource<HoverEvent.ShowEntity>`, `Metadatable`, `Nameable`, `Permissible`, `PersistentDataHolder`, `Pointered`, `ServerOperator`, `Sound.Emitter`

public interface ExperienceOrb extends Entity
Represents an Experience Orb.

## Nested Class Summary

Nested Classes
Modifier and Type
Interface
Description
`static enum`
`ExperienceOrb.SpawnReason`
Reasons for why this Experience Orb was spawned

## Nested classes/interfaces inherited from interface org.bukkit.entity.Entity

`Entity.Spigot`

## Method Summary

Modifier and Type
Method
Description
`int`
`getExperience()`
Gets how much experience is contained within this orb
`UUID`
`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.
`@NotNull ExperienceOrb.SpawnReason`
`getSpawnReason()`
Gets the reason that this experience orb was spawned.
`UUID`
`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.
`default boolean`
`isFromBottle()`
Deprecated.
Use getSpawnReason() == EXP_BOTTLE
`void`
`setExperience(int value)`
Sets how much experience is contained within this orb

### Methods inherited from interface net.kyori.adventure.audience.Audience

`clearTitle, 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, stopSound`

### Methods inherited from interface org.bukkit.command.CommandSender

`getName, name, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlainMessage, sendRichMessage`

### Methods inherited from interface org.bukkit.entity.Entity

`addPassenger, addScoreboardTag, asHoverEvent, collidesAt, eject, fromMobSpawner, getBoundingBox, getChunk, getEntityId, getEntitySpawnReason, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getSpawnCategory, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTicksLived, getTrackedPlayers, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isFreezeTickingLocked, isFrozen, isGlowing, isInBubbleColumn, isInLava, isInPowderedSnow, isInRain, isInsideVehicle, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isOnGround, isPersistent, isSilent, isTicking, isUnderWater, isValid, isVisualFire, leaveVehicle, lockFreezeTicks, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setTicksLived, setVelocity, setVisualFire, spawnAt, spawnAt, spigot, teamDisplayName, teleport, teleport, teleport, teleport, teleport, teleport, teleport, teleport, 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

### isFromBottle

@Deprecated default boolean isFromBottle()
Deprecated.
Use getSpawnReason() == EXP_BOTTLE
Check if this orb was spawned from a `ThrownExpBottle`

Returns:
  if orb was spawned from a bottle

### getTriggerEntityId

@Nullable UUID 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

@Nullable UUID 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

@NotNull @NotNull ExperienceOrb.SpawnReason 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.