Interface Sign

All Superinterfaces:
BlockState, Colorable, Metadatable, PersistentDataHolder, PersistentDataViewHolder, TileState
All Known Subinterfaces:
HangingSign

public interface Sign extends TileState, Colorable
Represents a captured state of either a SignPost or a WallSign.
Since:
1.0.0
  • Method Details

    • lines

      Deprecated.
      A sign may have multiple writable sides now. Use getSide(Side) and SignSide.lines().
      Gets all the lines of text currently on the Side.FRONT of this sign.
      Returns:
      List of components containing each line of text
      Since:
      1.16.5
    • line

      Deprecated.
      A sign may have multiple writable sides now. Use getSide(Side) and SignSide.line(int).
      Gets the line of text at the specified index on the Side.FRONT.

      For example, getLine(0) will return the first line of text.

      Parameters:
      index - Line number to get the text from, starting at 0
      Returns:
      Text on the given line
      Throws:
      IndexOutOfBoundsException - Thrown when the line does not exist
      Since:
      1.16.5
    • line

      @Deprecated void line(int index, @NotNull Component line) throws IndexOutOfBoundsException
      Deprecated.
      A sign may have multiple writable sides now. Use getSide(Side) and SignSide.line(int, net.kyori.adventure.text.Component).
      Sets the line of text at the specified index on the Side.FRONT.

      For example, setLine(0, "Line One") will set the first line of text to "Line One".

      Parameters:
      index - Line number to set the text at, starting from 0
      line - New text to set at the specified index
      Throws:
      IndexOutOfBoundsException - If the index is out of the range 0..3
      Since:
      1.16.5
    • getLines

      @Deprecated(since="1.20") @NotNull @NotNull String[] getLines()
      Deprecated.
      A sign may have multiple writable sides now. Use getSide(Side) and SignSide.lines().
      Gets all the lines of text currently on the Side.FRONT of this sign.
      Returns:
      Array of Strings containing each line of text
      Since:
      1.0.0
    • getLine

      Deprecated.
      A sign may have multiple writable sides now. Use getSide(Side) and SignSide.line(int).
      Gets the line of text at the specified index.

      For example, getLine(0) will return the first line of text on the Side.FRONT.

      Parameters:
      index - Line number to get the text from, starting at 0
      Returns:
      Text on the given line
      Throws:
      IndexOutOfBoundsException - Thrown when the line does not exist
      Since:
      1.0.0
    • setLine

      @Deprecated(since="1.20") void setLine(int index, @NotNull @NotNull String line) throws IndexOutOfBoundsException
      Deprecated.
      A sign may have multiple writable sides now. Use getSide(Side) and SignSide.line(int, net.kyori.adventure.text.Component).
      Sets the line of text at the specified index.

      For example, setLine(0, "Line One") will set the first line of text to "Line One".

      Parameters:
      index - Line number to set the text at, starting from 0
      line - New text to set at the specified index
      Throws:
      IndexOutOfBoundsException - If the index is out of the range 0..3
      Since:
      1.0.0
    • isEditable

      @Deprecated(since="1.20.1") boolean isEditable()
      Deprecated.
      use isWaxed() instead
      Marks whether this sign can be edited by players.
      Returns:
      if this sign is currently editable
      Since:
      1.13.1
    • setEditable

      @Deprecated(since="1.20.1") void setEditable(boolean editable)
      Deprecated.
      use setWaxed(boolean) instead
      Marks whether this sign can be edited by players.
      Parameters:
      editable - if this sign is currently editable
      Since:
      1.13.1
    • isWaxed

      boolean isWaxed()
      Gets whether or not this sign has been waxed. If a sign has been waxed, it cannot be edited by a player.
      Returns:
      if this sign is waxed
      Since:
      1.20
    • setWaxed

      void setWaxed(boolean waxed)
      Sets whether or not this sign has been waxed. If a sign has been waxed, it cannot be edited by a player.
      Parameters:
      waxed - if this sign is waxed
      Since:
      1.20
    • isGlowingText

      @Deprecated(since="1.20") boolean isGlowingText()
      Deprecated.
      A sign may have multiple writable sides now. Use getSide(Side) and SignSide.isGlowingText().
      Gets whether this sign has glowing text. Only affects the Side.FRONT.
      Returns:
      if this sign has glowing text
      Since:
      1.17
    • setGlowingText

      @Deprecated(since="1.20") void setGlowingText(boolean glowing)
      Deprecated.
      A sign may have multiple writable sides now. Use getSide(Side) and SignSide.setGlowingText(boolean).
      Sets whether this sign has glowing text. Only affects the Side.FRONT.
      Parameters:
      glowing - if this sign has glowing text
      Since:
      1.17
    • getColor

      Deprecated.
      A sign may have multiple writable sides now. Use getSide(Side) and Colorable.getColor().
      Gets the color of this object.
      This may be null to represent the default color of an object, if the object has a special default color (e.g Shulkers).
      Specified by:
      getColor in interface Colorable
      Returns:
      The DyeColor of this object.
      Since:
      1.19.4
    • setColor

      @Deprecated(since="1.20") void setColor(@NotNull @NotNull DyeColor color)
      Deprecated.
      A sign may have multiple writable sides now. Use getSide(Side) and Colorable.setColor(org.bukkit.DyeColor).
      Sets the color of this object to the specified DyeColor.
      This may be null to represent the default color of an object, if the object has a special default color (e.g Shulkers).
      Specified by:
      setColor in interface Colorable
      Parameters:
      color - The color of the object, as a DyeColor.
      Since:
      1.19.4
    • getSide

      Return the side of the sign.
      Parameters:
      side - the side of the sign
      Returns:
      the selected side of the sign
      Since:
      1.19.4
    • getTargetSide

      Gets the side of this sign the given player is currently standing on.
      Parameters:
      player - the player
      Returns:
      the side the player is standing on
      Since:
      1.20.4
    • getAllowedEditor

      @Nullable @Nullable Player getAllowedEditor()
      Gets the player that is currently allowed to edit this sign.
      Edits from other players will be rejected if this value is not null.

      You should prefer getAllowedEditorUniqueId() if you don't need the player instance as this method will fetch the player from UUID.
      Returns:
      the player allowed to edit this sign, or null
      Since:
      1.20.4
    • getAllowedEditorUniqueId

      @Nullable UUID getAllowedEditorUniqueId()
      Gets the allowed editor's UUID.
      Edits from other players will be rejected if this value is not null.
      Returns:
      the allowed editor's UUID, or null
      Since:
      1.21.1
    • setAllowedEditorUniqueId

      void setAllowedEditorUniqueId(@Nullable UUID uuid)
      Sets the allowed editor's UUID.

      Note: the server sets the UUID back to null if the player can't interact with the sign (is either offline or outside the allowed interaction range).
      Parameters:
      uuid - the allowed editor's UUID
      Since:
      1.21.1
    • getInteractableSideFor

      @NotNull default @NotNull Side getInteractableSideFor(@NotNull Entity entity)
      Compute the side facing the specified entity.
      Parameters:
      entity - the entity
      Returns:
      the side it is facing
      Since:
      1.20.1
    • getInteractableSideFor

      @NotNull default @NotNull Side getInteractableSideFor(@NotNull Position position)
      Compute the side facing the specific position.
      Parameters:
      position - the position
      Returns:
      the side the position is facing
      Since:
      1.20.1
    • getInteractableSideFor

      @NotNull @NotNull Side getInteractableSideFor(double x, double z)
      Compute the side facing the specific x and z coordinates.
      Parameters:
      x - the x coord
      z - the z coord
      Returns:
      the side the coordinates are facing
      Since:
      1.20.1