---
sidebarDepth: 1
---
# 告示牌
## GetSignBlockText
服务端
method in mod.server.component.blockInfoCompServer.BlockInfoComponentServer
- 描述
获取告示牌(方块)的文本内容
- 参数
| 参数名 |
数据类型
| 说明 |
| :--- | :--- | :--- |
| pos | tuple(int,int,int) | 告示牌的位置坐标 |
| dimensionId | int | 告示牌所在维度 |
| side | int | 设置 正/反 面的文本样式,0表示正面,1表示背面,默认为正面 |
- 返回值
| 数据类型
| 说明 |
| :--- | :--- |
| str | 告示牌上的文本内容 |
- 备注
- 当输入的坐标位置的方块不是告示牌的时候,返回None
- 示例
```python
import mod.server.extraServerApi as serverApi
comp = serverApi.GetEngineCompFactory().CreateBlockInfo(levelId)
pos = (-1, 4, 34)
dimensionId = 0
text = comp.GetSignBlockText(pos, dimensionId)
print "GetSignBlockText text={}".format(text)
```
## GetSignTextStyle
服务端
method in mod.server.component.blockEntityCompServer.BlockEntityCompServer
- 描述
获取告示牌的文本样式信息
- 参数
| 参数名 | 数据类型
| 说明 |
| :--- | :--- | :--- |
| pos | tuple(int,int,int) | 方块位置 |
| dimensionId | int | 方块所在维度 |
| side | int | 告示牌正/背面,0表示正面,1表示背面,默认为正面 |
- 返回值
| 数据类型
| 说明 |
| :--- | :--- |
| dict | 样式信息颜色rgba和发光,格式:{“color”:(flota,float,float,float),"lighting":bool} |
- 示例
```python
import mod.server.extraServerApi as serverApi
comp = serverApi.GetEngineCompFactory().CreateBlockEntity(levelId)
print comp.GetSignTextStyle((x, y, z), 0)
```
## SetSignBlockText
服务端
method in mod.server.component.blockInfoCompServer.BlockInfoComponentServer
- 描述
设置告示牌(方块)的文本内容
- 参数
| 参数名 | 数据类型
| 说明 |
| :--- | :--- | :--- |
| pos | tuple(int,int,int) | 告示牌的位置坐标 |
| text | str | 想要设置的文本内容 |
| dimensionId | int | 告示牌所在维度 |
| side | int | 设置 正/反 面的文本样式,0表示正面,1表示背面,默认为正面 |
- 返回值
| 数据类型
| 说明 |
| :--- | :--- |
| bool | 是否设置成功 |
- 示例
```python
import mod.server.extraServerApi as serverApi
comp = serverApi.GetEngineCompFactory().CreateBlockInfo(playerId)
pos = (-1, 4, 34)
dimensionId = 0
suc = comp.SetSignBlockText(pos, "文本内容", dimensionId)
print "SetSignBlockText suc={}".format(suc)
```
## SetSignTextStyle
服务端
method in mod.server.component.blockEntityCompServer.BlockEntityCompServer
- 描述
设置告示牌的文本样式
- 参数
| 参数名 | 数据类型
| 说明 |
| :--- | :--- | :--- |
| pos | tuple(int,int,int) | 方块位置 |
| dimensionId | int | 方块所在维度 |
| color | tuple(float,float,float,float) | 颜色通道值(r, g, b, a) |
| lighting | bool | 是否发光,即是否显示被发光墨囊染色后的效果 |
| side | int | 设置 正/反 面的文本样式,0表示正面,1表示背面,默认为正面 |
- 返回值
| 数据类型
| 说明 |
| :--- | :--- |
| bool | 是否设置成功 |
- 示例
```python
import mod.server.extraServerApi as serverApi
comp = serverApi.GetEngineCompFactory().CreateBlockEntity(levelId)
print comp.SetSignTextStyle((x, y, z), 0, (0, 1, 0, 0.5), True)
```