Package me.neznamy.tab.api.chat
Class ChatModifier
java.lang.Object
me.neznamy.tab.api.chat.ChatModifier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBold()getColor()getFont()booleanisBold()Returns true if bold is defined and set to true, false otherwisebooleanisItalic()Returns true if italic is defined and set to true, false otherwisebooleanReturns true if obfuscation is defined and set to true, false otherwisebooleanReturns true if strikethrough is defined and set to true, false otherwisebooleanReturns true if underlined is defined and set to true, false otherwisevoidonClick(ChatClickable.EnumClickAction action, String value) voidonClickChangePage(int newPage) Sets click action to CHANGE_PAGE and page id to given valuevoidonClickCopyToClipBoard(String text) Sets click action to COPY_TO_CLIPBOARD and text to provided valuevoidonClickOpenUrl(String url) Sets click action to OPEN_URL and url to given valuevoidonClickRunCommand(String command) Sets click action to RUN_COMMAND and command to given valuevoidonClickSuggestCommand(String command) Sets click action to SUGGEST_COMMAND and command to given valuevoidonHover(ChatHoverable.EnumHoverAction action, IChatBaseComponent value) voidonHoverShowEntity(String type, UUID id, String name) Sets hover action to SHOW_ENTITY and entity data to given valuesvoidonHoverShowItem(String serializedItem) Sets hover action to SHOW_ITEM and item to given valuevoidSets hover action to SHOW_TEXT and text to given valueorg.json.simple.JSONObjectvoidvoidsetClickEvent(ChatClickable clickEvent) voidvoidvoidsetHoverEvent(ChatHoverable hoverEvent) voidvoidsetObfuscated(Boolean obfuscated) voidsetStrikethrough(Boolean strikethrough) voidsetTargetVersion(ProtocolVersion targetVersion) voidsetUnderlined(Boolean underlined)
-
Constructor Details
-
ChatModifier
public ChatModifier() -
ChatModifier
-
-
Method Details
-
getColor
-
setColor
-
getBold
-
setBold
-
getItalic
-
setItalic
-
getUnderlined
-
setUnderlined
-
getStrikethrough
-
setStrikethrough
-
getObfuscated
-
setObfuscated
-
isBold
public boolean isBold()Returns true if bold is defined and set to true, false otherwise- Returns:
- true if bold is defined and set to true, false otherwise
-
isItalic
public boolean isItalic()Returns true if italic is defined and set to true, false otherwise- Returns:
- true if italic is defined and set to true, false otherwise
-
isUnderlined
public boolean isUnderlined()Returns true if underlined is defined and set to true, false otherwise- Returns:
- true if underlined is defined and set to true, false otherwise
-
isStrikethrough
public boolean isStrikethrough()Returns true if strikethrough is defined and set to true, false otherwise- Returns:
- true if strikethrough is defined and set to true, false otherwise
-
isObfuscated
public boolean isObfuscated()Returns true if obfuscation is defined and set to true, false otherwise- Returns:
- true if obfuscation is defined and set to true, false otherwise
-
getClickEvent
-
setClickEvent
-
getHoverEvent
-
setHoverEvent
-
onClickOpenUrl
Sets click action to OPEN_URL and url to given value- Parameters:
url- url to open
-
onClickRunCommand
Sets click action to RUN_COMMAND and command to given value- Parameters:
command- command to perform, might be without / to send a chat message
-
onClickSuggestCommand
Sets click action to SUGGEST_COMMAND and command to given value- Parameters:
command- command to suggest
-
onClickChangePage
public void onClickChangePage(int newPage) Sets click action to CHANGE_PAGE and page id to given value- Parameters:
newPage- id of new page
-
onClickCopyToClipBoard
Sets click action to COPY_TO_CLIPBOARD and text to provided value- Parameters:
text- text to copy to clipboard on click
-
onClick
-
onHoverShowText
Sets hover action to SHOW_TEXT and text to given value- Parameters:
text- text to show
-
onHoverShowItem
Sets hover action to SHOW_ITEM and item to given value- Parameters:
serializedItem- item to show
-
onHoverShowEntity
Sets hover action to SHOW_ENTITY and entity data to given values- Parameters:
type- entity typeid- entity uuidname- entity custom name
-
onHover
-
getFont
-
setFont
-
serialize
public org.json.simple.JSONObject serialize() -
getMagicCodes
-
setTargetVersion
-
getTargetVersion
-