Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#> debug:print_with_alternating_colors.m
#
# tellraw を出力ごとに別の色で出力します
#
# @input args
# Message: string (TextComponent) | TextComponent
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@input args の型表記が、このコードベースでよく使われている string(TextComponent) 表記と異なり、string (TextComponent) | TextComponent になっています(例: TheSkyBlessing/data/api/functions/button/core/create_text_component.m.mcfunction:3)。表記を既存の形式に統一し、実際に受け付ける形式(TextComponent オブジェクト/配列/文字列)もコメントと実装で一致させてください。

Suggested change
# Message: string (TextComponent) | TextComponent
# Message: string(TextComponent)

Copilot uses AI. Check for mistakes.
# @api

#> private
# @private
#declare storage debug:print_with_alternating_colors

# "odd" <=> "even"
execute if data storage debug:print_with_alternating_colors {n:"odd" } run data modify storage debug:print_with_alternating_colors n set value "temp"
execute unless data storage debug:print_with_alternating_colors {n:"temp"} run data modify storage debug:print_with_alternating_colors n set value "odd"
execute if data storage debug:print_with_alternating_colors {n:"temp"} run data modify storage debug:print_with_alternating_colors n set value "even"

# 出力
$execute if data storage debug:print_with_alternating_colors {n:"odd" } run tellraw @a {"text":"","extra":$(Message),"color":"#FFFFFF"}
$execute if data storage debug:print_with_alternating_colors {n:"even"} run tellraw @a {"text":"","extra":$(Message),"color":"#C0C0C0"}
Comment on lines +19 to +20
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tellraw の JSON で extra は配列が必須ですが、ここでは extra:$(Message) になっていて Message が TextComponent オブジェクトの場合に JSON が不正になります(例: {...} がそのまま入る)。Message を 1 要素の配列に入れる形(または引数型を配列に統一)にして、常に有効な TextComponent になるよう修正してください。

Suggested change
$execute if data storage debug:print_with_alternating_colors {n:"odd" } run tellraw @a {"text":"","extra":$(Message),"color":"#FFFFFF"}
$execute if data storage debug:print_with_alternating_colors {n:"even"} run tellraw @a {"text":"","extra":$(Message),"color":"#C0C0C0"}
$execute if data storage debug:print_with_alternating_colors {n:"odd" } run tellraw @a {"text":"","extra":[$(Message)],"color":"#FFFFFF"}
$execute if data storage debug:print_with_alternating_colors {n:"even"} run tellraw @a {"text":"","extra":[$(Message)],"color":"#C0C0C0"}

Copilot uses AI. Check for mistakes.