Updated:
Place a sign with text
| Version | Command |
|---|---|
| Java 1.21.5+ | /setblock ~ ~ ~1 minecraft:oak_sign{ |
| Java 1.20–1.21.4 | /setblock ~ ~ ~1 minecraft:oak_sign{ |
messages holds the four lines and must always have four entries, so write empty strings for unused lines. Since 1.20 signs have two sides: front_text and back_text. Versions before 1.20 used Text1 to Text4 instead.
Direction and sign type
- Standing sign:
oak_sign[rotation=8], where 0 faces south, 4 west, 8 north and 12 east. - Wall sign:
oak_wall_sign[facing=north]. It breaks if there is no block behind it. - Hanging sign (1.20+):
oak_hanging_sign. - Wood type: replace
oakwithspruce,cherry,bambooand so on.
Color, glowing text and wax
# Java 1.21.5+
/setblock ~ ~ ~1 minecraft:oak_sign{is_waxed:1b,front_text:{color:"yellow",has_glowing_text:1b,messages:["Notice","","",""]}}
colordyes all the text on that side, using dye names such asyelloworlight_blue.has_glowing_text:1bworks like a glow ink sac, so the text is readable in the dark.is_waxed:1bworks like honeycomb: players can no longer edit the text.
Warp signs
# Java 1.21.5+
/setblock ~ ~ ~1 minecraft:oak_sign{is_waxed:1b,front_text:{messages:[{text:"[Go to lobby]",color:"aqua",click_event:{action:"run_command",command:"/tp @s 0 64 0"}},"","",""]}}
# Java 1.20–1.21.4 (the first line)
'{"text":"[Go to lobby]","color":"aqua","clickEvent":{"action":"run_command","value":"/tp @s 0 64 0"}}'
Clicking the text runs the command as the player who clicked. Unlike books and chat, sign clicks can run commands such as /tp for players without operator rights, which is why warp signs are a common server feature. In 1.21.5 clickEvent became click_event and value became command.
Give a pre-written sign
# Java 1.21.5+
/give @p minecraft:oak_sign[block_entity_data={id:"minecraft:sign",front_text:{messages:["Welcome","","",""]}}]
The sign already has its text when placed. block_entity_data needs id:"minecraft:sign" (minecraft:hanging_sign for hanging signs).
Bedrock Edition
Bedrock commands cannot set sign text. Write a sign by hand, save it with /structure, and load copies where you need them.
Common problems
- The sign is blank: the format does not match your version, such as
Text1on 1.20+ or the 1.21.5 format on 1.21.4. - Error:
messagesmust have exactly four entries, including empty lines. - Nothing changes on an existing sign: /setblock can fail when the same block is already there. Set it to
airfirst. - Clicking does nothing: only the text with the click event reacts, and the key must match your version (
clickEventorclick_event).
Common questions
- Both sides? Yes, from 1.20 write
back_textthe same way. - How long can a line be? About 15 average Latin characters; anything wider is cut off.
- Can signs be protected? Not individually. Use Adventure mode or spawn protection.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.