Skip to content

Commit c27bcc2

Browse files
committed
Fix invalid example
1 parent 1704f3e commit c27bcc2

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/content/docs/paper/dev/api/dialogs.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -384,12 +384,15 @@ DialogAction.customClick(
384384
int levels = view.getFloat("level").intValue();
385385
float exp = view.getFloat("experience").floatValue();
386386

387-
player.sendRichMessage("You selected <color:#ccfffd><level> levels</color> and <color:#ccfffd><exp>% exp</color> to the next level!",
388-
Placeholder.component("level", Component.text(levels)),
389-
Placeholder.component("exp", Component.text(exp))
390-
);
391-
player.setLevel(levels);
392-
player.setExp(exp / 100);
387+
if (audience instanceof Player player) {
388+
player.sendRichMessage("You selected <color:#ccfffd><level> levels</color> and <color:#ccfffd><exp>% exp</color> to the next level!",
389+
Placeholder.component("level", Component.text(levels)),
390+
Placeholder.component("exp", Component.text(exp))
391+
);
392+
393+
player.setLevel(levels);
394+
player.setExp(exp / 100);
395+
}
393396
},
394397
ClickCallback.Options.builder()
395398
.uses(1) // Set the number of uses for this callback. Defaults to 1

0 commit comments

Comments
 (0)