From 566e7cefa4ea8feea8dd83fee2cc4dc523d695f4 Mon Sep 17 00:00:00 2001 From: Zhea Evyline <99989764+zheaEvyline@users.noreply.github.com> Date: Fri, 3 Jan 2025 20:53:02 +0400 Subject: [PATCH] Update rawtext.md --- docs/concepts/rawtext.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/concepts/rawtext.md b/docs/concepts/rawtext.md index 9b5d44abe90..cc8023a32f4 100644 --- a/docs/concepts/rawtext.md +++ b/docs/concepts/rawtext.md @@ -184,3 +184,19 @@ And instead of an array, you can use a rawtext component, like so. #Output in chat: # Hello Steve and Apple ``` + +*Additional example shared by @CornyFlex:* + +```json +/tellraw @a {"rawtext":[{"translate":"Role: %%%%s","with":{"rawtext":[{"score":{"name":"*","objective":"role"}},{"text":"Member"},{"text":"Moderator"},{"text":"Admin"}]}}]} +``` +This structure allows you to display different text to the selected players based on scores. + +- Output in chat: + - Member + - When 'role' score of the player equals 1. + - Moderator + - When 'role' score of the player equals 2. + - Admin + - When 'role' score of the player equals 3. +> Note: Score must be a positive integer.