Skip to content

Commit

Permalink
✨ TellRawCommand able to construct hover text event
Browse files Browse the repository at this point in the history
  • Loading branch information
MrGraversen committed Apr 16, 2021
1 parent 4920490 commit 7943c18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,8 @@ public String command() {

return StringSubstitutor.replace("tellraw ${target} ${rawJson}", variables);
}

public TextContent toTextContent() {
return new TextContent(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public TellRawCommandBuilder withClickEvent(ClickEventActions clickEventAction,
return this;
}

public TellRawCommandBuilder withHoverEvent(HoverEventActions hoverEventAction, String value) {
this.hoverEvent = new HoverEvent(hoverEventAction.name().toLowerCase(), value);
public TellRawCommandBuilder withHoverTextEvent(TellRawCommand tellRawCommand) {
this.hoverEvent = new HoverEvent(HoverEventActions.SHOW_TEXT.name().toLowerCase(), new TextContent[]{tellRawCommand.toTextContent()});
return this;
}

Expand Down

0 comments on commit 7943c18

Please sign in to comment.