Package org.bukkit.block

# Interface Sign

All Superinterfaces:
  `BlockState`, `Colorable`, `Metadatable`, `PersistentDataHolder`, `TileState`

All Known Subinterfaces:
  `HangingSign`

public interface Sign extends TileState, Colorable
Represents a captured state of either a SignPost or a WallSign.

## Method Summary

Modifier and Type
Method
Description
`@NotNull String`
`getLine(int index)`
Deprecated.
in favour of `line(int)`
`@NotNull String[]`
`getLines()`
Deprecated.
in favour of `lines()`
`boolean`
`isEditable()`
Marks whether this sign can be edited by players.
`boolean`
`isGlowingText()`
Gets whether this sign has glowing text.
`Component`
`line(int index)`
Gets the line of text at the specified index.
`void`
`line(int index, Component line)`
Sets the line of text at the specified index.
`List<Component>`
`lines()`
Gets all the lines of text currently on this sign.
`void`
`setEditable(boolean editable)`
Marks whether this sign can be edited by players.
`void`
`setGlowingText(boolean glowing)`
Sets whether this sign has glowing text.
`void`
`setLine(int index, @NotNull String line)`
Deprecated.
in favour of `line(int, net.kyori.adventure.text.Component)`

### Methods inherited from interface org.bukkit.block.BlockState

`getBlock, getBlockData, getChunk, getData, getDrops, getDrops, getDrops, getLightLevel, getLocation, getLocation, getRawData, getType, getWorld, getX, getY, getZ, isCollidable, isPlaced, setBlockData, setData, setRawData, setType, update, update, update`

### Methods inherited from interface org.bukkit.material.Colorable

`getColor, setColor`

### Methods inherited from interface org.bukkit.metadata.Metadatable

`getMetadata, hasMetadata, removeMetadata, setMetadata`

### Methods inherited from interface org.bukkit.block.TileState

`getPersistentDataContainer, isSnapshot`

## Method Details

### lines

@NotNull List<Component> lines()
Gets all the lines of text currently on this sign.

Returns:
  Array of Strings containing each line of text

### line

@NotNull Component line(int index) throws IndexOutOfBoundsException
Gets the line of text at the specified index.

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

### line

void line(int index, @NotNull Component line) throws IndexOutOfBoundsException
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

### getLines

@NotNull @Deprecated @NotNull String[] getLines()
Deprecated.
in favour of `lines()`
Gets all the lines of text currently on this sign.

Returns:
  Array of Strings containing each line of text

### getLine

@NotNull @Deprecated @NotNull String getLine(int index) throws IndexOutOfBoundsException
Deprecated.
in favour of `line(int)`
Gets the line of text at the specified index.

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

### setLine

@Deprecated void setLine(int index, @NotNull @NotNull String line) throws IndexOutOfBoundsException
Deprecated.
in favour of `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

### isEditable

boolean isEditable()
Marks whether this sign can be edited by players.
This is a special value, which is not persisted. It should only be set if a placed sign is manipulated during the BlockPlaceEvent. Behaviour outside of this event is undefined.

Returns:
  if this sign is currently editable

### setEditable

void setEditable(boolean editable)
Marks whether this sign can be edited by players.
This is a special value, which is not persisted. It should only be set if a placed sign is manipulated during the BlockPlaceEvent. Behaviour outside of this event is undefined.

Parameters:
  `editable` - if this sign is currently editable

### isGlowingText

boolean isGlowingText()
Gets whether this sign has glowing text.

Returns:
  if this sign has glowing text

### setGlowingText

void setGlowingText(boolean glowing)
Sets whether this sign has glowing text.

Parameters:
  `glowing` - if this sign has glowing text