Package org.bukkit.entity
Interface ExperienceOrb
- All Superinterfaces:
Audience
,CommandSender
,Entity
,HoverEventSource<HoverEvent.ShowEntity>
,Metadatable
,Nameable
,Permissible
,PersistentDataHolder
,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
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
setExperience
(int value) Sets how much experience is contained within this orbMethods inherited from interface net.kyori.adventure.audience.Audience
clearTitle, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, resetTitle, sendActionBar, sendActionBar, 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
Methods inherited from interface org.bukkit.entity.Entity
addPassenger, addScoreboardTag, asHoverEvent, 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, 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, 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, teleportAsync, teleportAsync
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.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.
-