Style
Link to style
导入类
Link to 导入类
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport crafttweaker.api.text.Style;
Static Methods
Link to static-methods
使用方式
Link to 使用方式
Name: applyFormat
Return Type: Style
ZenScript CopyStyle.applyFormat(format as ChatFormatting) as Style
参数 | 类型 |
---|---|
参数 format | 类型 ChatFormatting |
Name: applyFormats
Return Type: Style
ZenScript CopyStyle.applyFormats(formattings as ChatFormatting[]) as Style
参数 | 类型 |
---|---|
参数 formattings | 类型 ChatFormatting[] |
Name: applyLegacyFormat
Return Type: Style
ZenScript CopyStyle.applyLegacyFormat(format as ChatFormatting) as Style
参数 | 类型 |
---|---|
参数 format | 类型 ChatFormatting |
Name: getColor
Return Type: TextColor?
ZenScript Copy// Style.getColor() as TextColor?
myStyle.getColor();
Name: getFont
Return Type: ResourceLocation
ZenScript Copy// Style.getFont() as ResourceLocation
myStyle.getFont();
Name: getInsertion
Return Type: string?
ZenScript Copy// Style.getInsertion() as string?
myStyle.getInsertion();
Name: isBold
Return Type: boolean
ZenScript Copy// Style.isBold() as boolean
myStyle.isBold();
Name: isEmpty
Return Type: boolean
ZenScript Copy// Style.isEmpty() as boolean
myStyle.isEmpty();
Name: isItalic
Return Type: boolean
ZenScript Copy// Style.isItalic() as boolean
myStyle.isItalic();
Name: isObfuscated
Return Type: boolean
ZenScript Copy// Style.isObfuscated() as boolean
myStyle.isObfuscated();
Name: isStrikethrough
Return Type: boolean
ZenScript Copy// Style.isStrikethrough() as boolean
myStyle.isStrikethrough();
Name: isUnderlined
Return Type: boolean
ZenScript Copy// Style.isUnderlined() as boolean
myStyle.isUnderlined();
Name: setObfuscated
Return Type: Style
ZenScript Copy// Style.setObfuscated() as Style
myStyle.setObfuscated();
Name: setStrikethrough
Return Type: Style
ZenScript Copy// Style.setStrikethrough() as Style
myStyle.setStrikethrough();
Name: setUnderlined
Return Type: Style
ZenScript Copy// Style.setUnderlined() as Style
myStyle.setUnderlined();
Name: withBold
Return Type: Style
ZenScript CopyStyle.withBold(value as bool?) as Style
参数 | 类型 |
---|---|
参数 value | 类型 bool? |
Name: withColor
Return Type: Style
ZenScript CopyStyle.withColor(color as int) as Style
参数 | 类型 |
---|---|
参数 color | 类型 int |
Name: withColor
Return Type: Style
ZenScript CopyStyle.withColor(formatting as ChatFormatting?) as Style
参数 | 类型 |
---|---|
参数 格式化 | 类型 ChatFormatting? |
Name: withFont
Return Type: Style
ZenScript CopyStyle.withFont(fontId as ResourceLocation?) as Style
参数 | 类型 |
---|---|
参数 fontId | 类型 ResourceLocation? |
Name: withInsertion
Return Type: Style
ZenScript CopyStyle.withInsertion(content as string?) as Style
参数 | 类型 |
---|---|
参数 内容 | 类型 string? |
Name: withItalic
Return Type: Style
ZenScript CopyStyle.withItalic(value as bool?) as Style
参数 | 类型 |
---|---|
参数 value | 类型 bool? |
Name: withObfuscated
Return Type: Style
ZenScript CopyStyle.withObfuscated(value as bool?) as Style
参数 | 类型 |
---|---|
参数 value | 类型 bool? |
Name: withStrikethrough
Return Type: Style
ZenScript CopyStyle.withStrikethrough(value as bool?) as Style
参数 | 类型 |
---|---|
参数 value | 类型 bool? |
Name: withUnderlined
Return Type: Style
ZenScript CopyStyle.withUnderlined(value as bool?) as Style
参数 | 类型 |
---|---|
参数 value | 类型 bool? |
名称 | 类型 | 可获得 | 可设置 |
---|---|---|---|
名称 bold | 类型 布尔值 | 可获得 true | 可设置 false |
名称 color | 类型 TextColor? | 可获得 true | 可设置 false |
名称 empty | 类型 布尔值 | 可获得 true | 可设置 false |
名称 font | 类型 资源位置 | 可获得 true | 可设置 false |
名称 插入 | 类型 string? | 可获得 true | 可设置 false |
名称 italic | 类型 布尔值 | 可获得 true | 可设置 false |
名称 obfucated | 类型 布尔值 | 可获得 true | 可设置 false |
名称 strikethrough | 类型 布尔值 | 可获得 true | 可设置 false |
名称 下划线 | 类型 布尔值 | 可获得 true | 可设置 false |