Files
mc_datapack/music_quiz/data/mq/function/videos/macro/cmd.mcfunction
tkrmagid-desktop eeb9b56010 수정
2026-06-05 18:11:14 +09:00

17 lines
1.9 KiB
MCFunction

# 모드 명령을 "큐(mq:main video.cmdq)"에 문자열로 적재한다. 실제 실행은 매 tick
# videos/drain 이 command_block 으로 하나씩 처리한다. 데이터팩 로드 시 모드 명령을
# 직접 파싱하지 않으므로 영상 모드가 없어도 게임이 동작한다.
# delete : videoDelete
# play : videoPlace (캐시 추적중이면 video_N, 아니면 전체 URL)
# cache_add : videoCache add (이미 추적중이면 skip, 아니면 추적목록 append)
# cache_remove : videoCache remove
# cache_clear : videoCache clear
$execute if data storage mq:tmp {video:{cmd:"delete"}} run data modify storage mq:main video.cmdq append value {c:"videoDelete $(x) $(y) $(z)"}
$execute if data storage mq:tmp {video:{cmd:"play"}} if data storage mq:main video.cached[{i:$(num)}] run data modify storage mq:main video.cmdq append value {c:"videoPlace $(x) $(y) $(z) $(facing) $(w) $(h) $(sound) video_$(num)"}
$execute if data storage mq:tmp {video:{cmd:"play"}} unless data storage mq:main video.cached[{i:$(num)}] run data modify storage mq:main video.cmdq append value {c:"videoPlace $(x) $(y) $(z) $(facing) $(w) $(h) $(sound) $(namespace)/$(num)"}
$execute if data storage mq:tmp {video:{cmd:"cache_add"}} if data storage mq:main video.cached[{i:$(num)}] run return 0
$execute if data storage mq:tmp {video:{cmd:"cache_add"}} run data modify storage mq:main video.cmdq append value {c:"videoCache add video_$(num) $(namespace)/$(num)"}
$execute if data storage mq:tmp {video:{cmd:"cache_add"}} run data modify storage mq:main video.cached append value {i:$(num)}
$execute if data storage mq:tmp {video:{cmd:"cache_remove"}} run data modify storage mq:main video.cmdq append value {c:"videoCache remove video_$(num)"}
execute if data storage mq:tmp {video:{cmd:"cache_clear"}} run data modify storage mq:main video.cmdq append value {c:"videoCache clear"}