MC样式

导入相关包

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
Copy
import crafttweaker.api.util.text.MCStyle;

Constructor #构造函数

No Description Provided

ZenScript
Copy
new MCStyle() as MCStyle
new MCStyle();

方法

equals

Return Type: boolean

ZenScript
Copy
MCStyle.equals(other as Object) as boolean
参数类型描述
otherObjectNo Description Provided
getBold

Return Type: boolean

ZenScript
Copy
// MCStyle.getBold() as boolean

myMCStyle.getBold();
getColor

Return Type: int

ZenScript
Copy
// MCStyle.getColor() as int

myMCStyle.getColor();
getFontId

Return Type: MCResourceLocation

ZenScript
Copy
// MCStyle.getFontId() as MCResourceLocation

myMCStyle.getFontId();
getInsertion

Return Type: string

ZenScript
Copy
// MCStyle.getInsertion() as string

myMCStyle.getInsertion();
getItalic

Return Type: boolean

ZenScript
Copy
// MCStyle.getItalic() as boolean

myMCStyle.getItalic();
getObfuscated

Return Type: boolean

ZenScript
Copy
// MCStyle.getObfuscated() as boolean

myMCStyle.getObfuscated();
getStrikethrough

Return Type: boolean

ZenScript
Copy
// MCStyle.getStrikethrough() as boolean

myMCStyle.getStrikethrough();
getUnderlined

Return Type: boolean

ZenScript
Copy
// MCStyle.getUnderlined() as boolean

myMCStyle.getUnderlined();
hashCode

Return Type: int

ZenScript
Copy
// MCStyle.hashCode() as int

myMCStyle.hashCode();
isEmpty

Whether or not this style is empty (inherits everything from the parent).

Return Type: boolean

ZenScript
Copy
// MCStyle.isEmpty() as boolean

myMCStyle.isEmpty();
mergeStyle

Return Type: MCStyle

ZenScript
Copy
MCStyle.mergeStyle(style as MCStyle) as MCStyle
参数类型描述
样式MC样式No Description Provided
setBold

Return Type: MCStyle

ZenScript
Copy
MCStyle.setBold(boldIn as Boolean) as MCStyle
参数类型描述
boldInBooleanNo Description Provided
setColor

Return Type: MCStyle

ZenScript
Copy
MCStyle.setColor(colour as int) as MCStyle
参数类型描述
colourintNo Description Provided
setColor

Return Type: MCStyle

ZenScript
Copy
MCStyle.setColor(formatting as TextFormatting) as MCStyle
参数类型描述
格式化TextFormattingNo Description Provided
setFontId

Return Type: MCStyle

ZenScript
Copy
MCStyle.setFontId(location as MCResourceLocation) as MCStyle
参数类型描述
位置MCResourceLocationNo Description Provided
setFormatting

Return Type: MCStyle

ZenScript
Copy
MCStyle.setFormatting(formatting as TextFormatting) as MCStyle
参数类型描述
格式化TextFormattingNo Description Provided
setInsertion

Set a text to be inserted into Chat when the component is shift-clicked

Return Type: MCStyle

ZenScript
Copy
MCStyle.setInsertion(insertion as string) as MCStyle
参数类型描述
插入stringNo Description Provided
setItalic

Return Type: MCStyle

ZenScript
Copy
MCStyle.setItalic(italic as Boolean) as MCStyle
参数类型描述
italicBooleanNo Description Provided
setObfuscated

Return Type: MCStyle

ZenScript
Copy
MCStyle.setObfuscated(obfuscated as Boolean) as MCStyle
参数类型描述
obfuscatedBooleanNo Description Provided
setStrikethrough

Return Type: MCStyle

ZenScript
Copy
MCStyle.setStrikethrough(strikethrough as Boolean) as MCStyle
参数类型描述
strikethroughBooleanNo Description Provided
setUnderlined

Return Type: MCStyle

ZenScript
Copy
MCStyle.setUnderlined(underlined as Boolean) as MCStyle
参数类型描述
下划线BooleanNo Description Provided
toString

Return Type: string

ZenScript
Copy
// MCStyle.toString() as string

myMCStyle.toString();