Interface Player
- All Superinterfaces:
- AnimalTamer,- Attributable,- CommandSender,- ConfigurationSerializable,- Conversable,- Damageable,- Entity,- HumanEntity,- InventoryHolder,- LivingEntity,- Metadatable,- Nameable,- OfflinePlayer,- Permissible,- PersistentDataHolder,- PluginMessageRecipient,- ProjectileSource,- ServerOperator
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddCustomChatCompletions(Collection<String> completions) Add custom chat completion suggestions shown to the player while typing a message.voidaddResourcePack(UUID id, String url, byte[] hash, String prompt, boolean force) Request that the player's client download and include another resource pack.Adds this user to theProfileBanList.Adds this user to theProfileBanList.Adds this user to theProfileBanList.Adds this user's current IP address to theIpBanList.Adds this user's current IP address to theIpBanList.Adds this user's current IP address to theIpBanList.booleanbreakBlock(Block block) Force this player to break a Block using the item in their main hand.booleanChecks to see if an entity has been visually hidden from this player.booleanChecks to see if a player has been hidden from this playervoidSays a message (or runs a command).Gets the socket address of this playergetAdvancementProgress(Advancement advancement) Return the player's progression on the specified advancement.booleanDetermines if the Player is allowed to fly via jump key double-tap like in creative mode.Deprecated.Misleading name.intGet the player's current client side view distance.Get the previously set compass target.Gets the current movement input, as last provided by the player.Gets the "friendly" name to display of this player.Gets the ender pearls currently associated with this entity.floatgetExp()Gets the players current experience points towards the next level.intGets the player's cooldown between picking up experience orbs.floatGets the current allowed speed that a client can fly.doubleGets the number that health is scaled to for the client.intgetLevel()Gets the players current experience levelGets the player's current locale.getName()Returns the name of this playerintgetPing()Gets the player's estimated ping in milliseconds.Gets the currently displayed player list footer for this player.Gets the currently displayed player list header for this player.Gets the name that is shown on the player list.intGets the relative order that the player is shown on the player list.longReturns the player's current timestamp.longReturns the player's current time offset relative to server time, or the current player's fixed time if the player's time is absolute.Returns the type of weather the player is currently experiencing.Gets this player's previousGameModeGets the Location where the player will spawn at, null if they don't have a valid respawn point.Gets the Scoreboard displayed to this playerGets the entity which is followed by the camera when inGameMode.SPECTATOR.intGets the players total experience points.floatGets the current allowed speed that a client can walk.Gets theWorldBordervisible to this Player, or null if viewing the world's world border.voidgiveExp(int amount) Gives the player the amount of experience specified.voidgiveExpLevels(int amount) Gives the player the amount of experience levels specified.voidhideEntity(Plugin plugin, Entity entity) Visually hides an entity from this player.voidhidePlayer(Player player) Deprecated.voidhidePlayer(Plugin plugin, Player player) Hides a player from this playerbooleanGets whether the player has the "Allow Server Listings" setting enabled.booleanisFlying()Checks to see if this player is currently flying or not.booleanGets if the client is displayed a 'scaled' health, that is, health on a scale from 0-getHealthScale().booleanDeprecated.This value is controlled only by the client and is therefore unreliable and vulnerable to spoofing and/or desync depending on the context/time which it is accessedbooleanReturns true if the player's time is relative to the server time, otherwise the player's time is absolute and will not change its current time unless done so with setPlayerTime().booleanReturns whether the player is sleeping ignored.booleanReturns if the player is in sneak modebooleanGets whether the player is sprinting or not.booleanGets if this connection has been transferred from another server.voidkickPlayer(String message) Kicks player with custom kick message.voidloadData()Loads the players current location, health, inventory, motion, and other information from the uuid.dat file, in the <main world>/playerdata folder.voidOpen aMaterial.WRITTEN_BOOKfor a PlayervoidOpen a Sign for editing by the Player.voidOpen a Sign for editing by the Player.booleanperformCommand(String command) Makes the player perform the given commandvoidplayEffect(Location loc, Effect effect, int data) Deprecated.Magic value<T> voidplayEffect(Location loc, Effect effect, T data) Plays an effect to just this player.voidDeprecated.Magic valuevoidplayNote(Location loc, Instrument instrument, Note note) Play a note for the player at a location.voidPlay a sound for a player at the location of the entity.voidplaySound(Entity entity, String sound, SoundCategory category, float volume, float pitch) Play a sound for a player at the location of the entity.voidplaySound(Entity entity, String sound, SoundCategory category, float volume, float pitch, long seed) Play a sound for a player at the location of the entity.voidPlay a sound for a player at the location of the entity.voidplaySound(Entity entity, Sound sound, SoundCategory category, float volume, float pitch) Play a sound for a player at the location of the entity.voidplaySound(Entity entity, Sound sound, SoundCategory category, float volume, float pitch, long seed) Play a sound for a player at the location of the entity.voidPlay a sound for a player at the location.voidplaySound(Location location, String sound, SoundCategory category, float volume, float pitch) Play a sound for a player at the location.voidplaySound(Location location, String sound, SoundCategory category, float volume, float pitch, long seed) Play a sound for a player at the location.voidPlay a sound for a player at the location.voidplaySound(Location location, Sound sound, SoundCategory category, float volume, float pitch) Play a sound for a player at the location.voidplaySound(Location location, Sound sound, SoundCategory category, float volume, float pitch, long seed) Play a sound for a player at the location.voidremoveCustomChatCompletions(Collection<String> completions) Remove custom chat completion suggestions shown to the player while typing a message.voidRequest that the player's client remove a resource pack sent by the server.voidRequest that the player's client remove all loaded resource pack sent by the server.voidRestores the normal condition where the player's time is synchronized with the server time.voidRestores the normal condition where the player's weather is controlled by server conditions.voidResets the title displayed to the player.CompletableFuture<byte[]> Retrieves a cookie from this player.voidsaveData()Saves the players current location, health, inventory, motion, and other information into the uuid.dat file, in the <main world>/playerdata folder.voidsendBlockChange(Location loc, BlockData block) Send a block change.voidsendBlockChange(Location loc, Material material, byte data) Deprecated.Magic valuevoidsendBlockChanges(Collection<BlockState> blocks) Send a multi-block change.voidsendBlockChanges(Collection<BlockState> blocks, boolean suppressLightUpdates) Deprecated.suppressLightUpdates is not functional in versions greater than 1.19.4voidsendBlockDamage(Location loc, float progress) Send block damage.voidsendBlockDamage(Location loc, float progress, int sourceId) Send block damage.voidsendBlockDamage(Location loc, float progress, Entity source) Send block damage.voidsendBlockUpdate(Location loc, TileState tileState) Send a TileState change.voidsendEquipmentChange(LivingEntity entity, Map<EquipmentSlot, ItemStack> items) Send multiple equipment changes for the target entity.voidsendEquipmentChange(LivingEntity entity, EquipmentSlot slot, ItemStack item) Send an equipment change for the target entity.voidsendExperienceChange(float progress) Send an experience change.voidsendExperienceChange(float progress, int level) Send an experience change.voidSend a health update to the player using its known server values.voidsendHealthUpdate(double health, int foodLevel, float saturation) Send a health update to the player.voidsendHurtAnimation(float yaw) Send a hurt animation.voidsendLinks(ServerLinks links) Sends the given server links to the player.voidRender a map and send it to the player in its entirety.voidsendPotionEffectChange(LivingEntity entity, PotionEffect effect) Change a potion effect for the target entity.voidsendPotionEffectChangeRemove(LivingEntity entity, PotionEffectType type) Remove a potion effect for the target entity.voidsendRawMessage(String message) Sends this sender a message rawvoidsendSignChange(Location loc, String[] lines) Send a sign change.voidsendSignChange(Location loc, String[] lines, DyeColor dyeColor) Send a sign change.voidsendSignChange(Location loc, String[] lines, DyeColor dyeColor, boolean hasGlowingText) Send a sign change.voidDeprecated.API behavior subject to changevoidSends a title and a subtitle message to the player.voidsetAllowFlight(boolean flight) Sets if the Player is allowed to fly via jump key double-tap like in creative mode.voidsetBedSpawnLocation(Location location) Deprecated.Misleading name.voidsetBedSpawnLocation(Location location, boolean force) Deprecated.Misleading name.voidsetCompassTarget(Location loc) Set the target of the player's compass.voidsetCustomChatCompletions(Collection<String> completions) Set the list of chat completion suggestions shown to the player while typing a message.voidsetDisplayName(String name) Sets the "friendly" name to display of this player.voidsetExp(float exp) Sets the players current experience points towards the next levelvoidsetExpCooldown(int ticks) Sets the player's cooldown between picking up experience orbs..voidsetFlying(boolean value) Makes this player start or stop flying.voidsetFlySpeed(float value) Sets the speed at which a client will fly.voidsetHealthScale(double scale) Sets the number to scale health to for the client; this will alsosetHealthScaled(true).voidsetHealthScaled(boolean scale) Sets if the client is displayed a 'scaled' health, that is, health on a scale from 0-getHealthScale().voidsetLevel(int level) Sets the players current experience levelvoidsetPlayerListFooter(String footer) Sets the currently displayed player list footer for this player.voidsetPlayerListHeader(String header) Sets the currently displayed player list header for this player.voidsetPlayerListHeaderFooter(String header, String footer) Sets the currently displayed player list header and footer for this player.voidsetPlayerListName(String name) Sets the name that is shown on the in-game player list.voidsetPlayerListOrder(int order) Sets the relative order that the player is shown on the in-game player list.voidsetPlayerTime(long time, boolean relative) Sets the current time on the player's client.voidsetPlayerWeather(WeatherType type) Sets the type of weather the player will see.voidsetResourcePack(String url) Request that the player's client download and switch resource packs.voidsetResourcePack(String url, byte[] hash) Request that the player's client download and switch resource packs.voidsetResourcePack(String url, byte[] hash, boolean force) Request that the player's client download and switch resource packs.voidsetResourcePack(String url, byte[] hash, String prompt) Request that the player's client download and switch resource packs.voidsetResourcePack(String url, byte[] hash, String prompt, boolean force) Request that the player's client download and switch resource packs.voidsetResourcePack(UUID id, String url, byte[] hash, String prompt, boolean force) Request that the player's client download and switch resource packs.voidsetRespawnLocation(Location location) Sets the Location where the player will respawn.voidsetRespawnLocation(Location location, boolean force) Sets the Location where the player will respawn.voidsetScoreboard(Scoreboard scoreboard) Sets the player's visible Scoreboard.voidsetSleepingIgnored(boolean isSleeping) Sets whether the player is ignored as not sleeping.voidsetSneaking(boolean sneak) Sets the sneak mode the playervoidsetSpectatorTarget(Entity entity) Sets the entity which is followed by the camera when inGameMode.SPECTATOR.voidsetSprinting(boolean sprinting) Sets whether the player is sprinting or not.voidsetTexturePack(String url) Deprecated.Minecraft no longer uses textures packs.voidsetTotalExperience(int exp) Sets the players current experience points.voidsetWalkSpeed(float value) Sets the speed at which a client will walk.voidsetWorldBorder(WorldBorder border) Sets theWorldBordervisible to this Player.voidShows the demo screen to the player, this screen is normally only seen in the demo version of the game.voidshowEntity(Plugin plugin, Entity entity) Allows this player to see an entity that was previously hidden.voidshowPlayer(Player player) Deprecated.voidshowPlayer(Plugin plugin, Player player) Allows this player to see a player that was previously hidden.voidspawnParticle(Particle particle, double x, double y, double z, int count) Spawns the particle (the number of times specified by count) at the target location.voidspawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) Spawns the particle (the number of times specified by count) at the target location.voidspawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) Spawns the particle (the number of times specified by count) at the target location.<T> voidspawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) Spawns the particle (the number of times specified by count) at the target location.<T> voidspawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) Spawns the particle (the number of times specified by count) at the target location.<T> voidspawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data) Spawns the particle (the number of times specified by count) at the target location.<T> voidspawnParticle(Particle particle, double x, double y, double z, int count, T data) Spawns the particle (the number of times specified by count) at the target location.voidspawnParticle(Particle particle, Location location, int count) Spawns the particle (the number of times specified by count) at the target location.voidspawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ) Spawns the particle (the number of times specified by count) at the target location.voidspawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra) Spawns the particle (the number of times specified by count) at the target location.<T> voidspawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) Spawns the particle (the number of times specified by count) at the target location.<T> voidspawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) Spawns the particle (the number of times specified by count) at the target location.<T> voidspawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data) Spawns the particle (the number of times specified by count) at the target location.<T> voidspawnParticle(Particle particle, Location location, int count, T data) Spawns the particle (the number of times specified by count) at the target location.spigot()voidStop all sounds from playing.voidStop the specified sound from playing.voidstopSound(String sound, SoundCategory category) Stop the specified sound from playing.voidStop the specified sound from playing.voidstopSound(SoundCategory category) Stop the specified sound category from playing.voidstopSound(Sound sound, SoundCategory category) Stop the specified sound from playing.voidstoreCookie(NamespacedKey key, byte[] value) Stores a cookie in this player's client.voidRequests this player to connect to a different server specified by host and port.voidUpdate the list of commands sent to the client.voidForces an update of the player's entire inventory.Methods inherited from interface org.bukkit.attribute.AttributablegetAttributeMethods inherited from interface org.bukkit.command.CommandSendersendMessage, sendMessage, sendMessage, sendMessageMethods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializableserializeMethods inherited from interface org.bukkit.conversations.ConversableabandonConversation, abandonConversation, acceptConversationInput, beginConversation, isConversing, sendRawMessageMethods inherited from interface org.bukkit.entity.Damageabledamage, damage, damage, getAbsorptionAmount, getHealth, getMaxHealth, resetMaxHealth, setAbsorptionAmount, setHealth, setMaxHealthMethods inherited from interface org.bukkit.entity.EntityaddPassenger, 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, 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, teleport, teleport, teleport, teleportMethods inherited from interface org.bukkit.entity.HumanEntitycloseInventory, discoverRecipe, discoverRecipes, dropItem, fireworkBoost, getAttackCooldown, getBedLocation, getCooldown, getCooldown, getDiscoveredRecipes, getEnchantmentSeed, getEnderChest, getExhaustion, getExpToLevel, getFoodLevel, getGameMode, getInventory, getItemInHand, getItemOnCursor, getLastDeathLocation, getMainHand, getOpenInventory, getSaturatedRegenRate, getSaturation, getShoulderEntityLeft, getShoulderEntityRight, getSleepTicks, getStarvationRate, getUnsaturatedRegenRate, hasCooldown, hasCooldown, hasDiscoveredRecipe, isBlocking, isHandRaised, openEnchanting, openInventory, openInventory, openMerchant, openMerchant, openWorkbench, setCooldown, setCooldown, setEnchantmentSeed, setExhaustion, setFoodLevel, setGameMode, setItemInHand, setItemOnCursor, setLastDeathLocation, setSaturatedRegenRate, setSaturation, setShoulderEntityLeft, setShoulderEntityRight, setStarvationRate, setUnsaturatedRegenRate, setWindowProperty, sleep, startRiptideAttack, undiscoverRecipe, undiscoverRecipes, wakeupMethods inherited from interface org.bukkit.entity.LivingEntityaddPotionEffect, addPotionEffect, addPotionEffects, attack, canBreatheUnderwater, getActivePotionEffects, getArrowCooldown, getArrowsInBody, getCanPickupItems, getCategory, getCollidableExemptions, getDeathSound, getDrinkingSound, getEatingSound, getEquipment, getEyeHeight, getEyeHeight, getEyeLocation, getFallDamageSound, getFallDamageSoundBig, getFallDamageSoundSmall, getHurtSound, getItemInUse, getItemInUseTicks, getKiller, getLastDamage, getLastTwoTargetBlocks, getLeashHolder, getLineOfSight, getMaximumAir, getMaximumNoDamageTicks, getMemory, getNoActionTicks, getNoDamageTicks, getPotionEffect, getRemainingAir, getRemoveWhenFarAway, getTargetBlock, getTargetBlockExact, getTargetBlockExact, hasAI, hasLineOfSight, hasPotionEffect, isClimbing, isCollidable, isGliding, isInvisible, isLeashed, isRiptiding, isSleeping, isSwimming, playHurtAnimation, rayTraceBlocks, rayTraceBlocks, removePotionEffect, setAI, setArrowCooldown, setArrowsInBody, setCanPickupItems, setCollidable, setGliding, setInvisible, setItemInUseTicks, setLastDamage, setLeashHolder, setMaximumAir, setMaximumNoDamageTicks, setMemory, setNoActionTicks, setNoDamageTicks, setRemainingAir, setRemoveWhenFarAway, setRiptiding, setSwimming, swingMainHand, swingOffHandMethods inherited from interface org.bukkit.metadata.MetadatablegetMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface org.bukkit.NameablegetCustomName, setCustomNameMethods inherited from interface org.bukkit.OfflinePlayerban, ban, ban, decrementStatistic, decrementStatistic, decrementStatistic, decrementStatistic, decrementStatistic, decrementStatistic, getFirstPlayed, getLastDeathLocation, getLastPlayed, getLocation, getPlayer, getPlayerProfile, getStatistic, getStatistic, getStatistic, getUniqueId, hasPlayedBefore, incrementStatistic, incrementStatistic, incrementStatistic, incrementStatistic, incrementStatistic, incrementStatistic, isBanned, isOnline, isWhitelisted, setStatistic, setStatistic, setStatistic, setWhitelistedMethods inherited from interface org.bukkit.permissions.PermissibleaddAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachmentMethods inherited from interface org.bukkit.persistence.PersistentDataHoldergetPersistentDataContainerMethods inherited from interface org.bukkit.plugin.messaging.PluginMessageRecipientgetListeningPluginChannels, sendPluginMessageMethods inherited from interface org.bukkit.projectiles.ProjectileSourcelaunchProjectile, launchProjectileMethods inherited from interface org.bukkit.permissions.ServerOperatorisOp, setOp
- 
Method Details- 
getNameReturns the name of this player- Specified by:
- getNamein interface- AnimalTamer
- Specified by:
- getNamein interface- CommandSender
- Specified by:
- getNamein interface- HumanEntity
- Specified by:
- getNamein interface- OfflinePlayer
- Returns:
- Player name
 
- 
getDisplayNameGets the "friendly" name to display of this player. This may include color.Note that this name will not be displayed in game, only in chat and places defined by plugins. - Returns:
- the friendly name
 
- 
setDisplayNameSets the "friendly" name to display of this player. This may include color.Note that this name will not be displayed in game, only in chat and places defined by plugins. - Parameters:
- name- The new display name.
 
- 
getPlayerListNameGets the name that is shown on the player list.- Returns:
- the player list name
 
- 
setPlayerListNameSets the name that is shown on the in-game player list.If the value is null, the name will be identical to getName().- Parameters:
- name- new player list name
 
- 
getPlayerListOrderint getPlayerListOrder()Gets the relative order that the player is shown on the player list.- Returns:
- the player list order
 
- 
setPlayerListOrdervoid setPlayerListOrder(int order) Sets the relative order that the player is shown on the in-game player list.- Parameters:
- order- new player list order, must be positive
 
- 
getPlayerListHeaderGets the currently displayed player list header for this player.- Returns:
- player list header or null
 
- 
setPlayerListHeaderSets the currently displayed player list header for this player.- Parameters:
- header- player list header, null for empty
 
- 
setCompassTargetSet the target of the player's compass.- Parameters:
- loc- Location to point to
 
- 
getCompassTargetGet the previously set compass target.- Returns:
- location of the target
 
- 
getAddressGets the socket address of this player- Returns:
- the player's address
 
- 
isTransferredboolean isTransferred()Gets if this connection has been transferred from another server.- Returns:
- true if the connection has been transferred
 
- 
retrieveCookieRetrieves a cookie from this player.- Parameters:
- key- the key identifying the cookie cookie
- Returns:
- a CompletableFuturethat will be completed when the Cookie response is received or otherwise available. If the cookie is not set in the client, theCompletableFuturewill complete with a null value.
 
- 
storeCookieStores a cookie in this player's client.- Parameters:
- key- the key identifying the cookie cookie
- value- the data to store in the cookie
- Throws:
- IllegalStateException- if a cookie cannot be stored at this time
 
- 
transferRequests this player to connect to a different server specified by host and port.- Parameters:
- host- the host of the server to transfer to
- port- the port of the server to transfer to
- Throws:
- IllegalStateException- if a transfer cannot take place at this time
 
- 
sendRawMessageSends this sender a message raw- Specified by:
- sendRawMessagein interface- Conversable
- Parameters:
- message- Message to be displayed
 
- 
kickPlayerKicks player with custom kick message.- Parameters:
- message- kick message
 
- 
ban@Nullable BanEntry<PlayerProfile> ban(@Nullable String reason, @Nullable Date expires, @Nullable String source, boolean kickPlayer) Adds this user to theProfileBanList. If a previous ban exists, this will update the entry.- Parameters:
- reason- reason for the ban, null indicates implementation default
- expires- date for the ban's expiration (unban), or null to imply forever
- source- source of the ban, null indicates implementation default
- kickPlayer- if the player need to be kick
- Returns:
- the entry for the newly created ban, or the entry for the (updated) previous ban
 
- 
ban@Nullable BanEntry<PlayerProfile> ban(@Nullable String reason, @Nullable Instant expires, @Nullable String source, boolean kickPlayer) Adds this user to theProfileBanList. If a previous ban exists, this will update the entry.- Parameters:
- reason- reason for the ban, null indicates implementation default
- expires- date for the ban's expiration (unban), or null to imply forever
- source- source of the ban, null indicates implementation default
- kickPlayer- if the player need to be kick
- Returns:
- the entry for the newly created ban, or the entry for the (updated) previous ban
 
- 
ban@Nullable BanEntry<PlayerProfile> ban(@Nullable String reason, @Nullable Duration duration, @Nullable String source, boolean kickPlayer) Adds this user to theProfileBanList. If a previous ban exists, this will update the entry.- Parameters:
- reason- reason for the ban, null indicates implementation default
- duration- the duration how long the ban lasts, or null to imply forever
- source- source of the ban, null indicates implementation default
- kickPlayer- if the player need to be kick
- Returns:
- the entry for the newly created ban, or the entry for the (updated) previous ban
 
- 
banIp@Nullable BanEntry<InetAddress> banIp(@Nullable String reason, @Nullable Date expires, @Nullable String source, boolean kickPlayer) Adds this user's current IP address to theIpBanList. If a previous ban exists, this will update the entry. IfgetAddress()is null this method will throw an exception.- Parameters:
- reason- reason for the ban, null indicates implementation default
- expires- date for the ban's expiration (unban), or null to imply forever
- source- source of the ban, null indicates implementation default
- kickPlayer- if the player need to be kick
- Returns:
- the entry for the newly created ban, or the entry for the (updated) previous ban
 
- 
banIp@Nullable BanEntry<InetAddress> banIp(@Nullable String reason, @Nullable Instant expires, @Nullable String source, boolean kickPlayer) Adds this user's current IP address to theIpBanList. If a previous ban exists, this will update the entry. IfgetAddress()is null this method will throw an exception.- Parameters:
- reason- reason for the ban, null indicates implementation default
- expires- date for the ban's expiration (unban), or null to imply forever
- source- source of the ban, null indicates implementation default
- kickPlayer- if the player need to be kick
- Returns:
- the entry for the newly created ban, or the entry for the (updated) previous ban
 
- 
banIp@Nullable BanEntry<InetAddress> banIp(@Nullable String reason, @Nullable Duration duration, @Nullable String source, boolean kickPlayer) Adds this user's current IP address to theIpBanList. If a previous ban exists, this will update the entry. IfgetAddress()is null this method will throw an exception.- Parameters:
- reason- reason for the ban, null indicates implementation default
- duration- the duration how long the ban lasts, or null to imply forever
- source- source of the ban, null indicates implementation default
- kickPlayer- if the player need to be kick
- Returns:
- the entry for the newly created ban, or the entry for the (updated) previous ban
 
- 
chatSays a message (or runs a command).- Parameters:
- msg- message to print
 
- 
performCommandMakes the player perform the given command- Parameters:
- command- Command to perform
- Returns:
- true if the command was successful, otherwise false
 
- 
isOnGroundDeprecated.This value is controlled only by the client and is therefore unreliable and vulnerable to spoofing and/or desync depending on the context/time which it is accessedReturns true if the entity is supported by a block. This value is a state updated by the client after each movement.- Specified by:
- isOnGroundin interface- Entity
- Returns:
- True if entity is on ground.
- See Also:
 
- 
isSneakingboolean isSneaking()Returns if the player is in sneak mode- Returns:
- true if player is in sneak mode
 
- 
setSneakingvoid setSneaking(boolean sneak) Sets the sneak mode the player- Parameters:
- sneak- true if player should appear sneaking
 
- 
isSprintingboolean isSprinting()Gets whether the player is sprinting or not.- Returns:
- true if player is sprinting.
 
- 
setSprintingvoid setSprinting(boolean sprinting) Sets whether the player is sprinting or not.- Parameters:
- sprinting- true if the player should be sprinting
 
- 
saveDatavoid saveData()Saves the players current location, health, inventory, motion, and other information into the uuid.dat file, in the <main world>/playerdata folder.
- 
loadDatavoid loadData()Loads the players current location, health, inventory, motion, and other information from the uuid.dat file, in the <main world>/playerdata folder.Note: This will overwrite the players current inventory, health, motion, etc, with the state from the saved dat file. 
- 
setSleepingIgnoredvoid setSleepingIgnored(boolean isSleeping) Sets whether the player is ignored as not sleeping. If everyone is either sleeping or has this flag set, then time will advance to the next day. If everyone has this flag set but no one is actually in bed, then nothing will happen.- Parameters:
- isSleeping- Whether to ignore.
 
- 
isSleepingIgnoredboolean isSleepingIgnored()Returns whether the player is sleeping ignored.- Returns:
- Whether player is ignoring sleep.
 
- 
getBedSpawnLocationDeprecated.Misleading name. This method also returns the location of respawn anchors.Gets the Location where the player will spawn at their bed, null if they have not slept in one or their current bed spawn is invalid.- Specified by:
- getBedSpawnLocationin interface- OfflinePlayer
- Returns:
- Bed Spawn Location if bed exists, otherwise null.
- See Also:
 
- 
getRespawnLocationGets the Location where the player will spawn at, null if they don't have a valid respawn point.- Specified by:
- getRespawnLocationin interface- OfflinePlayer
- Returns:
- respawn location if exists, otherwise null.
 
- 
setBedSpawnLocationDeprecated.Misleading name. This method sets the player's respawn location more generally and is not limited to beds.Sets the Location where the player will spawn at their bed.- Parameters:
- location- where to set the respawn location
- See Also:
 
- 
setRespawnLocationSets the Location where the player will respawn.- Parameters:
- location- where to set the respawn location
 
- 
setBedSpawnLocationDeprecated.Misleading name. This method sets the player's respawn location more generally and is not limited to beds.Sets the Location where the player will spawn at their bed.- Parameters:
- location- where to set the respawn location
- force- whether to forcefully set the respawn location even if a valid bed is not present
- See Also:
 
- 
setRespawnLocationSets the Location where the player will respawn.- Parameters:
- location- where to set the respawn location
- force- whether to forcefully set the respawn location even if a valid respawn point is not present
 
- 
getEnderPearlsGets the ender pearls currently associated with this entity.The returned list will not be directly linked to the entity's current pearls, and no guarantees are made as to its mutability. - Returns:
- collection of entities corresponding to current pearls.
 
- 
getCurrentInputGets the current movement input, as last provided by the player.
 Note: that this may not always be consistent with the current movement of the player.- Returns:
- current input
 
- 
playNoteDeprecated.Magic valuePlay a note for the player at a location.
 This will work with cake.- Parameters:
- loc- The location to play the note
- instrument- The instrument ID.
- note- The note ID.
 
- 
playNotePlay a note for the player at a location.
 This will work with cake.This method will fail silently when called with Instrument.CUSTOM_HEAD.- Parameters:
- loc- The location to play the note
- instrument- The instrument
- note- The note
 
- 
playSoundPlay a sound for a player at the location.This function will fail silently if Location or Sound are null. - Parameters:
- location- The location to play the sound
- sound- The sound to play
- volume- The volume of the sound
- pitch- The pitch of the sound
 
- 
playSoundPlay a sound for a player at the location.This function will fail silently if Location or Sound are null. No sound will be heard by the player if their client does not have the respective sound for the value passed. - Parameters:
- location- The location to play the sound
- sound- The internal sound name to play
- volume- The volume of the sound
- pitch- The pitch of the sound
 
- 
playSoundvoid playSound(@NotNull Location location, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch) Play a sound for a player at the location.This function will fail silently if Location or Sound are null. - Parameters:
- location- The location to play the sound
- sound- The sound to play
- category- The category of the sound
- volume- The volume of the sound
- pitch- The pitch of the sound
 
- 
playSoundvoid playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch) Play a sound for a player at the location.This function will fail silently if Location or Sound are null. No sound will be heard by the player if their client does not have the respective sound for the value passed. - Parameters:
- location- The location to play the sound
- sound- The internal sound name to play
- category- The category of the sound
- volume- The volume of the sound
- pitch- The pitch of the sound
 
- 
playSoundvoid playSound(@NotNull Location location, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch, long seed) Play a sound for a player at the location. For sounds with multiple variations passing the same seed will always play the same variation.This function will fail silently if Location or Sound are null. - Parameters:
- location- The location to play the sound
- sound- The sound to play
- category- The category of the sound
- volume- The volume of the sound
- pitch- The pitch of the sound
- seed- The seed for the sound
 
- 
playSoundvoid playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch, long seed) Play a sound for a player at the location. For sounds with multiple variations passing the same seed will always play the same variation.This function will fail silently if Location or Sound are null. No sound will be heard by the player if their client does not have the respective sound for the value passed. - Parameters:
- location- The location to play the sound
- sound- The internal sound name to play
- category- The category of the sound
- volume- The volume of the sound
- pitch- The pitch of the sound
- seed- The seed for the sound
 
- 
playSoundPlay a sound for a player at the location of the entity.This function will fail silently if Entity or Sound are null. - Parameters:
- entity- The entity to play the sound
- sound- The sound to play
- volume- The volume of the sound
- pitch- The pitch of the sound
 
- 
playSoundPlay a sound for a player at the location of the entity.This function will fail silently if Entity or Sound are null. - Parameters:
- entity- The entity to play the sound
- sound- The sound to play
- volume- The volume of the sound
- pitch- The pitch of the sound
 
- 
playSoundvoid playSound(@NotNull Entity entity, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch) Play a sound for a player at the location of the entity.This function will fail silently if Entity or Sound are null. - Parameters:
- entity- The entity to play the sound
- sound- The sound to play
- category- The category of the sound
- volume- The volume of the sound
- pitch- The pitch of the sound
 
- 
playSoundvoid playSound(@NotNull Entity entity, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch) Play a sound for a player at the location of the entity.This function will fail silently if Entity or Sound are null. - Parameters:
- entity- The entity to play the sound
- sound- The sound to play
- category- The category of the sound
- volume- The volume of the sound
- pitch- The pitch of the sound
 
- 
playSoundvoid playSound(@NotNull Entity entity, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch, long seed) Play a sound for a player at the location of the entity. For sounds with multiple variations passing the same seed will always play the same variation.This function will fail silently if Entity or Sound are null. - Parameters:
- entity- The entity to play the sound
- sound- The sound to play
- category- The category of the sound
- volume- The volume of the sound
- pitch- The pitch of the sound
- seed- The seed for the sound
 
- 
playSoundvoid playSound(@NotNull Entity entity, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch, long seed) Play a sound for a player at the location of the entity. For sounds with multiple variations passing the same seed will always play the same variation.This function will fail silently if Entity or Sound are null. - Parameters:
- entity- The entity to play the sound
- sound- The sound to play
- category- The category of the sound
- volume- The volume of the sound
- pitch- The pitch of the sound
- seed- The seed for the sound
 
- 
stopSoundStop the specified sound from playing.- Parameters:
- sound- the sound to stop
 
- 
stopSoundStop the specified sound from playing.- Parameters:
- sound- the sound to stop
 
- 
stopSoundStop the specified sound from playing.- Parameters:
- sound- the sound to stop
- category- the category of the sound
 
- 
stopSoundStop the specified sound from playing.- Parameters:
- sound- the sound to stop
- category- the category of the sound
 
- 
stopSoundStop the specified sound category from playing.- Parameters:
- category- the sound category to stop
 
- 
stopAllSoundsvoid stopAllSounds()Stop all sounds from playing.
- 
playEffectDeprecated.Magic valuePlays an effect to just this player.- Parameters:
- loc- the location to play the effect at
- effect- the- Effect
- data- a data bit needed for some effects
 
- 
playEffectPlays an effect to just this player.- Type Parameters:
- T- the data based based on the type of the effect
- Parameters:
- loc- the location to play the effect at
- effect- the- Effect
- data- a data bit needed for some effects
 
- 
breakBlockForce this player to break a Block using the item in their main hand. This method will respect enchantments, handle item durability (if applicable) and drop experience and the correct items according to the tool/item in the player's hand.Note that this method will call a BlockBreakEvent, meaning that this method may not be successful in breaking the block if the event was cancelled by a third party plugin. Care should be taken if running this method in a BlockBreakEvent listener as recursion may be possible if it is invoked on the sameBlockbeing broken in the event.Additionally, a BlockDropItemEventis called for the items dropped by this method (if successful).The block must be in the same world as the player. - Parameters:
- block- the block to break
- Returns:
- true if the block was broken, false if the break failed
 
- 
sendBlockChange@Deprecated(since="1.6.2") void sendBlockChange(@NotNull Location loc, @NotNull Material material, byte data) Deprecated.Magic valueSend a block change. This fakes a block change packet for a user at a certain location. This will not actually change the world in any way.- Parameters:
- loc- The location of the changed block
- material- The new block
- data- The block data
 
- 
sendBlockChangeSend a block change. This fakes a block change packet for a user at a certain location. This will not actually change the world in any way.- Parameters:
- loc- The location of the changed block
- block- The new block
 
- 
sendBlockChangesSend a multi-block change. This fakes a block change packet for a user at multiple locations. This will not actually change the world in any way.This method may send multiple packets to the client depending on the blocks in the collection. A packet must be sent for each chunk section modified, meaning one packet for each 16x16x16 block area. Even if only one block is changed in two different chunk sections, two packets will be sent. Additionally, this method cannot guarantee the functionality of changes being sent to the player in chunks not loaded by the client. It is the responsibility of the caller to ensure that the client is within range of the changed blocks or to handle any side effects caused as a result. - Parameters:
- blocks- the block states to send to the player
 
- 
sendBlockChanges@Deprecated(since="1.20") void sendBlockChanges(@NotNull Collection<BlockState> blocks, boolean suppressLightUpdates) Deprecated.suppressLightUpdates is not functional in versions greater than 1.19.4Send a multi-block change. This fakes a block change packet for a user at multiple locations. This will not actually change the world in any way.This method may send multiple packets to the client depending on the blocks in the collection. A packet must be sent for each chunk section modified, meaning one packet for each 16x16x16 block area. Even if only one block is changed in two different chunk sections, two packets will be sent. Additionally, this method cannot guarantee the functionality of changes being sent to the player in chunks not loaded by the client. It is the responsibility of the caller to ensure that the client is within range of the changed blocks or to handle any side effects caused as a result. - Parameters:
- blocks- the block states to send to the player
- suppressLightUpdates- whether or not light updates should be suppressed when updating the blocks on the client
 
- 
sendBlockDamageSend block damage. This fakes block break progress at a certain location sourced by this player. This will not actually change the block's break progress in any way.- Parameters:
- loc- the location of the damaged block
- progress- the progress from 0.0 - 1.0 where 0 is no damage and 1.0 is the most damaged
 
- 
sendBlockDamageSend block damage. This fakes block break progress at a certain location sourced by the provided entity. This will not actually change the block's break progress in any way.At the same location for each unique damage source sent to the player, a separate damage overlay will be displayed with the given progress. This allows for block damage at different progress from multiple entities at once. - Parameters:
- loc- the location of the damaged block
- progress- the progress from 0.0 - 1.0 where 0 is no damage and 1.0 is the most damaged
- source- the entity to which the damage belongs
 
- 
sendBlockDamageSend block damage. This fakes block break progress at a certain location sourced by the provided entity id. This will not actually change the block's break progress in any way.At the same location for each unique damage source sent to the player, a separate damage overlay will be displayed with the given progress. This allows for block damage at different progress from multiple entities at once. - Parameters:
- loc- the location of the damaged block
- progress- the progress from 0.0 - 1.0 where 0 is no damage and 1.0 is the most damaged
- sourceId- the entity id of the entity to which the damage belongs. Can be an id that does not associate directly with an existing or loaded entity.
 
- 
sendEquipmentChangevoid sendEquipmentChange(@NotNull LivingEntity entity, @NotNull EquipmentSlot slot, @Nullable ItemStack item) Send an equipment change for the target entity. This will not actually change the entity's equipment in any way.- Parameters:
- entity- the entity whose equipment to change
- slot- the slot to change
- item- the item to which the slot should be changed, or null to set it to air
 
- 
sendEquipmentChangeSend multiple equipment changes for the target entity. This will not actually change the entity's equipment in any way.- Parameters:
- entity- the entity whose equipment to change
- items- the slots to change, where the values are the items to which the slot should be changed. null values will set the slot to air
 
- 
sendSignChangevoid sendSignChange(@NotNull Location loc, @Nullable String[] lines) throws IllegalArgumentException Send a sign change. This fakes a sign change packet for a user at a certain location. This will not actually change the world in any way. This method will use a sign at the location's block or a faked sign sent viasendBlockChange(org.bukkit.Location, org.bukkit.block.data.BlockData).If the client does not have a sign at the given location it will display an error message to the user. To change all attributes of a sign, including the back Side, use sendBlockUpdate(org.bukkit.Location, org.bukkit.block.TileState).- Parameters:
- loc- the location of the sign
- lines- the new text on the sign or null to clear it
- Throws:
- IllegalArgumentException- if location is null
- IllegalArgumentException- if lines is non-null and has a length less than 4
 
- 
sendSignChangevoid sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor) throws IllegalArgumentException Send a sign change. This fakes a sign change packet for a user at a certain location. This will not actually change the world in any way. This method will use a sign at the location's block or a faked sign sent viasendBlockChange(org.bukkit.Location, org.bukkit.block.data.BlockData).If the client does not have a sign at the given location it will display an error message to the user. To change all attributes of a sign, including the back Side, use sendBlockUpdate(org.bukkit.Location, org.bukkit.block.TileState).- Parameters:
- loc- the location of the sign
- lines- the new text on the sign or null to clear it
- dyeColor- the color of the sign
- Throws:
- IllegalArgumentException- if location is null
- IllegalArgumentException- if dyeColor is null
- IllegalArgumentException- if lines is non-null and has a length less than 4
 
- 
sendSignChangevoid sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor, boolean hasGlowingText) throws IllegalArgumentException Send a sign change. This fakes a sign change packet for a user at a certain location. This will not actually change the world in any way. This method will use a sign at the location's block or a faked sign sent viasendBlockChange(org.bukkit.Location, org.bukkit.block.data.BlockData).If the client does not have a sign at the given location it will display an error message to the user. To change all attributes of a sign, including the back Side, use sendBlockUpdate(org.bukkit.Location, org.bukkit.block.TileState).- Parameters:
- loc- the location of the sign
- lines- the new text on the sign or null to clear it
- dyeColor- the color of the sign
- hasGlowingText- if the sign's text should be glowing
- Throws:
- IllegalArgumentException- if location is null
- IllegalArgumentException- if dyeColor is null
- IllegalArgumentException- if lines is non-null and has a length less than 4
 
- 
sendBlockUpdate@Experimental void sendBlockUpdate(@NotNull Location loc, @NotNull TileState tileState) throws IllegalArgumentException Send a TileState change. This fakes a TileState change for a user at the given location. This will not actually change the world in any way. This method will use a TileState at the location's block or a faked TileState sent viasendBlockChange(org.bukkit.Location, org.bukkit.block.data.BlockData).If the client does not have an appropriate tile at the given location it may display an error message to the user. BlockData.createBlockState()can be used to create aBlockState.- Parameters:
- loc- the location of the sign
- tileState- the tile state
- Throws:
- IllegalArgumentException- if location is null
- IllegalArgumentException- if tileState is null
 
- 
sendPotionEffectChangeChange a potion effect for the target entity. This will not actually change the entity's potion effects in any way.Note: Sending an effect change to a player for themselves may cause unexpected behavior on the client. Effects sent this way will also not be removed when their timer reaches 0, they can be removed with sendPotionEffectChangeRemove(LivingEntity, PotionEffectType)- Parameters:
- entity- the entity whose potion effects to change
- effect- the effect to change
 
- 
sendPotionEffectChangeRemoveRemove a potion effect for the target entity. This will not actually change the entity's potion effects in any way.Note: Sending an effect change to a player for themselves may cause unexpected behavior on the client. - Parameters:
- entity- the entity whose potion effects to change
- type- the effect type to remove
 
- 
sendMapRender a map and send it to the player in its entirety. This may be used when streaming the map in the normal manner is not desirable.- Parameters:
- map- The map to be sent
 
- 
sendHurtAnimationvoid sendHurtAnimation(float yaw) Send a hurt animation. This fakes incoming damage towards the player from the given yaw relative to the player's direction.- Parameters:
- yaw- the yaw in degrees relative to the player's direction where 0 is in front of the player, 90 is to the right, 180 is behind, and 270 is to the left
 
- 
sendLinksSends the given server links to the player.- Parameters:
- links- links to send
 
- 
addCustomChatCompletionsAdd custom chat completion suggestions shown to the player while typing a message.- Parameters:
- completions- the completions to send
 
- 
removeCustomChatCompletionsRemove custom chat completion suggestions shown to the player while typing a message. Online player names cannot be removed with this method. This will affect only custom completions added byaddCustomChatCompletions(Collection)orsetCustomChatCompletions(Collection).- Parameters:
- completions- the completions to remove
 
- 
setCustomChatCompletionsSet the list of chat completion suggestions shown to the player while typing a message.If completions were set previously, this method will remove them all and replace them with the provided completions. - Parameters:
- completions- the completions to set
 
- 
updateInventory@Internal void updateInventory()Forces an update of the player's entire inventory.- API Note:
- It should not be necessary for plugins to use this method. If it is required for some reason, it is probably a bug.
 
- 
getPreviousGameModeGets this player's previousGameMode- Returns:
- Previous game mode or null
 
- 
setPlayerTimevoid setPlayerTime(long time, boolean relative) Sets the current time on the player's client. When relative is true the player's time will be kept synchronized to its world time with the specified offset.When using non relative time the player's time will stay fixed at the specified time parameter. It's up to the caller to continue updating the player's time. To restore player time to normal use resetPlayerTime(). - Parameters:
- time- The current player's perceived time or the player's time offset from the server time.
- relative- When true the player time is kept relative to its world time.
 
- 
getPlayerTimelong getPlayerTime()Returns the player's current timestamp.- Returns:
- The player's time
 
- 
getPlayerTimeOffsetlong getPlayerTimeOffset()Returns the player's current time offset relative to server time, or the current player's fixed time if the player's time is absolute.- Returns:
- The player's time
 
- 
isPlayerTimeRelativeboolean isPlayerTimeRelative()Returns true if the player's time is relative to the server time, otherwise the player's time is absolute and will not change its current time unless done so with setPlayerTime().- Returns:
- true if the player's time is relative to the server time.
 
- 
resetPlayerTimevoid resetPlayerTime()Restores the normal condition where the player's time is synchronized with the server time.Equivalent to calling setPlayerTime(0, true). 
- 
setPlayerWeatherSets the type of weather the player will see. When used, the weather status of the player is locked untilresetPlayerWeather()is used.- Parameters:
- type- The WeatherType enum type the player should experience
 
- 
getPlayerWeatherReturns the type of weather the player is currently experiencing.- Returns:
- The WeatherType that the player is currently experiencing or null if player is seeing server weather.
 
- 
resetPlayerWeathervoid resetPlayerWeather()Restores the normal condition where the player's weather is controlled by server conditions.
- 
getExpCooldownint getExpCooldown()Gets the player's cooldown between picking up experience orbs.- Returns:
- The cooldown in ticks
 
- 
setExpCooldownvoid setExpCooldown(int ticks) Sets the player's cooldown between picking up experience orbs.. Note: Setting this to 0 allows the player to pick up instantly, but setting this to a negative value will cause the player to be unable to pick up xp-orbs. Calling this Method will result inPlayerExpCooldownChangeEventbeing called.- Parameters:
- ticks- The cooldown in ticks
 
- 
giveExpvoid giveExp(int amount) Gives the player the amount of experience specified.- Parameters:
- amount- Exp amount to give
 
- 
giveExpLevelsvoid giveExpLevels(int amount) Gives the player the amount of experience levels specified. Levels can be taken by specifying a negative amount.- Parameters:
- amount- amount of experience levels to give or take
 
- 
getExpfloat getExp()Gets the players current experience points towards the next level.This is a percentage value. 0 is "no progress" and 1 is "next level". - Returns:
- Current experience points
 
- 
setExpvoid setExp(float exp) Sets the players current experience points towards the next levelThis is a percentage value. 0 is "no progress" and 1 is "next level". - Parameters:
- exp- New experience points
 
- 
getLevelint getLevel()Gets the players current experience level- Returns:
- Current experience level
 
- 
setLevelvoid setLevel(int level) Sets the players current experience level- Parameters:
- level- New experience level
 
- 
getTotalExperienceint getTotalExperience()Gets the players total experience points.
 This refers to the total amount of experience the player has collected over time and is not currently displayed to the client.- Returns:
- Current total experience points
 
- 
setTotalExperiencevoid setTotalExperience(int exp) Sets the players current experience points.
 This refers to the total amount of experience the player has collected over time and is not currently displayed to the client.- Parameters:
- exp- New total experience points
 
- 
sendExperienceChangevoid sendExperienceChange(float progress) Send an experience change. This fakes an experience change packet for a user. This will not actually change the experience points in any way.- Parameters:
- progress- Experience progress percentage (between 0.0 and 1.0)
- See Also:
 
- 
sendExperienceChangevoid sendExperienceChange(float progress, int level) Send an experience change. This fakes an experience change packet for a user. This will not actually change the experience points in any way.- Parameters:
- progress- New experience progress percentage (between 0.0 and 1.0)
- level- New experience level
- See Also:
 
- 
getAllowFlightboolean getAllowFlight()Determines if the Player is allowed to fly via jump key double-tap like in creative mode.- Returns:
- True if the player is allowed to fly.
 
- 
setAllowFlightvoid setAllowFlight(boolean flight) Sets if the Player is allowed to fly via jump key double-tap like in creative mode.- Parameters:
- flight- If flight should be allowed.
 
- 
hidePlayerDeprecated.Hides a player from this player- Parameters:
- player- Player to hide
 
- 
hidePlayerHides a player from this player- Parameters:
- plugin- Plugin that wants to hide the player
- player- Player to hide
 
- 
showPlayerDeprecated.Allows this player to see a player that was previously hidden- Parameters:
- player- Player to show
 
- 
showPlayerAllows this player to see a player that was previously hidden. If another another plugin had hidden the player too, then the player will remain hidden until the other plugin calls this method too.- Parameters:
- plugin- Plugin that wants to show the player
- player- Player to show
 
- 
canSeeChecks to see if a player has been hidden from this player- Parameters:
- player- Player to check
- Returns:
- True if the provided player is not being hidden from this player
 
- 
hideEntityVisually hides an entity from this player.- Parameters:
- plugin- Plugin that wants to hide the entity
- entity- Entity to hide
 
- 
showEntityAllows this player to see an entity that was previously hidden. If another another plugin had hidden the entity too, then the entity will remain hidden until the other plugin calls this method too.- Parameters:
- plugin- Plugin that wants to show the entity
- entity- Entity to show
 
- 
canSeeChecks to see if an entity has been visually hidden from this player.- Parameters:
- entity- Entity to check
- Returns:
- True if the provided entity is not being hidden from this player
 
- 
isFlyingboolean isFlying()Checks to see if this player is currently flying or not.- Returns:
- True if the player is flying, else false.
 
- 
setFlyingvoid setFlying(boolean value) Makes this player start or stop flying.- Parameters:
- value- True to fly.
 
- 
setFlySpeedSets the speed at which a client will fly. Negative values indicate reverse directions.- Parameters:
- value- The new speed, from -1 to 1.
- Throws:
- IllegalArgumentException- If new speed is less than -1 or greater than 1
 
- 
setWalkSpeedSets the speed at which a client will walk. Negative values indicate reverse directions.- Parameters:
- value- The new speed, from -1 to 1.
- Throws:
- IllegalArgumentException- If new speed is less than -1 or greater than 1
 
- 
getFlySpeedfloat getFlySpeed()Gets the current allowed speed that a client can fly.- Returns:
- The current allowed speed, from -1 to 1
 
- 
getWalkSpeedfloat getWalkSpeed()Gets the current allowed speed that a client can walk.- Returns:
- The current allowed speed, from -1 to 1
 
- 
setTexturePackDeprecated.Minecraft no longer uses textures packs. Instead you should usesetResourcePack(String).Request that the player's client download and switch texture packs.The player's client will download the new texture pack asynchronously in the background, and will automatically switch to it once the download is complete. If the client has downloaded and cached the same texture pack in the past, it will perform a file size check against the response content to determine if the texture pack has changed and needs to be downloaded again. When this request is sent for the very first time from a given server, the client will first display a confirmation GUI to the player before proceeding with the download. Notes: - Players can disable server textures on their client, in which
     case this method will have no affect on them. Use the
     PlayerResourcePackStatusEventto figure out whether or not the player loaded the pack!
- There is no concept of resetting texture packs back to default within Minecraft, so players will have to relog to do so or you have to send an empty pack.
- The request is send with "null" as the hash. This might result in newer versions not loading the pack correctly.
 - Parameters:
- url- The URL from which the client will download the texture pack. The string must contain only US-ASCII characters and should be encoded as per RFC 1738.
- Throws:
- IllegalArgumentException- Thrown if the URL is null.
- IllegalArgumentException- Thrown if the URL is too long.
 
- Players can disable server textures on their client, in which
     case this method will have no affect on them. Use the
     
- 
setResourcePackRequest that the player's client download and switch resource packs.The player's client will download the new resource pack asynchronously in the background, and will automatically switch to it once the download is complete. If the client has downloaded and cached the same resource pack in the past, it will perform a file size check against the response content to determine if the resource pack has changed and needs to be downloaded again. When this request is sent for the very first time from a given server, the client will first display a confirmation GUI to the player before proceeding with the download. Notes: - Players can disable server resources on their client, in which
     case this method will have no affect on them. Use the
     PlayerResourcePackStatusEventto figure out whether or not the player loaded the pack!
- There is no concept of resetting resource packs back to default within Minecraft, so players will have to relog to do so or you have to send an empty pack.
- The request is send with empty string as the hash. This might result in newer versions not loading the pack correctly.
 - Parameters:
- url- The URL from which the client will download the resource pack. The string must contain only US-ASCII characters and should be encoded as per RFC 1738.
- Throws:
- IllegalArgumentException- Thrown if the URL is null.
- IllegalArgumentException- Thrown if the URL is too long. The length restriction is an implementation specific arbitrary value.
 
- Players can disable server resources on their client, in which
     case this method will have no affect on them. Use the
     
- 
setResourcePackRequest that the player's client download and switch resource packs.The player's client will download the new resource pack asynchronously in the background, and will automatically switch to it once the download is complete. If the client has downloaded and cached a resource pack with the same hash in the past it will not download but directly apply the cached pack. If the hash is null and the client has downloaded and cached the same resource pack in the past, it will perform a file size check against the response content to determine if the resource pack has changed and needs to be downloaded again. When this request is sent for the very first time from a given server, the client will first display a confirmation GUI to the player before proceeding with the download. Notes: - Players can disable server resources on their client, in which
     case this method will have no affect on them. Use the
     PlayerResourcePackStatusEventto figure out whether or not the player loaded the pack!
- There is no concept of resetting resource packs back to default within Minecraft, so players will have to relog to do so or you have to send an empty pack.
- The request is sent with empty string as the hash when the hash is not provided. This might result in newer versions not loading the pack correctly.
 - Parameters:
- url- The URL from which the client will download the resource pack. The string must contain only US-ASCII characters and should be encoded as per RFC 1738.
- hash- The sha1 hash sum of the resource pack file which is used to apply a cached version of the pack directly without downloading if it is available. Hast to be 20 bytes long!
- Throws:
- IllegalArgumentException- Thrown if the URL is null.
- IllegalArgumentException- Thrown if the URL is too long. The length restriction is an implementation specific arbitrary value.
- IllegalArgumentException- Thrown if the hash is not 20 bytes long.
 
- Players can disable server resources on their client, in which
     case this method will have no affect on them. Use the
     
- 
setResourcePackRequest that the player's client download and switch resource packs.The player's client will download the new resource pack asynchronously in the background, and will automatically switch to it once the download is complete. If the client has downloaded and cached a resource pack with the same hash in the past it will not download but directly apply the cached pack. If the hash is null and the client has downloaded and cached the same resource pack in the past, it will perform a file size check against the response content to determine if the resource pack has changed and needs to be downloaded again. When this request is sent for the very first time from a given server, the client will first display a confirmation GUI to the player before proceeding with the download. Notes: - Players can disable server resources on their client, in which
     case this method will have no affect on them. Use the
     PlayerResourcePackStatusEventto figure out whether or not the player loaded the pack!
- To remove a resource pack you can use
     removeResourcePack(UUID)orremoveResourcePacks().
- The request is sent with empty string as the hash when the hash is not provided. This might result in newer versions not loading the pack correctly.
 - Parameters:
- url- The URL from which the client will download the resource pack. The string must contain only US-ASCII characters and should be encoded as per RFC 1738.
- hash- The sha1 hash sum of the resource pack file which is used to apply a cached version of the pack directly without downloading if it is available. Hast to be 20 bytes long!
- prompt- The optional custom prompt message to be shown to client.
- Throws:
- IllegalArgumentException- Thrown if the URL is null.
- IllegalArgumentException- Thrown if the URL is too long. The length restriction is an implementation specific arbitrary value.
- IllegalArgumentException- Thrown if the hash is not 20 bytes long.
 
- Players can disable server resources on their client, in which
     case this method will have no affect on them. Use the
     
- 
setResourcePackRequest that the player's client download and switch resource packs.The player's client will download the new resource pack asynchronously in the background, and will automatically switch to it once the download is complete. If the client has downloaded and cached a resource pack with the same hash in the past it will not download but directly apply the cached pack. If the hash is null and the client has downloaded and cached the same resource pack in the past, it will perform a file size check against the response content to determine if the resource pack has changed and needs to be downloaded again. When this request is sent for the very first time from a given server, the client will first display a confirmation GUI to the player before proceeding with the download. Notes: - Players can disable server resources on their client, in which
     case this method will have no affect on them. Use the
     PlayerResourcePackStatusEventto figure out whether or not the player loaded the pack!
- To remove a resource pack you can use
     removeResourcePack(UUID)orremoveResourcePacks().
- The request is sent with empty string as the hash when the hash is not provided. This might result in newer versions not loading the pack correctly.
 - Parameters:
- url- The URL from which the client will download the resource pack. The string must contain only US-ASCII characters and should be encoded as per RFC 1738.
- hash- The sha1 hash sum of the resource pack file which is used to apply a cached version of the pack directly without downloading if it is available. Hast to be 20 bytes long!
- force- If true, the client will be disconnected from the server when it declines to use the resource pack.
- Throws:
- IllegalArgumentException- Thrown if the URL is null.
- IllegalArgumentException- Thrown if the URL is too long. The length restriction is an implementation specific arbitrary value.
- IllegalArgumentException- Thrown if the hash is not 20 bytes long.
 
- Players can disable server resources on their client, in which
     case this method will have no affect on them. Use the
     
- 
setResourcePackvoid setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable String prompt, boolean force) Request that the player's client download and switch resource packs.The player's client will download the new resource pack asynchronously in the background, and will automatically switch to it once the download is complete. If the client has downloaded and cached a resource pack with the same hash in the past it will not download but directly apply the cached pack. If the hash is null and the client has downloaded and cached the same resource pack in the past, it will perform a file size check against the response content to determine if the resource pack has changed and needs to be downloaded again. When this request is sent for the very first time from a given server, the client will first display a confirmation GUI to the player before proceeding with the download. Notes: - Players can disable server resources on their client, in which
     case this method will have no affect on them. Use the
     PlayerResourcePackStatusEventto figure out whether or not the player loaded the pack!
- To remove a resource pack you can use
     removeResourcePack(UUID)orremoveResourcePacks().
- The request is sent with empty string as the hash when the hash is not provided. This might result in newer versions not loading the pack correctly.
 - Parameters:
- url- The URL from which the client will download the resource pack. The string must contain only US-ASCII characters and should be encoded as per RFC 1738.
- hash- The sha1 hash sum of the resource pack file which is used to apply a cached version of the pack directly without downloading if it is available. Hast to be 20 bytes long!
- prompt- The optional custom prompt message to be shown to client.
- force- If true, the client will be disconnected from the server when it declines to use the resource pack.
- Throws:
- IllegalArgumentException- Thrown if the URL is null.
- IllegalArgumentException- Thrown if the URL is too long. The length restriction is an implementation specific arbitrary value.
- IllegalArgumentException- Thrown if the hash is not 20 bytes long.
 
- Players can disable server resources on their client, in which
     case this method will have no affect on them. Use the
     
- 
setResourcePackvoid setResourcePack(@NotNull UUID id, @NotNull String url, @Nullable byte[] hash, @Nullable String prompt, boolean force) Request that the player's client download and switch resource packs.The player's client will download the new resource pack asynchronously in the background, and will automatically switch to it once the download is complete. If the client has downloaded and cached a resource pack with the same hash in the past it will not download but directly apply the cached pack. If the hash is null and the client has downloaded and cached the same resource pack in the past, it will perform a file size check against the response content to determine if the resource pack has changed and needs to be downloaded again. When this request is sent for the very first time from a given server, the client will first display a confirmation GUI to the player before proceeding with the download. Notes: - Players can disable server resources on their client, in which
     case this method will have no affect on them. Use the
     PlayerResourcePackStatusEventto figure out whether or not the player loaded the pack!
- To remove a resource pack you can use
     removeResourcePack(UUID)orremoveResourcePacks().
- The request is sent with empty string as the hash when the hash is not provided. This might result in newer versions not loading the pack correctly.
 - Parameters:
- id- Unique resource pack ID.
- url- The URL from which the client will download the resource pack. The string must contain only US-ASCII characters and should be encoded as per RFC 1738.
- hash- The sha1 hash sum of the resource pack file which is used to apply a cached version of the pack directly without downloading if it is available. Hast to be 20 bytes long!
- prompt- The optional custom prompt message to be shown to client.
- force- If true, the client will be disconnected from the server when it declines to use the resource pack.
- Throws:
- IllegalArgumentException- Thrown if the URL is null.
- IllegalArgumentException- Thrown if the URL is too long. The length restriction is an implementation specific arbitrary value.
- IllegalArgumentException- Thrown if the hash is not 20 bytes long.
 
- Players can disable server resources on their client, in which
     case this method will have no affect on them. Use the
     
- 
addResourcePackvoid addResourcePack(@NotNull UUID id, @NotNull String url, @Nullable byte[] hash, @Nullable String prompt, boolean force) Request that the player's client download and include another resource pack.The player's client will download the new resource pack asynchronously in the background, and will automatically add to it once the download is complete. If the client has downloaded and cached a resource pack with the same hash in the past it will not download but directly apply the cached pack. If the hash is null and the client has downloaded and cached the same resource pack in the past, it will perform a file size check against the response content to determine if the resource pack has changed and needs to be downloaded again. When this request is sent for the very first time from a given server, the client will first display a confirmation GUI to the player before proceeding with the download. Notes: - Players can disable server resources on their client, in which
     case this method will have no affect on them. Use the
     PlayerResourcePackStatusEventto figure out whether or not the player loaded the pack!
- To remove a resource pack you can use
     removeResourcePack(UUID)orremoveResourcePacks().
- The request is sent with empty string as the hash when the hash is not provided. This might result in newer versions not loading the pack correctly.
 - Parameters:
- id- Unique resource pack ID.
- url- The URL from which the client will download the resource pack. The string must contain only US-ASCII characters and should be encoded as per RFC 1738.
- hash- The sha1 hash sum of the resource pack file which is used to apply a cached version of the pack directly without downloading if it is available. Hast to be 20 bytes long!
- prompt- The optional custom prompt message to be shown to client.
- force- If true, the client will be disconnected from the server when it declines to use the resource pack.
- Throws:
- IllegalArgumentException- Thrown if the URL is null.
- IllegalArgumentException- Thrown if the URL is too long. The length restriction is an implementation specific arbitrary value.
- IllegalArgumentException- Thrown if the hash is not 20 bytes long.
 
- Players can disable server resources on their client, in which
     case this method will have no affect on them. Use the
     
- 
removeResourcePackRequest that the player's client remove a resource pack sent by the server.- Parameters:
- id- the id of the resource pack.
- Throws:
- IllegalArgumentException- If the ID is null.
 
- 
removeResourcePacksvoid removeResourcePacks()Request that the player's client remove all loaded resource pack sent by the server.
- 
getScoreboardGets the Scoreboard displayed to this player- Returns:
- The current scoreboard seen by this player
 
- 
setScoreboardvoid setScoreboard(@NotNull Scoreboard scoreboard) throws IllegalArgumentException, IllegalStateException Sets the player's visible Scoreboard.- Parameters:
- scoreboard- New Scoreboard for the player
- Throws:
- IllegalArgumentException- if scoreboard is null
- IllegalArgumentException- if scoreboard was not created by the- scoreboard manager
- IllegalStateException- if this is a player that is not logged yet or has logged out
 
- 
getWorldBorderGets theWorldBordervisible to this Player, or null if viewing the world's world border.- Returns:
- the player's world border
 
- 
setWorldBorderSets theWorldBordervisible to this Player.- Parameters:
- border- the border to set, or null to set to the world border of the player's current world
- Throws:
- UnsupportedOperationException- if setting the border to that of a world in which the player is not currently present.
- See Also:
 
- 
sendHealthUpdatevoid sendHealthUpdate(double health, int foodLevel, float saturation) Send a health update to the player. This will adjust the health, food, and saturation on the client and will not affect the player's actual values on the server. As soon as any of these values change on the server, changes sent by this method will no longer be visible.- Parameters:
- health- the health. If 0.0, the client will believe it is dead
- foodLevel- the food level
- saturation- the saturation
 
- 
sendHealthUpdatevoid sendHealthUpdate()Send a health update to the player using its known server values. This will synchronize the health, food, and saturation on the client and therefore may be useful when changing a player's maximum health attribute.
- 
isHealthScaledboolean isHealthScaled()Gets if the client is displayed a 'scaled' health, that is, health on a scale from 0-getHealthScale().- Returns:
- if client health display is scaled
- See Also:
 
- 
setHealthScaledvoid setHealthScaled(boolean scale) Sets if the client is displayed a 'scaled' health, that is, health on a scale from 0-getHealthScale().Displayed health follows a simple formula displayedHealth = getHealth() / getMaxHealth() * getHealthScale().- Parameters:
- scale- if the client health display is scaled
 
- 
setHealthScaleSets the number to scale health to for the client; this will alsosetHealthScaled(true).Displayed health follows a simple formula displayedHealth = getHealth() / getMaxHealth() * getHealthScale().- Parameters:
- scale- the number to scale health to
- Throws:
- IllegalArgumentException- if scale is <0
- IllegalArgumentException- if scale is- Double.NaN
- IllegalArgumentException- if scale is too high
 
- 
getHealthScaledouble getHealthScale()Gets the number that health is scaled to for the client.- Returns:
- the number that health would be scaled to for the client if HealthScaling is set to true
- See Also:
 
- 
getSpectatorTargetGets the entity which is followed by the camera when inGameMode.SPECTATOR.- Returns:
- the followed entity, or null if not in spectator mode or not following a specific entity.
 
- 
setSpectatorTargetSets the entity which is followed by the camera when inGameMode.SPECTATOR.- Parameters:
- entity- the entity to follow or null to reset
- Throws:
- IllegalStateException- if the player is not in- GameMode.SPECTATOR
 
- 
sendTitleDeprecated.API behavior subject to changeSends a title and a subtitle message to the player. If either of these values are null, they will not be sent and the display will remain unchanged. If they are empty strings, the display will be updated as such. If the strings contain a new line, only the first line will be sent. The titles will be displayed with the client's default timings.- Parameters:
- title- Title text
- subtitle- Subtitle text
 
- 
sendTitlevoid sendTitle(@Nullable String title, @Nullable String subtitle, int fadeIn, int stay, int fadeOut) Sends a title and a subtitle message to the player. If either of these values are null, they will not be sent and the display will remain unchanged. If they are empty strings, the display will be updated as such. If the strings contain a new line, only the first line will be sent. All timings values may take a value of -1 to indicate that they will use the last value sent (or the defaults if no title has been displayed).- Parameters:
- title- Title text
- subtitle- Subtitle text
- fadeIn- time in ticks for titles to fade in. Defaults to 10.
- stay- time in ticks for titles to stay. Defaults to 70.
- fadeOut- time in ticks for titles to fade out. Defaults to 20.
 
- 
resetTitlevoid resetTitle()Resets the title displayed to the player. This will clear the displayed title / subtitle and reset timings to their default values.
- 
spawnParticleSpawns the particle (the number of times specified by count) at the target location.- Parameters:
- particle- the particle to spawn
- location- the location to spawn at
- count- the number of particles
 
- 
spawnParticleSpawns the particle (the number of times specified by count) at the target location.- Parameters:
- particle- the particle to spawn
- x- the position on the x axis to spawn at
- y- the position on the y axis to spawn at
- z- the position on the z axis to spawn at
- count- the number of particles
 
- 
spawnParticle<T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, @Nullable T data) Spawns the particle (the number of times specified by count) at the target location.- Type Parameters:
- T- type of particle data (see- Particle.getDataType()
- Parameters:
- particle- the particle to spawn
- location- the location to spawn at
- count- the number of particles
- data- the data to use for the particle or null, the type of this depends on- Particle.getDataType()
 
- 
spawnParticle<T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, @Nullable T data) Spawns the particle (the number of times specified by count) at the target location.- Type Parameters:
- T- type of particle data (see- Particle.getDataType()
- Parameters:
- particle- the particle to spawn
- x- the position on the x axis to spawn at
- y- the position on the y axis to spawn at
- z- the position on the z axis to spawn at
- count- the number of particles
- data- the data to use for the particle or null, the type of this depends on- Particle.getDataType()
 
- 
spawnParticlevoid spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- Parameters:
- particle- the particle to spawn
- location- the location to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
 
- 
spawnParticlevoid spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- Parameters:
- particle- the particle to spawn
- x- the position on the x axis to spawn at
- y- the position on the y axis to spawn at
- z- the position on the z axis to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
 
- 
spawnParticle<T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- Type Parameters:
- T- type of particle data (see- Particle.getDataType()
- Parameters:
- particle- the particle to spawn
- location- the location to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
- data- the data to use for the particle or null, the type of this depends on- Particle.getDataType()
 
- 
spawnParticle<T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- Type Parameters:
- T- type of particle data (see- Particle.getDataType()
- Parameters:
- particle- the particle to spawn
- x- the position on the x axis to spawn at
- y- the position on the y axis to spawn at
- z- the position on the z axis to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
- data- the data to use for the particle or null, the type of this depends on- Particle.getDataType()
 
- 
spawnParticlevoid spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- Parameters:
- particle- the particle to spawn
- location- the location to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
- extra- the extra data for this particle, depends on the particle used (normally speed)
 
- 
spawnParticlevoid spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- Parameters:
- particle- the particle to spawn
- x- the position on the x axis to spawn at
- y- the position on the y axis to spawn at
- z- the position on the z axis to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
- extra- the extra data for this particle, depends on the particle used (normally speed)
 
- 
spawnParticle<T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- Type Parameters:
- T- type of particle data (see- Particle.getDataType()
- Parameters:
- particle- the particle to spawn
- location- the location to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
- extra- the extra data for this particle, depends on the particle used (normally speed)
- data- the data to use for the particle or null, the type of this depends on- Particle.getDataType()
 
- 
spawnParticle<T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- Type Parameters:
- T- type of particle data (see- Particle.getDataType()
- Parameters:
- particle- the particle to spawn
- x- the position on the x axis to spawn at
- y- the position on the y axis to spawn at
- z- the position on the z axis to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
- extra- the extra data for this particle, depends on the particle used (normally speed)
- data- the data to use for the particle or null, the type of this depends on- Particle.getDataType()
 
- 
spawnParticle<T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- Type Parameters:
- T- type of particle data (see- Particle.getDataType()
- Parameters:
- particle- the particle to spawn
- location- the location to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
- extra- the extra data for this particle, depends on the particle used (normally speed)
- data- the data to use for the particle or null, the type of this depends on- Particle.getDataType()
- force- whether to send the particle to the player in an extended range and encourage their client to render it regardless of settings
 
- 
spawnParticle<T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- Type Parameters:
- T- type of particle data (see- Particle.getDataType()
- Parameters:
- particle- the particle to spawn
- x- the position on the x axis to spawn at
- y- the position on the y axis to spawn at
- z- the position on the z axis to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
- extra- the extra data for this particle, depends on the particle used (normally speed)
- data- the data to use for the particle or null, the type of this depends on- Particle.getDataType()
- force- whether to send the particle to the player in an extended range and encourage their client to render it regardless of settings
 
- 
getAdvancementProgressReturn the player's progression on the specified advancement.- Parameters:
- advancement- advancement
- Returns:
- object detailing the player's progress
 
- 
getClientViewDistanceint getClientViewDistance()Get the player's current client side view distance.
 Will default to the server view distance if the client has not yet communicated this information,- Returns:
- client view distance as above
 
- 
getPingint getPing()Gets the player's estimated ping in milliseconds. In Vanilla this value represents a weighted average of the response time to application layer ping packets sent. This value does not represent the network round trip time and as such may have less granularity and be impacted by other sources. For these reasons it should not be used for anti-cheat purposes. Its recommended use is only as a qualitative indicator of connection quality (Vanilla uses it for this purpose in the tab list).- Returns:
- player ping
 
- 
getLocaleGets the player's current locale. The value of the locale String is not defined properly.
 The vanilla Minecraft client will use lowercase language / country pairs separated by an underscore, but custom resource packs may use any format they wish.- Returns:
- the player's locale
 
- 
updateCommandsvoid updateCommands()Update the list of commands sent to the client.
 Generally useful to ensure the client has a complete list of commands after permission changes are done.
- 
openBookOpen aMaterial.WRITTEN_BOOKfor a Player- Parameters:
- book- The book to open for this player
 
- 
openSignOpen a Sign for editing by the Player. The Sign must be placed in the same world as the player.- Parameters:
- sign- The sign to edit
 
- 
openSignOpen a Sign for editing by the Player. The Sign must be placed in the same world as the player.- Parameters:
- sign- The sign to edit
- side- The side to edit
 
- 
showDemoScreenvoid showDemoScreen()Shows the demo screen to the player, this screen is normally only seen in the demo version of the game.
 Servers can modify the text on this screen using a resource pack.
- 
isAllowingServerListingsboolean isAllowingServerListings()Gets whether the player has the "Allow Server Listings" setting enabled.- Returns:
- whether the player allows server listings
 
- 
spigot- Specified by:
- spigotin interface- CommandSender
- Specified by:
- spigotin interface- Entity
 
 
-