Interface Spieler

All Superinterfaces:
BefehlAbsender, Berechtigtbar, Beschaedigbar, BestaendigeDatenInhaber, GespraechsPartner, InventarInhaber, KonfigurationsSerialisierbar, Lebewesen, MenschlichesWesen, MerkmalInhaber, MetadatenInhaber, Nennbar, OfflineSpieler, ProjektilQuelle, ServerBetreiber, TierZaehmer, Wesen, ZusatzmodulNachrichtAddressat

Represents a spieler, connected or not
  • Method Details

    • getName

      @NotNull String getName()
      Returns the name of this spieler
      Specified by:
      getName in interface BefehlAbsender
      Specified by:
      getName in interface MenschlichesWesen
      Specified by:
      getName in interface OfflineSpieler
      Specified by:
      getName in interface TierZaehmer
      Returns:
      Spieler name
    • getDisplayName

      @NotNull String getDisplayName()
      Gets the "friendly" name to display of this spieler. 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
    • setDisplayName

      void setDisplayName(@Nullable String name)
      Sets the "friendly" name to display of this spieler. 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.
    • getPlayerListName

      @NotNull String getPlayerListName()
      Gets the name that is shown on the spieler list.
      Returns:
      the spieler list name
    • setPlayerListName

      void setPlayerListName(@Nullable String name)
      Sets the name that is shown on the in-game spieler list.

      If the value is null, the name will be identical to getName().

      Parameters:
      name - new spieler list name
    • getPlayerListHeader

      @Nullable String getPlayerListHeader()
      Gets the currently displayed spieler list header for this spieler.
      Returns:
      spieler list header or null
    • getPlayerListFooter

      @Nullable String getPlayerListFooter()
      Gets the currently displayed spieler list footer for this spieler.
      Returns:
      spieler list header or null
    • setPlayerListHeader

      void setPlayerListHeader(@Nullable String header)
      Sets the currently displayed spieler list header for this spieler.
      Parameters:
      header - spieler list header, null for empty
    • setPlayerListFooter

      void setPlayerListFooter(@Nullable String footer)
      Sets the currently displayed spieler list footer for this spieler.
      Parameters:
      footer - spieler list footer, null for empty
    • setPlayerListHeaderFooter

      void setPlayerListHeaderFooter(@Nullable String header, @Nullable String footer)
      Sets the currently displayed spieler list header and footer for this spieler.
      Parameters:
      header - spieler list header, null for empty
      footer - spieler list footer, null for empty
    • setCompassTarget

      void setCompassTarget(@NotNull Ort loc)
      Set the target of the spieler's compass.
      Parameters:
      loc - Ort to point to
    • getCompassTarget

      @NotNull Ort getCompassTarget()
      Get the previously set compass target.
      Returns:
      location of the target
    • getAddress

      @Nullable InetSocketAddress getAddress()
      Gets the socket address of this spieler
      Returns:
      the spieler's address
    • sendRawMessage

      void sendRawMessage(@NotNull String message)
      Sends this sender a message raw
      Specified by:
      sendRawMessage in interface GespraechsPartner
      Parameters:
      message - Message to be displayed
    • kickPlayer

      void kickPlayer(@Nullable String message)
      Kicks spieler with custom kick message.
      Parameters:
      message - kick message
    • ban

      @Nullable HausverbotsEintrag<SpielerProfil> ban(@Nullable String reason, @Nullable Date expires, @Nullable String source, boolean kickPlayer)
      Adds this user to the ProfilHausverbotsListe. If a previous hausverbot exists, this will update the entry.
      Parameters:
      reason - reason for the hausverbot, null indicates implementation default
      expires - date for the hausverbot's expiration (unban), or null to imply forever
      source - source of the hausverbot, null indicates implementation default
      kickPlayer - if the spieler need to be kick
      Returns:
      the entry for the newly created hausverbot, or the entry for the (updated) previous hausverbot
    • ban

      @Nullable HausverbotsEintrag<SpielerProfil> ban(@Nullable String reason, @Nullable Instant expires, @Nullable String source, boolean kickPlayer)
      Adds this user to the ProfilHausverbotsListe. If a previous hausverbot exists, this will update the entry.
      Parameters:
      reason - reason for the hausverbot, null indicates implementation default
      expires - date for the hausverbot's expiration (unban), or null to imply forever
      source - source of the hausverbot, null indicates implementation default
      kickPlayer - if the spieler need to be kick
      Returns:
      the entry for the newly created hausverbot, or the entry for the (updated) previous hausverbot
    • ban

      @Nullable HausverbotsEintrag<SpielerProfil> ban(@Nullable String reason, @Nullable Duration duration, @Nullable String source, boolean kickPlayer)
      Adds this user to the ProfilHausverbotsListe. If a previous hausverbot exists, this will update the entry.
      Parameters:
      reason - reason for the hausverbot, null indicates implementation default
      duration - the duration how long the hausverbot lasts, or null to imply forever
      source - source of the hausverbot, null indicates implementation default
      kickPlayer - if the spieler need to be kick
      Returns:
      the entry for the newly created hausverbot, or the entry for the (updated) previous hausverbot
    • banIp

      @Nullable HausverbotsEintrag<InetAddress> banIp(@Nullable String reason, @Nullable Date expires, @Nullable String source, boolean kickPlayer)
      Adds this user's current IP address to the IpHausverbotsListe. If a previous hausverbot exists, this will update the entry. If getAddress() is null this method will throw an exception.
      Parameters:
      reason - reason for the hausverbot, null indicates implementation default
      expires - date for the hausverbot's expiration (unban), or null to imply forever
      source - source of the hausverbot, null indicates implementation default
      kickPlayer - if the spieler need to be kick
      Returns:
      the entry for the newly created hausverbot, or the entry for the (updated) previous hausverbot
    • banIp

      @Nullable HausverbotsEintrag<InetAddress> banIp(@Nullable String reason, @Nullable Instant expires, @Nullable String source, boolean kickPlayer)
      Adds this user's current IP address to the IpHausverbotsListe. If a previous hausverbot exists, this will update the entry. If getAddress() is null this method will throw an exception.
      Parameters:
      reason - reason for the hausverbot, null indicates implementation default
      expires - date for the hausverbot's expiration (unban), or null to imply forever
      source - source of the hausverbot, null indicates implementation default
      kickPlayer - if the spieler need to be kick
      Returns:
      the entry for the newly created hausverbot, or the entry for the (updated) previous hausverbot
    • banIp

      @Nullable HausverbotsEintrag<InetAddress> banIp(@Nullable String reason, @Nullable Duration duration, @Nullable String source, boolean kickPlayer)
      Adds this user's current IP address to the IpHausverbotsListe. If a previous hausverbot exists, this will update the entry. If getAddress() is null this method will throw an exception.
      Parameters:
      reason - reason for the hausverbot, null indicates implementation default
      duration - the duration how long the hausverbot lasts, or null to imply forever
      source - source of the hausverbot, null indicates implementation default
      kickPlayer - if the spieler need to be kick
      Returns:
      the entry for the newly created hausverbot, or the entry for the (updated) previous hausverbot
    • chat

      void chat(@NotNull String msg)
      Says a message (or runs a befehl).
      Parameters:
      msg - message to print
    • performCommand

      boolean performCommand(@NotNull String command)
      Makes the spieler perform the given befehl
      Parameters:
      command - Befehl to perform
      Returns:
      true if the befehl was successful, otherwise false
    • isOnGround

      @Deprecated boolean isOnGround()
      Deprecated.
      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 accessed
      Returns true if the wesen is supported by a block. This value is a state updated by the client after each movement.
      Specified by:
      isOnGround in interface Wesen
      Returns:
      True if wesen is on ground.
      See Also:
    • isSneaking

      boolean isSneaking()
      Returns if the spieler is in sneak mode
      Returns:
      true if spieler is in sneak mode
    • setSneaking

      void setSneaking(boolean sneak)
      Sets the sneak mode the spieler
      Parameters:
      sneak - true if spieler should appear sneaking
    • isSprinting

      boolean isSprinting()
      Gets whether the spieler is sprinting or not.
      Returns:
      true if spieler is sprinting.
    • setSprinting

      void setSprinting(boolean sprinting)
      Sets whether the spieler is sprinting or not.
      Parameters:
      sprinting - true if the spieler should be sprinting
    • saveData

      void saveData()
      Saves the players current location, health, inventar, motion, and other information into the username.dat datei, in the welt/spieler folder
    • loadData

      void loadData()
      Loads the players current location, health, inventar, motion, and other information from the username.dat datei, in the welt/spieler folder.

      Note: This will overwrite the players current inventar, health, motion, etc, with the state from the saved dat datei.

    • setSleepingIgnored

      void setSleepingIgnored(boolean isSleeping)
      Sets whether the spieler 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.
    • isSleepingIgnored

      boolean isSleepingIgnored()
      Returns whether the spieler is sleeping ignored.
      Returns:
      Whether spieler is ignoring sleep.
    • getBedSpawnLocation

      @Nullable Ort getBedSpawnLocation()
      Gets the Ort where the spieler will spawn at their bed, null if they have not slept in one or their current bed spawn is invalid.
      Specified by:
      getBedSpawnLocation in interface OfflineSpieler
      Returns:
      Bed Spawn Ort if bed exists, otherwise null.
    • setBedSpawnLocation

      void setBedSpawnLocation(@Nullable Ort ort)
      Sets the Ort where the spieler will spawn at their bed.
      Parameters:
      ort - where to set the respawn ort
    • setBedSpawnLocation

      void setBedSpawnLocation(@Nullable Ort ort, boolean force)
      Sets the Ort where the spieler will spawn at their bed.
      Parameters:
      ort - where to set the respawn ort
      force - whether to forcefully set the respawn ort even if a valid bed is not present
    • playNote

      @Deprecated void playNote(@NotNull Ort loc, byte instrument, byte note)
      Deprecated.
      Magic value
      Play a note for the spieler at a location.
      This will work with cake.
      Parameters:
      loc - The location to play the note
      instrument - The instrument ID.
      note - The note ID.
    • playNote

      void playNote(@NotNull Ort loc, @NotNull Instrument instrument, @NotNull Note note)
      Play a note for the spieler 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
    • playSound

      void playSound(@NotNull Ort ort, @NotNull Geraeusch geraeusch, float volume, float pitch)
      Play a geraeusch for a spieler at the ort.

      This function will fail silently if Ort or Geraeusch are null.

      Parameters:
      ort - The ort to play the geraeusch
      geraeusch - The geraeusch to play
      volume - The volume of the geraeusch
      pitch - The pitch of the geraeusch
    • playSound

      void playSound(@NotNull Ort ort, @NotNull String sound, float volume, float pitch)
      Play a sound for a spieler at the ort.

      This function will fail silently if Ort or Geraeusch are null. No sound will be heard by the spieler if their client does not have the respective sound for the value passed.

      Parameters:
      ort - The ort to play the sound
      sound - The internal sound name to play
      volume - The volume of the sound
      pitch - The pitch of the sound
    • playSound

      void playSound(@NotNull Ort ort, @NotNull Geraeusch geraeusch, @NotNull GeraeuschKategorie category, float volume, float pitch)
      Play a geraeusch for a spieler at the ort.

      This function will fail silently if Ort or Geraeusch are null.

      Parameters:
      ort - The ort to play the geraeusch
      geraeusch - The geraeusch to play
      category - The category of the geraeusch
      volume - The volume of the geraeusch
      pitch - The pitch of the geraeusch
    • playSound

      void playSound(@NotNull Ort ort, @NotNull String sound, @NotNull GeraeuschKategorie category, float volume, float pitch)
      Play a sound for a spieler at the ort.

      This function will fail silently if Ort or Geraeusch are null. No sound will be heard by the spieler if their client does not have the respective sound for the value passed.

      Parameters:
      ort - The ort 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
    • playSound

      void playSound(@NotNull Ort ort, @NotNull Geraeusch geraeusch, @NotNull GeraeuschKategorie category, float volume, float pitch, long seed)
      Play a geraeusch for a spieler at the ort. For sounds with multiple variations passing the same seed will always play the same variation.

      This function will fail silently if Ort or Geraeusch are null.

      Parameters:
      ort - The ort to play the geraeusch
      geraeusch - The geraeusch to play
      category - The category of the geraeusch
      volume - The volume of the geraeusch
      pitch - The pitch of the geraeusch
      seed - The seed for the geraeusch
    • playSound

      void playSound(@NotNull Ort ort, @NotNull String sound, @NotNull GeraeuschKategorie category, float volume, float pitch, long seed)
      Play a sound for a spieler at the ort. For sounds with multiple variations passing the same seed will always play the same variation.

      This function will fail silently if Ort or Geraeusch are null. No sound will be heard by the spieler if their client does not have the respective sound for the value passed.

      Parameters:
      ort - The ort 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
    • playSound

      void playSound(@NotNull Wesen wesen, @NotNull Geraeusch geraeusch, float volume, float pitch)
      Play a geraeusch for a spieler at the location of the wesen.

      This function will fail silently if Wesen or Geraeusch are null.

      Parameters:
      wesen - The wesen to play the geraeusch
      geraeusch - The geraeusch to play
      volume - The volume of the geraeusch
      pitch - The pitch of the geraeusch
    • playSound

      void playSound(@NotNull Wesen wesen, @NotNull String sound, float volume, float pitch)
      Play a sound for a spieler at the location of the wesen.

      This function will fail silently if Wesen or Geraeusch are null.

      Parameters:
      wesen - The wesen to play the sound
      sound - The sound to play
      volume - The volume of the sound
      pitch - The pitch of the sound
    • playSound

      void playSound(@NotNull Wesen wesen, @NotNull Geraeusch geraeusch, @NotNull GeraeuschKategorie category, float volume, float pitch)
      Play a geraeusch for a spieler at the location of the wesen.

      This function will fail silently if Wesen or Geraeusch are null.

      Parameters:
      wesen - The wesen to play the geraeusch
      geraeusch - The geraeusch to play
      category - The category of the geraeusch
      volume - The volume of the geraeusch
      pitch - The pitch of the geraeusch
    • playSound

      void playSound(@NotNull Wesen wesen, @NotNull String sound, @NotNull GeraeuschKategorie category, float volume, float pitch)
      Play a sound for a spieler at the location of the wesen.

      This function will fail silently if Wesen or Geraeusch are null.

      Parameters:
      wesen - The wesen 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
    • playSound

      void playSound(@NotNull Wesen wesen, @NotNull Geraeusch geraeusch, @NotNull GeraeuschKategorie category, float volume, float pitch, long seed)
      Play a geraeusch for a spieler at the location of the wesen. For sounds with multiple variations passing the same seed will always play the same variation.

      This function will fail silently if Wesen or Geraeusch are null.

      Parameters:
      wesen - The wesen to play the geraeusch
      geraeusch - The geraeusch to play
      category - The category of the geraeusch
      volume - The volume of the geraeusch
      pitch - The pitch of the geraeusch
      seed - The seed for the geraeusch
    • playSound

      void playSound(@NotNull Wesen wesen, @NotNull String sound, @NotNull GeraeuschKategorie category, float volume, float pitch, long seed)
      Play a sound for a spieler at the location of the wesen. For sounds with multiple variations passing the same seed will always play the same variation.

      This function will fail silently if Wesen or Geraeusch are null.

      Parameters:
      wesen - The wesen 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
    • stopSound

      void stopSound(@NotNull Geraeusch geraeusch)
      Stop the specified geraeusch from playing.
      Parameters:
      geraeusch - the geraeusch to stop
    • stopSound

      void stopSound(@NotNull String sound)
      Stop the specified sound from playing.
      Parameters:
      sound - the sound to stop
    • stopSound

      void stopSound(@NotNull Geraeusch geraeusch, @Nullable GeraeuschKategorie category)
      Stop the specified geraeusch from playing.
      Parameters:
      geraeusch - the geraeusch to stop
      category - the category of the geraeusch
    • stopSound

      void stopSound(@NotNull String sound, @Nullable GeraeuschKategorie category)
      Stop the specified sound from playing.
      Parameters:
      sound - the sound to stop
      category - the category of the sound
    • stopSound

      void stopSound(@NotNull GeraeuschKategorie category)
      Stop the specified sound category from playing.
      Parameters:
      category - the sound category to stop
    • stopAllSounds

      void stopAllSounds()
      Stop all sounds from playing.
    • playEffect

      @Deprecated void playEffect(@NotNull Ort loc, @NotNull Effekt effekt, int data)
      Deprecated.
      Magic value
      Plays an effekt to just this spieler.
      Parameters:
      loc - the location to play the effekt at
      effekt - the Effekt
      data - a data bit needed for some effects
    • playEffect

      <T> void playEffect(@NotNull Ort loc, @NotNull Effekt effekt, @Nullable T data)
      Plays an effekt to just this spieler.
      Type Parameters:
      T - the data based based on the type of the effekt
      Parameters:
      loc - the location to play the effekt at
      effekt - the Effekt
      data - a data bit needed for some effects
    • breakBlock

      boolean breakBlock(@NotNull Block block)
      Force this spieler to break a Block using the item in their main hand. This method will respect verzauberungen, handle item durability (if applicable) and drop experience and the correct items according to the tool/item in the spieler's hand.

      Note that this method will call a BlockBruchEreignis, meaning that this method may not be successful in breaking the block if the ereignis was cancelled by a third party zusatzmodul. Care should be taken if running this method in a BlockBruchEreignis listener as recursion may be possible if it is invoked on the same Block being broken in the ereignis.

      Additionally, a BlockLasseFallenGegenstandEreignis is called for the items dropped by this method (if successful).

      The block must be in the same welt as the spieler.

      Parameters:
      block - the block to break
      Returns:
      true if the block was broken, false if the break failed
    • sendBlockChange

      @Deprecated void sendBlockChange(@NotNull Ort loc, @NotNull Material material, byte data)
      Deprecated.
      Magic value
      Send a block change. This fakes a block change packet for a user at a certain location. This will not actually change the welt in any way.
      Parameters:
      loc - The location of the changed block
      material - The new block
      data - The block data
    • sendBlockChange

      void sendBlockChange(@NotNull Ort loc, @NotNull BlockData block)
      Send a block change. This fakes a block change packet for a user at a certain location. This will not actually change the welt in any way.
      Parameters:
      loc - The location of the changed block
      block - The new block
    • sendBlockChanges

      void sendBlockChanges(@NotNull Collection<BlockState> blocks)
      Send a multi-block change. This fakes a block change packet for a user at multiple locations. This will not actually change the welt 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 batzen section modified, meaning one packet for each 16x16x16 block area. Even if only one block is changed in two different batzen sections, two packets will be sent.

      Additionally, this method cannot guarantee the functionality of changes being sent to the spieler 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 spieler
    • sendBlockChanges

      @Deprecated void sendBlockChanges(@NotNull Collection<BlockState> blocks, boolean suppressLightUpdates)
      Deprecated.
      suppressLightUpdates is not functional in versions greater than 1.19.4
      Send a multi-block change. This fakes a block change packet for a user at multiple locations. This will not actually change the welt 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 batzen section modified, meaning one packet for each 16x16x16 block area. Even if only one block is changed in two different batzen sections, two packets will be sent.

      Additionally, this method cannot guarantee the functionality of changes being sent to the spieler 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 spieler
      suppressLightUpdates - whether or not light updates should be suppressed when updating the blocks on the client
    • sendBlockDamage

      void sendBlockDamage(@NotNull Ort loc, float progress)
      Send block damage. This fakes block break progress at a certain location sourced by this spieler. 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
    • sendBlockDamage

      void sendBlockDamage(@NotNull Ort loc, float progress, @NotNull Wesen source)
      Send block damage. This fakes block break progress at a certain location sourced by the provided wesen. 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 spieler, 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 wesen to which the damage belongs
    • sendBlockDamage

      void sendBlockDamage(@NotNull Ort loc, float progress, int sourceId)
      Send block damage. This fakes block break progress at a certain location sourced by the provided wesen 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 spieler, 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 wesen id of the wesen to which the damage belongs. Can be an id that does not associate directly with an existing or loaded wesen.
    • sendEquipmentChange

      void sendEquipmentChange(@NotNull Lebewesen entity, @NotNull AusstattungsSpalte slot, @Nullable GegenstandsStapel item)
      Send an equipment change for the target wesen. This will not actually change the wesen's equipment in any way.
      Parameters:
      entity - the wesen 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
    • sendEquipmentChange

      void sendEquipmentChange(@NotNull Lebewesen entity, @NotNull Map<AusstattungsSpalte,GegenstandsStapel> items)
      Send multiple equipment changes for the target wesen. This will not actually change the wesen's equipment in any way.
      Parameters:
      entity - the wesen 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
    • sendSignChange

      void sendSignChange(@NotNull Ort 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 welt in any way. This method will use a sign at the location's block or a faked sign sent via sendBlockChange(Ort, de.eimmer.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(Ort, de.eimmer.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
    • sendSignChange

      void sendSignChange(@NotNull Ort loc, @Nullable String[] lines, @NotNull FarbstoffFarbe farbstoffFarbe) 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 welt in any way. This method will use a sign at the location's block or a faked sign sent via sendBlockChange(Ort, de.eimmer.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(Ort, de.eimmer.block.TileState).

      Parameters:
      loc - the location of the sign
      lines - the new text on the sign or null to clear it
      farbstoffFarbe - the color of the sign
      Throws:
      IllegalArgumentException - if location is null
      IllegalArgumentException - if farbstoffFarbe is null
      IllegalArgumentException - if lines is non-null and has a length less than 4
    • sendSignChange

      void sendSignChange(@NotNull Ort loc, @Nullable String[] lines, @NotNull FarbstoffFarbe farbstoffFarbe, 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 welt in any way. This method will use a sign at the location's block or a faked sign sent via sendBlockChange(Ort, de.eimmer.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(Ort, de.eimmer.block.TileState).

      Parameters:
      loc - the location of the sign
      lines - the new text on the sign or null to clear it
      farbstoffFarbe - the color of the sign
      hasGlowingText - if the sign's text should be glowing
      Throws:
      IllegalArgumentException - if location is null
      IllegalArgumentException - if farbstoffFarbe is null
      IllegalArgumentException - if lines is non-null and has a length less than 4
    • sendBlockUpdate

      @Experimental void sendBlockUpdate(@NotNull Ort 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 welt in any way. This method will use a TileState at the location's block or a faked TileState sent via sendBlockChange(Ort, de.eimmer.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 a BlockState.

      Parameters:
      loc - the location of the sign
      tileState - the tile state
      Throws:
      IllegalArgumentException - if location is null
      IllegalArgumentException - if tileState is null
    • sendMap

      void sendMap(@NotNull KartenAnsicht map)
      Render a karte and send it to the spieler in its entirety. This may be used when streaming the karte in the normal manner is not desirable.
      Parameters:
      map - The karte to be sent
    • sendHurtAnimation

      void sendHurtAnimation(float yaw)
      Send a hurt animation. This fakes incoming damage towards the spieler from the given yaw relative to the spieler's direction.
      Parameters:
      yaw - the yaw in degrees relative to the spieler's direction where 0 is in front of the spieler, 90 is to the right, 180 is behind, and 270 is to the left
    • addCustomChatCompletions

      void addCustomChatCompletions(@NotNull Collection<String> completions)
      Add custom chat completion suggestions shown to the spieler while typing a message.
      Parameters:
      completions - the completions to send
    • removeCustomChatCompletions

      void removeCustomChatCompletions(@NotNull Collection<String> completions)
      Remove custom chat completion suggestions shown to the spieler while typing a message. Online spieler names cannot be removed with this method. This will affect only custom completions added by addCustomChatCompletions(Collection) or setCustomChatCompletions(Collection).
      Parameters:
      completions - the completions to remove
    • setCustomChatCompletions

      void setCustomChatCompletions(@NotNull Collection<String> completions)
      Set the list of chat completion suggestions shown to the spieler 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 spieler's entire inventar.
      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.
    • getPreviousGameMode

      @Nullable SpielModus getPreviousGameMode()
      Gets this spieler's previous SpielModus
      Returns:
      Previous game mode or null
    • setPlayerTime

      void setPlayerTime(long time, boolean relative)
      Sets the current time on the spieler's client. When relative is true the spieler's time will be kept synchronized to its welt time with the specified offset.

      When using non relative time the spieler's time will stay fixed at the specified time parameter. It's up to the caller to continue updating the spieler's time. To restore spieler time to normal use resetPlayerTime().

      Parameters:
      time - The current spieler's perceived time or the spieler's time offset from the server time.
      relative - When true the spieler time is kept relative to its welt time.
    • getPlayerTime

      long getPlayerTime()
      Returns the spieler's current timestamp.
      Returns:
      The spieler's time
    • getPlayerTimeOffset

      long getPlayerTimeOffset()
      Returns the spieler's current time offset relative to server time, or the current spieler's fixed time if the spieler's time is absolute.
      Returns:
      The spieler's time
    • isPlayerTimeRelative

      boolean isPlayerTimeRelative()
      Returns true if the spieler's time is relative to the server time, otherwise the spieler's time is absolute and will not change its current time unless done so with setPlayerTime().
      Returns:
      true if the spieler's time is relative to the server time.
    • resetPlayerTime

      void resetPlayerTime()
      Restores the normal condition where the spieler's time is synchronized with the server time.

      Equivalent to calling setPlayerTime(0, true).

    • setPlayerWeather

      void setPlayerWeather(@NotNull WetterTyp type)
      Sets the type of wetter the spieler will see. When used, the wetter status of the spieler is locked until resetPlayerWeather() is used.
      Parameters:
      type - The WetterTyp enum type the spieler should experience
    • getPlayerWeather

      @Nullable WetterTyp getPlayerWeather()
      Returns the type of wetter the spieler is currently experiencing.
      Returns:
      The WetterTyp that the spieler is currently experiencing or null if spieler is seeing server wetter.
    • resetPlayerWeather

      void resetPlayerWeather()
      Restores the normal condition where the spieler's wetter is controlled by server conditions.
    • getExpCooldown

      int getExpCooldown()
      Gets the spieler's cooldown between picking up experience orbs.
      Returns:
      The cooldown in ticks
    • setExpCooldown

      void setExpCooldown(int ticks)
      Sets the spieler's cooldown between picking up experience orbs.. Note: Setting this to 0 allows the spieler to pick up instantly, but setting this to a negative value will cause the spieler to be unable to pick up xp-orbs. Calling this Method will result in SpielerErfahrungAbklingzeitAenderEreignis being called.
      Parameters:
      ticks - The cooldown in ticks
    • giveExp

      void giveExp(int amount)
      Gives the spieler the amount of experience specified.
      Parameters:
      amount - Exp amount to give
    • giveExpLevels

      void giveExpLevels(int amount)
      Gives the spieler 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
    • getExp

      float 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
    • setExp

      void setExp(float exp)
      Sets the players current experience points towards the next level

      This is a percentage value. 0 is "no progress" and 1 is "next level".

      Parameters:
      exp - New experience points
    • getLevel

      int getLevel()
      Gets the players current experience level
      Returns:
      Current experience level
    • setLevel

      void setLevel(int level)
      Sets the players current experience level
      Parameters:
      level - New experience level
    • getTotalExperience

      int getTotalExperience()
      Gets the players total experience points.
      This refers to the total amount of experience the spieler has collected over time and is not currently displayed to the client.
      Returns:
      Current total experience points
    • setTotalExperience

      void setTotalExperience(int exp)
      Sets the players current experience points.
      This refers to the total amount of experience the spieler has collected over time and is not currently displayed to the client.
      Parameters:
      exp - New total experience points
    • sendExperienceChange

      void 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:
    • sendExperienceChange

      void 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:
    • getAllowFlight

      boolean getAllowFlight()
      Determines if the Spieler is allowed to fly via jump key double-tap like in creative mode.
      Returns:
      True if the spieler is allowed to fly.
    • setAllowFlight

      void setAllowFlight(boolean flight)
      Sets if the Spieler is allowed to fly via jump key double-tap like in creative mode.
      Parameters:
      flight - If flight should be allowed.
    • hidePlayer

      @Deprecated void hidePlayer(@NotNull Spieler spieler)
      Hides a spieler from this spieler
      Parameters:
      spieler - Spieler to hide
    • hidePlayer

      void hidePlayer(@NotNull Zusatzmodul zusatzmodul, @NotNull Spieler spieler)
      Hides a spieler from this spieler
      Parameters:
      zusatzmodul - Zusatzmodul that wants to hide the spieler
      spieler - Spieler to hide
    • showPlayer

      @Deprecated void showPlayer(@NotNull Spieler spieler)
      Allows this spieler to see a spieler that was previously hidden
      Parameters:
      spieler - Spieler to show
    • showPlayer

      void showPlayer(@NotNull Zusatzmodul zusatzmodul, @NotNull Spieler spieler)
      Allows this spieler to see a spieler that was previously hidden. If another another zusatzmodul had hidden the spieler too, then the spieler will remain hidden until the other zusatzmodul calls this method too.
      Parameters:
      zusatzmodul - Zusatzmodul that wants to show the spieler
      spieler - Spieler to show
    • canSee

      boolean canSee(@NotNull Spieler spieler)
      Checks to see if a spieler has been hidden from this spieler
      Parameters:
      spieler - Spieler to check
      Returns:
      True if the provided spieler is not being hidden from this spieler
    • hideEntity

      @Experimental void hideEntity(@NotNull Zusatzmodul zusatzmodul, @NotNull Wesen wesen)
      Visually hides an wesen from this spieler.
      Parameters:
      zusatzmodul - Zusatzmodul that wants to hide the wesen
      wesen - Wesen to hide
      API Note:
      draft API
    • showEntity

      @Experimental void showEntity(@NotNull Zusatzmodul zusatzmodul, @NotNull Wesen wesen)
      Allows this spieler to see an wesen that was previously hidden. If another another zusatzmodul had hidden the wesen too, then the wesen will remain hidden until the other zusatzmodul calls this method too.
      Parameters:
      zusatzmodul - Zusatzmodul that wants to show the wesen
      wesen - Wesen to show
      API Note:
      draft API
    • canSee

      @Experimental boolean canSee(@NotNull Wesen wesen)
      Checks to see if an wesen has been visually hidden from this spieler.
      Parameters:
      wesen - Wesen to check
      Returns:
      True if the provided wesen is not being hidden from this spieler
      API Note:
      draft API
    • isFlying

      boolean isFlying()
      Checks to see if this spieler is currently flying or not.
      Returns:
      True if the spieler is flying, else false.
    • setFlying

      void setFlying(boolean value)
      Makes this spieler start or stop flying.
      Parameters:
      value - True to fly.
    • setFlySpeed

      void setFlySpeed(float value) throws IllegalArgumentException
      Sets 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
    • setWalkSpeed

      void setWalkSpeed(float value) throws IllegalArgumentException
      Sets 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
    • getFlySpeed

      float getFlySpeed()
      Gets the current allowed speed that a client can fly.
      Returns:
      The current allowed speed, from -1 to 1
    • getWalkSpeed

      float getWalkSpeed()
      Gets the current allowed speed that a client can walk.
      Returns:
      The current allowed speed, from -1 to 1
    • setTexturePack

      @Deprecated void setTexturePack(@NotNull String url)
      Deprecated.
      Minecraft no longer uses textures pakete. Instead you should use setResourcePack(String).
      Request that the spieler's client download and switch texture pakete.

      The spieler'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 datei 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 spieler 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 SpielerRessourcenPaketStatusEreignis to figure out whether or not the spieler loaded the pack!
      • There is no concept of resetting texture pakete 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.
    • setResourcePack

      void setResourcePack(@NotNull String url)
      Request that the spieler's client download and switch resource pakete.

      The spieler'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 datei 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 spieler 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 SpielerRessourcenPaketStatusEreignis to figure out whether or not the spieler loaded the pack!
      • There is no concept of resetting resource pakete 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.
    • setResourcePack

      void setResourcePack(@NotNull String url, @Nullable byte[] hash)
      Request that the spieler's client download and switch resource pakete.

      The spieler'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 datei 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 spieler 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 SpielerRessourcenPaketStatusEreignis to figure out whether or not the spieler loaded the pack!
      • There is no concept of resetting resource pakete 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 datei 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.
    • setResourcePack

      void setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable String prompt)
      Request that the spieler's client download and switch resource pakete.

      The spieler'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 datei 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 spieler 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 SpielerRessourcenPaketStatusEreignis to figure out whether or not the spieler loaded the pack!
      • To remove a resource pack you can use removeResourcePack(UUID) or removeResourcePacks().
      • 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 datei 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.
    • setResourcePack

      void setResourcePack(@NotNull String url, @Nullable byte[] hash, boolean force)
      Request that the spieler's client download and switch resource pakete.

      The spieler'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 datei 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 spieler 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 SpielerRessourcenPaketStatusEreignis to figure out whether or not the spieler loaded the pack!
      • To remove a resource pack you can use removeResourcePack(UUID) or removeResourcePacks().
      • 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 datei 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.
    • setResourcePack

      void setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable String prompt, boolean force)
      Request that the spieler's client download and switch resource pakete.

      The spieler'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 datei 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 spieler 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 SpielerRessourcenPaketStatusEreignis to figure out whether or not the spieler loaded the pack!
      • To remove a resource pack you can use removeResourcePack(UUID) or removeResourcePacks().
      • 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 datei 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.
    • setResourcePack

      void setResourcePack(@NotNull UUID id, @NotNull String url, @Nullable byte[] hash, @Nullable String prompt, boolean force)
      Request that the spieler's client download and switch resource pakete.

      The spieler'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 datei 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 spieler 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 SpielerRessourcenPaketStatusEreignis to figure out whether or not the spieler loaded the pack!
      • To remove a resource pack you can use removeResourcePack(UUID) or removeResourcePacks().
      • 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 datei 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.
    • removeResourcePack

      void removeResourcePack(@NotNull UUID id)
      Request that the spieler'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.
    • removeResourcePacks

      void removeResourcePacks()
      Request that the spieler's client remove all loaded resource pack sent by the server.
    • getScoreboard

      @NotNull Anzeigetafel getScoreboard()
      Gets the Anzeigetafel displayed to this spieler
      Returns:
      The current anzeigetafel seen by this spieler
    • setScoreboard

      void setScoreboard(@NotNull Anzeigetafel anzeigetafel) throws IllegalArgumentException, IllegalStateException
      Sets the spieler's visible Anzeigetafel.
      Parameters:
      anzeigetafel - New Anzeigetafel for the spieler
      Throws:
      IllegalArgumentException - if anzeigetafel is null
      IllegalArgumentException - if anzeigetafel was not created by the anzeigetafel manager
      IllegalStateException - if this is a spieler that is not logged yet or has logged out
    • getWorldBorder

      @Nullable WeltGrenze getWorldBorder()
      Gets the WeltGrenze visible to this Spieler, or null if viewing the welt's welt border.
      Returns:
      the spieler's welt border
    • setWorldBorder

      void setWorldBorder(@Nullable WeltGrenze border)
      Sets the WeltGrenze visible to this Spieler.
      Parameters:
      border - the border to set, or null to set to the welt border of the spieler's current welt
      Throws:
      UnsupportedOperationException - if setting the border to that of a welt in which the spieler is not currently present.
      See Also:
    • sendHealthUpdate

      void sendHealthUpdate(double health, int foodLevel, float saturation)
      Send a health update to the spieler. This will adjust the health, food, and saturation on the client and will not affect the spieler'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
    • sendHealthUpdate

      void sendHealthUpdate()
      Send a health update to the spieler using its known server values. This will synchronize the health, food, and saturation on the client and therefore may be useful when changing a spieler's maximum health merkmal.
    • isHealthScaled

      boolean 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:
    • setHealthScaled

      void 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
    • setHealthScale

      void setHealthScale(double scale) throws IllegalArgumentException
      Sets the number to scale health to for the client; this will also setHealthScaled(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
    • getHealthScale

      double 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:
    • getSpectatorTarget

      @Nullable Wesen getSpectatorTarget()
      Gets the wesen which is followed by the camera when in SpielModus.SPECTATOR.
      Returns:
      the followed wesen, or null if not in spectator mode or not following a specific wesen.
    • setSpectatorTarget

      void setSpectatorTarget(@Nullable Wesen wesen)
      Sets the wesen which is followed by the camera when in SpielModus.SPECTATOR.
      Parameters:
      wesen - the wesen to follow or null to reset
      Throws:
      IllegalStateException - if the spieler is not in SpielModus.SPECTATOR
    • sendTitle

      @Deprecated void sendTitle(@Nullable String title, @Nullable String subtitle)
      Deprecated.
      API behavior subject to change
      Sends a title and a subtitle message to the spieler. 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
    • sendTitle

      void sendTitle(@Nullable String title, @Nullable String subtitle, int fadeIn, int stay, int fadeOut)
      Sends a title and a subtitle message to the spieler. 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 vorgaben 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.
    • resetTitle

      void resetTitle()
      Resets the title displayed to the spieler. This will clear the displayed title / subtitle and reset timings to their default values.
    • spawnParticle

      void spawnParticle(@NotNull Partikel partikel, @NotNull Ort ort, int count)
      Spawns the partikel (the number of times specified by count) at the target ort.
      Parameters:
      partikel - the partikel to spawn
      ort - the ort to spawn at
      count - the number of particles
    • spawnParticle

      void spawnParticle(@NotNull Partikel partikel, double x, double y, double z, int count)
      Spawns the partikel (the number of times specified by count) at the target location.
      Parameters:
      partikel - the partikel 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 Partikel partikel, @NotNull Ort ort, int count, @Nullable T data)
      Spawns the partikel (the number of times specified by count) at the target ort.
      Type Parameters:
      T - type of partikel data (see Partikel.getDataType()
      Parameters:
      partikel - the partikel to spawn
      ort - the ort to spawn at
      count - the number of particles
      data - the data to use for the partikel or null, the type of this depends on Partikel.getDataType()
    • spawnParticle

      <T> void spawnParticle(@NotNull Partikel partikel, double x, double y, double z, int count, @Nullable T data)
      Spawns the partikel (the number of times specified by count) at the target location.
      Type Parameters:
      T - type of partikel data (see Partikel.getDataType()
      Parameters:
      partikel - the partikel 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 partikel or null, the type of this depends on Partikel.getDataType()
    • spawnParticle

      void spawnParticle(@NotNull Partikel partikel, @NotNull Ort ort, int count, double offsetX, double offsetY, double offsetZ)
      Spawns the partikel (the number of times specified by count) at the target ort. The position of each partikel will be randomized positively and negatively by the offset parameters on each axis.
      Parameters:
      partikel - the partikel to spawn
      ort - the ort 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

      void spawnParticle(@NotNull Partikel partikel, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ)
      Spawns the partikel (the number of times specified by count) at the target location. The position of each partikel will be randomized positively and negatively by the offset parameters on each axis.
      Parameters:
      partikel - the partikel 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 Partikel partikel, @NotNull Ort ort, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data)
      Spawns the partikel (the number of times specified by count) at the target ort. The position of each partikel will be randomized positively and negatively by the offset parameters on each axis.
      Type Parameters:
      T - type of partikel data (see Partikel.getDataType()
      Parameters:
      partikel - the partikel to spawn
      ort - the ort 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 partikel or null, the type of this depends on Partikel.getDataType()
    • spawnParticle

      <T> void spawnParticle(@NotNull Partikel partikel, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data)
      Spawns the partikel (the number of times specified by count) at the target location. The position of each partikel will be randomized positively and negatively by the offset parameters on each axis.
      Type Parameters:
      T - type of partikel data (see Partikel.getDataType()
      Parameters:
      partikel - the partikel 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 partikel or null, the type of this depends on Partikel.getDataType()
    • spawnParticle

      void spawnParticle(@NotNull Partikel partikel, @NotNull Ort ort, int count, double offsetX, double offsetY, double offsetZ, double extra)
      Spawns the partikel (the number of times specified by count) at the target ort. The position of each partikel will be randomized positively and negatively by the offset parameters on each axis.
      Parameters:
      partikel - the partikel to spawn
      ort - the ort 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 partikel, depends on the partikel used (normally speed)
    • spawnParticle

      void spawnParticle(@NotNull Partikel partikel, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra)
      Spawns the partikel (the number of times specified by count) at the target location. The position of each partikel will be randomized positively and negatively by the offset parameters on each axis.
      Parameters:
      partikel - the partikel 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 partikel, depends on the partikel used (normally speed)
    • spawnParticle

      <T> void spawnParticle(@NotNull Partikel partikel, @NotNull Ort ort, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data)
      Spawns the partikel (the number of times specified by count) at the target ort. The position of each partikel will be randomized positively and negatively by the offset parameters on each axis.
      Type Parameters:
      T - type of partikel data (see Partikel.getDataType()
      Parameters:
      partikel - the partikel to spawn
      ort - the ort 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 partikel, depends on the partikel used (normally speed)
      data - the data to use for the partikel or null, the type of this depends on Partikel.getDataType()
    • spawnParticle

      <T> void spawnParticle(@NotNull Partikel partikel, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data)
      Spawns the partikel (the number of times specified by count) at the target location. The position of each partikel will be randomized positively and negatively by the offset parameters on each axis.
      Type Parameters:
      T - type of partikel data (see Partikel.getDataType()
      Parameters:
      partikel - the partikel 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 partikel, depends on the partikel used (normally speed)
      data - the data to use for the partikel or null, the type of this depends on Partikel.getDataType()
    • getAdvancementProgress

      @NotNull AdvancementProgress getAdvancementProgress(@NotNull Fortschritt fortschritt)
      Return the spieler's progression on the specified fortschritt.
      Parameters:
      fortschritt - fortschritt
      Returns:
      object detailing the spieler's progress
    • getClientViewDistance

      int getClientViewDistance()
      Get the spieler'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
    • getPing

      int getPing()
      Gets the spieler'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:
      spieler ping
    • getLocale

      @NotNull String getLocale()
      Gets the spieler'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 pakete may use any format they wish.
      Returns:
      the spieler's locale
    • updateCommands

      void 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.
    • openBook

      void openBook(@NotNull GegenstandsStapel book)
      Open a Material.WRITTEN_BOOK for a Spieler
      Parameters:
      book - The book to open for this spieler
    • openSign

      void openSign(@NotNull Sign sign)
      Open a Sign for editing by the Spieler. The Sign must be placed in the same welt as the spieler.
      Parameters:
      sign - The sign to edit
    • openSign

      void openSign(@NotNull Sign sign, @NotNull Side side)
      Open a Sign for editing by the Spieler. The Sign must be placed in the same welt as the spieler.
      Parameters:
      sign - The sign to edit
      side - The side to edit
    • showDemoScreen

      void showDemoScreen()
      Shows the demo screen to the spieler, 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.
    • isAllowingServerListings

      boolean isAllowingServerListings()
      Gets whether the spieler has the "Allow Server Listings" setting enabled.
      Returns:
      whether the spieler allows server listings