I believe that this should be left up to discretion of the editors. Look at the following examples:
- When I see:
-
Use /tellraw
instead of /say
.
- I think:
- Perfect.
- When I see:
-
Here is my full command:
give @s minecraft:diamond_sword{display:{Name:"Awesome Sword"}}
- I think:
- Perfect.
- When I see:
-
Here is my full command:
give @s minecraft:diamond_sword{display:{Name:"Awesome Sword"}}
- I think:
- That looks a little weird. I'll change it to preformatted text.
For small commands, like:
Your use of @e
is wrong, it should be @a
.
Inline code is highly preferred here.
When a full command is provided, preformatted text is better.
But, (and this is a big "but"):
When I see:
Here is my full command:summon falling_block ~ ~1 ~ {Time:1,BlockState:{Name:redstone_block},Passengers:[{id:armor_stand,Health:0,Passengers:[{id:falling_block,Time:1,BlockState:{Name:activator_rail},Passengers:[{id:command_block_minecart,Command:'gamerule commandBlockOutput false'},{id:command_block_minecart,Command:'data merge block ~ ~-2 ~ {auto:0}'},{id:command_block_minecart,Command:'fill ~3 ~-1 ~2 ~8 ~6 ~-2 gray_stained_glass hollow'},{id:command_block_minecart,Command:'fill ~3 ~-1 ~2 ~8 ~-1 ~-2 smooth_stone_slab[type=top]'},{id:command_block_minecart,Command:'playsound block.piston.extend ambient @a'},{id:command_block_minecart,Command:'fill ~3 ~6 ~2 ~8 ~6 ~-2 smooth_stone_slab[type=bottom]'},{id:command_block_minecart,Command:'setblock ~4 ~ ~-1 repeating_command_block[facing=east]{Command:"tag @e[nbt={OnGround:1b,Item:{id:\\"iron_block\\",Count:4b}}] add irondoor1"}'},{id:command_block_minecart,Command:'data merge block ~4 ~ ~-1 {auto:1b}'},{id:command_block_minecart,Command:'setblock ~5 ~ ~-1 chain_command_block[facing=east]{Command:"tag @e[nbt={OnGround:1b,Item:{id:\\"sticky_piston\\",Count:2b}}] add irondoor2"}'},{id:command_block_minecart,Command:'data merge block ~5 ~ ~-1 {auto:1b}'},{id:command_block_minecart,Command:'setblock ~6 ~ ~-1 chain_command_block[facing=east]{Command:"execute at @e[tag=irondoor1] as @e[tag=irondoor2,distance=..1] run summon item ~ ~ ~ {Tags:[\\"itemkill1\\",\\"IronDoorSpawn\\"],PickupDelay:20,Item:{id:\\"minecraft:stray_spawn_egg\\",Count:1b,tag:{display:{Name:\\"{\\"text\\":\\"2 x 2 Iron Door\\"}\\"},HideFlags:1,EntityTag:{id:\\"minecraft:silverfish\\",NoAI:1b,NoGravity:1b,PersistenceRequired:1b,Silent:1b,Health:0}}}}"}'},{id:command_block_minecart,Command:'data merge block ~6 ~ ~-1 {auto:1b}'},{id:command_block_minecart,Command:'setblock ~ ~1 ~ command_block{auto:1,Command:"fill ~ ~ ~ ~ ~-2 ~ air"}'},{id:command_block_minecart,Command:'kill @e[type=command_block_minecart,distance=..1]'}]}]}]}
I think:
JUST PLAIN ANNOYING!!!
If your command gets so long that it would be annoying to scroll through it to find errors, a preformatted text block is just plain annoying. I know inline code wraps, but better that than scroll through it to find errors. So, I would prefer this:
Here is my full command:summon falling_block ~ ~1 ~ {Time:1,BlockState:{Name:redstone_block},Passengers:[{id:armor_stand,Health:0,Passengers:[{id:falling_block,Time:1,BlockState:{Name:activator_rail},Passengers:[{id:command_block_minecart,Command:'gamerule commandBlockOutput false'},{id:command_block_minecart,Command:'data merge block ~ ~-2 ~ {auto:0}'},{id:command_block_minecart,Command:'fill ~3 ~-1 ~2 ~8 ~6 ~-2 gray_stained_glass hollow'},{id:command_block_minecart,Command:'fill ~3 ~-1 ~2 ~8 ~-1 ~-2 smooth_stone_slab[type=top]'},{id:command_block_minecart,Command:'playsound block.piston.extend ambient @a'},{id:command_block_minecart,Command:'fill ~3 ~6 ~2 ~8 ~6 ~-2 smooth_stone_slab[type=bottom]'},{id:command_block_minecart,Command:'setblock ~4 ~ ~-1 repeating_command_block[facing=east]{Command:"tag @e[nbt={OnGround:1b,Item:{id:\\"iron_block\\",Count:4b}}] add irondoor1"}'},{id:command_block_minecart,Command:'data merge block ~4 ~ ~-1 {auto:1b}'},{id:command_block_minecart,Command:'setblock ~5 ~ ~-1 chain_command_block[facing=east]{Command:"tag @e[nbt={OnGround:1b,Item:{id:\\"sticky_piston\\",Count:2b}}] add irondoor2"}'},{id:command_block_minecart,Command:'data merge block ~5 ~ ~-1 {auto:1b}'},{id:command_block_minecart,Command:'setblock ~6 ~ ~-1 chain_command_block[facing=east]{Command:"execute at @e[tag=irondoor1] as @e[tag=irondoor2,distance=..1] run summon item ~ ~ ~ {Tags:[\\"itemkill1\\",\\"IronDoorSpawn\\"],PickupDelay:20,Item:{id:\\"minecraft:stray_spawn_egg\\",Count:1b,tag:{display:{Name:\\"{\\"text\\":\\"2 x 2 Iron Door\\"}\\"},HideFlags:1,EntityTag:{id:\\"minecraft:silverfish\\",NoAI:1b,NoGravity:1b,PersistenceRequired:1b,Silent:1b,Health:0}}}}"}'},{id:command_block_minecart,Command:'data merge block ~6 ~ ~-1 {auto:1b}'},{id:command_block_minecart,Command:'setblock ~ ~1 ~ command_block{auto:1,Command:"fill ~ ~ ~ ~ ~-2 ~ air"}'},{id:command_block_minecart,Command:'kill @e[type=command_block_minecart,distance=..1]'}]}]}]}
but I do agree that this still has its downsides.
In fact, here's something that is even better. Organize your NBT in a very perfect way:
Here is my full command:
summon falling_block ~ ~1 ~
{
Time: 1,
BlockState: {
Name: "redstone_block"
},
Passengers: [
{
id: "armor_stand",
Health: 0,
Passengers:[
{
id: falling_block, Time:1, BlockState: {Name:activator_rail},
Passengers:[
{id:command_block_minecart,Command:'gamerule commandBlockOutput false'},
{id:command_block_minecart,Command:'data merge block ~ ~-2 ~ {auto:0}'},
{id:command_block_minecart,Command:'fill ~3 ~-1 ~2 ~8 ~6 ~-2 gray_stained_glass hollow'},
{id:command_block_minecart,Command:'fill ~3 ~-1 ~2 ~8 ~-1 ~-2 smooth_stone_slab[type=top]'},
{id:command_block_minecart,Command:'playsound block.piston.extend ambient @a'},
{id:command_block_minecart,Command:'fill ~3 ~6 ~2 ~8 ~6 ~-2 smooth_stone_slab[type=bottom]'},
{id:command_block_minecart,Command:'setblock ~4 ~ ~-1 repeating_command_block[facing=east]{Command:"tag @e[nbt={OnGround:1b,Item:{id:\\"iron_block\\",Count:4b}}] add irondoor1"}'},
{id:command_block_minecart,Command:'data merge block ~4 ~ ~-1 {auto:1b}'},
{id:command_block_minecart,Command:'setblock ~5 ~ ~-1 chain_command_block[facing=east]{Command:"tag @e[nbt={OnGround:1b,Item:{id:\\"sticky_piston\\",Count:2b}}] add irondoor2"}'},
{id:command_block_minecart,Command:'data merge block ~5 ~ ~-1 {auto:1b}'},
{id:command_block_minecart,Command:'setblock ~6 ~ ~-1 chain_command_block[facing=east]{Command:"execute at @e[tag=irondoor1] as @e[tag=irondoor2,distance=..1] run summon item ~ ~ ~ {Tags:[\\"itemkill1\\",\\"IronDoorSpawn\\"],PickupDelay:20,Item:{id:\\"minecraft:stray_spawn_egg\\",Count:1b,tag:{display:{Name:\\"{\\"text\\":\\"2 x 2 Iron Door\\"}\\"},HideFlags:1,EntityTag:{id:\\"minecraft:silverfish\\",NoAI:1b,NoGravity:1b,PersistenceRequired:1b,Silent:1b,Health:0}}}}"}'},
{id:command_block_minecart,Command:'data merge block ~6 ~ ~-1 {auto:1b}'},
{id:command_block_minecart,Command:'setblock ~ ~1 ~ command_block{auto:1,Command:"fill ~ ~ ~ ~ ~-2 ~ air"}'},
{id:command_block_minecart,Command:'kill @e[type=command_block_minecart,distance=..1]'}
]
}
]
}
]
}
That was my full NBT data, and each of those passengers is one command block minecart. Now, here is the NBT of the command block minecart I need help with, and here is each individual layer:
# NBT of command block Minecart
{
id: "command_block_minecart",
Command:'<A>'
}
# A: Command in the command block minecart
setblock ~6 ~ ~-1 chain_command_block[facing=east]{Command:"<B>"}
# B: Command in the chain command block:
execute at @e[tag=irondoor1] as @e[tag=irondoor2,distance=..1] run summon item ~ ~ ~ {Tags:["itemkill1","IronDoorSpawn"],PickupDelay:20,Item:{id:"minecraft:stray_spawn_egg",Count:1b,tag:{display:{Name:"<D>"},HideFlags:1,EntityTag:{id:"minecraft:silverfish",NoAI:1b,NoGravity:1b,PersistenceRequired:1b,Silent:1b,Health:0}}}}
# C: JSON text for the item name
{"text":"2 x 2 Iron Door"}
What escape sequence do I need to put on the quotation marks in C, so that I can nest C inside B, and B inside A?