# Codex Hub — Help Guide — Admin Panel (tellraw to chat)
# Run as the player (@s = player)
# Gated behind ec.admin tag

# Admin gate
execute unless entity @s[tag=ec.admin] run tellraw @s [{text:"[Admin] ",color:"dark_red"},{text:"Access denied. Use ",color:"gray"},{text:"/tag @s add ec.admin",color:"yellow"},{text:" (requires op)",color:"gray"}]
execute unless entity @s[tag=ec.admin] at @s if score @s ec.fx_snd matches 1.. run playsound minecraft:block.note_block.bass master @s ~ ~ ~ 0.8 0.5
execute unless entity @s[tag=ec.admin] run return 0

# Sound
execute if score @s ec.fx_snd matches 1.. run playsound minecraft:block.note_block.hat master @s ~ ~ ~ 0.5 1.6

# === ADMIN COMMAND PANEL ===
tellraw @s ""
tellraw @s [{text:"  "},{text:"✦ ADMIN COMMANDS ✦",color:"red",bold:true}]
tellraw @s ""

# --- DREAM SURGE ---
tellraw @s [{text:"  ▸ DREAM SURGE",color:"yellow",bold:true}]
tellraw @s [{text:"    "},{text:"[3 min]",color:"light_purple",bold:true,click_event:{action:"run_command",command:"/function evercraft:event/start_short"},hover_event:{action:"show_text",value:"Dream Surge for 3 minutes"}},{text:" "},{text:"[15 min]",color:"light_purple",bold:true,click_event:{action:"run_command",command:"/function evercraft:event/start_medium"},hover_event:{action:"show_text",value:"Dream Surge for 15 minutes"}},{text:" "},{text:"[1 hour]",color:"light_purple",bold:true,click_event:{action:"run_command",command:"/function evercraft:event/start"},hover_event:{action:"show_text",value:"Dream Surge for 1 hour"}},{text:"  "},{text:"[STOP]",color:"red",bold:true,click_event:{action:"run_command",command:"/function evercraft:event/stop"},hover_event:{action:"show_text",value:"End active Dream Surge"}}]
tellraw @s ""

# --- WORLD EVENTS ---
tellraw @s [{text:"  ▸ WORLD EVENTS",color:"yellow",bold:true}]
tellraw @s [{text:"    "},{text:"[Blood Moon]",color:"dark_red",bold:true,click_event:{action:"run_command",command:"/function evercraft:calendar/events/blood_moon/start"},hover_event:{action:"show_text",value:"Enhanced mob spawns, +1 Dream Rate (1 night)"}},{text:" "},{text:"[Harvest Festival]",color:"green",bold:true,click_event:{action:"run_command",command:"/function evercraft:calendar/events/harvest_festival/start"},hover_event:{action:"show_text",value:"+1.5 Dream Rate, 2x crop growth (2 days)"}},{text:" "},{text:"[Meteor Shower]",color:"aqua",bold:true,click_event:{action:"run_command",command:"/function evercraft:calendar/events/meteor_shower/start"},hover_event:{action:"show_text",value:"+0.5 Dream Rate, rare ore falls from sky (1 night)"}}]
tellraw @s [{text:"    "},{text:"[Merchant Caravan]",color:"gold",bold:true,click_event:{action:"run_command",command:"/function evercraft:calendar/events/merchant_caravan/start"},hover_event:{action:"show_text",value:"Traveling merchant with exclusive goods (2 days)"}},{text:" "},{text:"[Fishing Derby]",color:"blue",bold:true,click_event:{action:"run_command",command:"/function evercraft:calendar/events/fishing_derby/start"},hover_event:{action:"show_text",value:"Competitive fishing, 1.5x crate chance (1 day)"}},{text:" "},{text:"[Dimensional Rift]",color:"dark_purple",bold:true,click_event:{action:"run_command",command:"/function evercraft:calendar/events/dimensional_rift/start"},hover_event:{action:"show_text",value:"End/Nether mobs, guaranteed crate drops (10 min)"}}]
tellraw @s [{text:"    "},{text:"[Prosperity Tide]",color:"yellow",bold:true,click_event:{action:"run_command",command:"/function evercraft:calendar/events/prosperity_tide/start"},hover_event:{action:"show_text",value:"+1 Dream Rate, 2x crate/companion rates (1 day)"}}]
tellraw @s [{text:"    "},{text:"[Starfall]",color:"white",bold:true,click_event:{action:"run_command",command:"/function evercraft:world_events/starfall/start"},hover_event:{action:"show_text",value:"+2.0 DR, fallen stars descend (1 night)"}},{text:" "},{text:"[Abyssal Tremor]",color:"dark_gray",bold:true,click_event:{action:"run_command",command:"/function evercraft:world_events/abyssal_tremor/start"},hover_event:{action:"show_text",value:"+1.5 DR deep underground, ancient debris (5 min)"}},{text:" "},{text:"[Aurora Bloom]",color:"green",bold:true,click_event:{action:"run_command",command:"/function evercraft:world_events/aurora_bloom/start"},hover_event:{action:"show_text",value:"+0.5 DR global, 3x plant growth (1 day)"}}]
tellraw @s [{text:"    "},{text:"[Rift Echo]",color:"dark_purple",bold:true,click_event:{action:"run_command",command:"/function evercraft:world_events/rift_echo/start"},hover_event:{action:"show_text",value:"+2.0 DR, Rift Warden boss, enhanced rift mobs (15 min)"}},{text:" "},{text:"[The Dreaming]",color:"light_purple",bold:true,click_event:{action:"run_command",command:"/function evercraft:world_events/the_dreaming/start"},hover_event:{action:"show_text",value:"+10.0 DR, guaranteed Rare+ crates (1 hour)"}}]
tellraw @s ""

# --- SERVER SETTINGS (AU3-P1.1, 2026-06-10 — the treasure/settings data layer's GUI) ---
tellraw @s [{text:"  ▸ SERVER SETTINGS",color:"yellow",bold:true}]
tellraw @s [{text:"    "},{text:"[Treasure Settings]",color:"gold",bold:true,click_event:{action:"run_command",command:"/function evercraft:treasure/settings/panel"},hover_event:{action:"show_text",value:"Mining-treasure rates, progression credit, despawn cadence, Dream-Rate ramp, tier/feature toggles"}}]
tellraw @s ""

# --- SPAWN ALL ---
tellraw @s [{text:"  ▸ SPAWN ALL",color:"yellow",bold:true}]
tellraw @s [{text:"    "},{text:"[All Artifacts]",color:"gold",bold:true,click_event:{action:"run_command",command:"/function evercraft:treasure/test/spawn_artifacts_all"},hover_event:{action:"show_text",value:"ALL artifacts by tier in barrels"}},{text:" "},{text:"[All Pets]",color:"light_purple",bold:true,click_event:{action:"run_command",command:"/function evercraft:companions/test/spawn_all_pets"},hover_event:{action:"show_text",value:"All pets sorted by tier in barrels"}},{text:" "},{text:"[All Crates]",color:"gold",click_event:{action:"run_command",command:"/function evercraft:treasure/test/spawn_all_crates"},hover_event:{action:"show_text",value:"All 4 crate types"}},{text:" "},{text:"[Professions]",color:"green",click_event:{action:"run_command",command:"/function evercraft:professions/test/spawn_all"},hover_event:{action:"show_text",value:"Spawn all professions"}}]
tellraw @s ""

# --- ITEMS & EQUIPMENT ---
tellraw @s [{text:"  ▸ ITEMS & EQUIPMENT",color:"yellow",bold:true}]
tellraw @s [{text:"    "},{text:"[Glyphforge]",color:"dark_purple",bold:true,click_event:{action:"run_command",command:"/function evercraft:glyphforge/give"},hover_event:{action:"show_text",value:"Give a Glyphforge workstation"}},{text:" "},{text:"[Hearthstone]",color:"red",bold:true,click_event:{action:"run_command",command:"/function evercraft:housing/give"},hover_event:{action:"show_text",value:"Give a Hearthstone (housing claim)"}},{text:" "},{text:"[Black Market]",color:"dark_gray",bold:true,click_event:{action:"run_command",command:"/function evercraft:black_market/place_barrel"},hover_event:{action:"show_text",value:"Place a Black Market barrel at your location"}},{text:" "},{text:"[Guidestone]",color:"light_purple",click_event:{action:"run_command",command:"/function evercraft:guidestone/give"},hover_event:{action:"show_text",value:"Give a Guidestone"}}]
tellraw @s [{text:"    "},{text:"[Mythical Tools]",color:"gold",click_event:{action:"run_command",command:"/function evercraft:treasure/test/spawn_mythical_tools"},hover_event:{action:"show_text",value:"All mythical tools"}},{text:" "},{text:"[Shards]",color:"aqua",click_event:{action:"run_command",command:"/function evercraft:treasure/test/spawn_shards"},hover_event:{action:"show_text",value:"Pet + Artifact shards"}},{text:" "},{text:"[Pet Treat]",color:"green",click_event:{action:"run_command",command:"/function evercraft:companions/test/give_pet_treat"},hover_event:{action:"show_text",value:"Give a companion treat"}}]
tellraw @s [{text:"    "},{text:"[Coins x30]",color:"light_purple",click_event:{action:"run_command",command:"/function evercraft:gacha/test/spawn_coins"},hover_event:{action:"show_text",value:"30 Forever Coins"}},{text:" "},{text:"[x25]",color:"light_purple",bold:true,click_event:{action:"run_command",command:"/function evercraft:gacha/test/give_coins_25"},hover_event:{action:"show_text",value:"25 Forever Coins"}},{text:" "},{text:"[x50]",color:"light_purple",bold:true,click_event:{action:"run_command",command:"/function evercraft:gacha/test/give_coins_50"},hover_event:{action:"show_text",value:"50 Forever Coins"}},{text:" "},{text:"[x100]",color:"light_purple",bold:true,click_event:{action:"run_command",command:"/function evercraft:gacha/test/give_coins_100"},hover_event:{action:"show_text",value:"100 Forever Coins"}},{text:" "},{text:"[Awakening Stones]",color:"aqua",bold:true,click_event:{action:"run_command",command:"/function evercraft:weapon_mastery/test/spawn_stones"},hover_event:{action:"show_text",value:"All 6 tiers of Awakening Stones"}},{text:" "},{text:"[All Glyphs]",color:"dark_purple",bold:true,click_event:{action:"run_command",command:"/function evercraft:treasure/test/spawn_glyphs"},hover_event:{action:"show_text",value:"All 13 Glyph runes"}}]
tellraw @s [{text:"    "},{text:"[All DR Items]",color:"yellow",bold:true,click_event:{action:"run_command",command:"/function evercraft:treasure/test/spawn_dr_items"},hover_event:{action:"show_text",value:"All 18 permanent Dream Rate items"}}]
tellraw @s [{text:"    "},{text:"[Biome Armor]",color:"aqua",click_event:{action:"run_command",command:"/function evercraft:treasure/test/spawn_biome_armor"},hover_event:{action:"show_text",value:"Spawn all biome-themed armor sets"}},{text:" "},{text:"[Biome Weapons]",color:"aqua",click_event:{action:"run_command",command:"/function evercraft:treasure/test/spawn_biome_weapons"},hover_event:{action:"show_text",value:"Spawn all biome-themed weapons"}},{text:" "},{text:"[Journey Tools]",color:"aqua",click_event:{action:"run_command",command:"/function evercraft:treasure/test/spawn_journey_tools"},hover_event:{action:"show_text",value:"Spawn journey/exploration tools"}}]
tellraw @s ""
