├── doudizhu ├── data │ ├── doudizhu │ │ ├── functions │ │ │ ├── loop │ │ │ │ ├── saturation.mcfunction │ │ │ │ ├── gamemode_change.mcfunction │ │ │ │ ├── timer.mcfunction │ │ │ │ ├── slime.mcfunction │ │ │ │ ├── tp_first_players.mcfunction │ │ │ │ ├── clear_rclick.mcfunction │ │ │ │ ├── amplify.mcfunction │ │ │ │ ├── leave_hint.mcfunction │ │ │ │ ├── show_abandoned_cards.mcfunction │ │ │ │ ├── jiao_see3.mcfunction │ │ │ │ ├── jiao_see1.mcfunction │ │ │ │ ├── jiao_see2.mcfunction │ │ │ │ ├── detect_empty2.mcfunction │ │ │ │ ├── qiang_see3.mcfunction │ │ │ │ ├── qiang_see2.mcfunction │ │ │ │ ├── qiang_see1.mcfunction │ │ │ │ ├── bgm_ctrl.mcfunction │ │ │ │ ├── see1.mcfunction │ │ │ │ ├── see2.mcfunction │ │ │ │ ├── see3.mcfunction │ │ │ │ ├── detect_green_dye.mcfunction │ │ │ │ ├── high_light.mcfunction │ │ │ │ ├── detect_empty1.mcfunction │ │ │ │ ├── see.mcfunction │ │ │ │ └── rt.mcfunction │ │ │ ├── debug │ │ │ │ ├── sw1.mcfunction │ │ │ │ ├── sw2.mcfunction │ │ │ │ └── sw3.mcfunction │ │ │ ├── show_outcards_elapse.mcfunction │ │ │ ├── reset_scores.mcfunction │ │ │ ├── radix_sort.mcfunction │ │ │ ├── play_explosion.mcfunction │ │ │ ├── shuffle.mcfunction │ │ │ ├── recursive │ │ │ │ ├── radix_sort_merge0.mcfunction │ │ │ │ ├── radix_sort_merge1.mcfunction │ │ │ │ ├── radix_sort_merge2.mcfunction │ │ │ │ ├── radix_sort_merge3.mcfunction │ │ │ │ ├── radix_sort_merge4.mcfunction │ │ │ │ ├── radix_sort_merge5.mcfunction │ │ │ │ ├── radix_sort_merge6.mcfunction │ │ │ │ ├── radix_sort_merge7.mcfunction │ │ │ │ ├── radix_sort_merge8.mcfunction │ │ │ │ ├── radix_sort_merge9.mcfunction │ │ │ │ ├── deliver_face_recursive.mcfunction │ │ │ │ ├── deliver_players_recursive.mcfunction │ │ │ │ ├── shuffle_recursive.mcfunction │ │ │ │ ├── shuffle_recursive2.mcfunction │ │ │ │ ├── merge_cards_recursive1.mcfunction │ │ │ │ ├── final_show_cards_recursive.mcfunction │ │ │ │ ├── radix_sort_recursive.mcfunction │ │ │ │ ├── show_outcards_recursive.mcfunction │ │ │ │ ├── merge_cards_recursive2.mcfunction │ │ │ │ ├── distribute_summon_as5.mcfunction │ │ │ │ └── radix_sort_recursive2.mcfunction │ │ │ ├── replaceitem_qiang.mcfunction │ │ │ ├── play_explosion2.mcfunction │ │ │ ├── random_add_to_rs.mcfunction │ │ │ ├── upd_remain_cards.mcfunction │ │ │ ├── upd_score_bossbar.mcfunction │ │ │ ├── fill_barrier.mcfunction │ │ │ ├── tp_between.mcfunction │ │ │ ├── get_card_type │ │ │ │ ├── is_13.mcfunction │ │ │ │ ├── is_2.mcfunction │ │ │ │ ├── is_3.mcfunction │ │ │ │ ├── is_12.mcfunction │ │ │ │ ├── is_1.mcfunction │ │ │ │ ├── is_4.mcfunction │ │ │ │ ├── is_5.mcfunction │ │ │ │ ├── is_6.mcfunction │ │ │ │ ├── is_9.mcfunction │ │ │ │ ├── is_8.mcfunction │ │ │ │ └── is_11.mcfunction │ │ │ ├── final_show_cards.mcfunction │ │ │ ├── replaceitem_jiao.mcfunction │ │ │ ├── q_switch_prepared.mcfunction │ │ │ ├── stop_game.mcfunction │ │ │ ├── replaceitem_chupai.mcfunction │ │ │ ├── show_pass.mcfunction │ │ │ ├── replaceitem_beforestart.mcfunction │ │ │ ├── distribute_cards2.mcfunction │ │ │ ├── distribute_cards3.mcfunction │ │ │ ├── merge_cards.mcfunction │ │ │ ├── distribute_cards.mcfunction │ │ │ ├── check_valid_outcard.mcfunction │ │ │ ├── final_show_title.mcfunction │ │ │ ├── upd_info.mcfunction │ │ │ ├── get_random.mcfunction │ │ │ ├── show_outcards.mcfunction │ │ │ ├── replaceitem_green_dye.mcfunction │ │ │ ├── upd_abandoned_cards_bossbar.mcfunction │ │ │ ├── conver_selected.mcfunction │ │ │ ├── get_card_type.mcfunction │ │ │ ├── show_voice_chat_info.mcfunction │ │ │ ├── start_game.mcfunction │ │ │ ├── jiao_end_judge.mcfunction │ │ │ └── qiang_end_judge.mcfunction │ │ ├── predicates │ │ │ └── half_chance.json │ │ └── structures │ │ │ ├── lobby.nbt │ │ │ ├── table.nbt │ │ │ └── playing_room.nbt │ └── minecraft │ │ └── tags │ │ └── functions │ │ ├── load.json │ │ └── tick.json └── pack.mcmeta └── README.md /doudizhu/data/doudizhu/functions/loop/saturation.mcfunction: -------------------------------------------------------------------------------- 1 | #[SAT] 给予玩家饱和效果 2 | 3 | effect give @a saturation 10 1 true -------------------------------------------------------------------------------- /doudizhu/data/minecraft/tags/functions/load.json: -------------------------------------------------------------------------------- 1 | { 2 | "values": 3 | [ 4 | "doudizhu:init" 5 | ] 6 | } -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/predicates/half_chance.json: -------------------------------------------------------------------------------- 1 | { 2 | "condition": "minecraft:random_chance", 3 | "chance": 0.5 4 | } -------------------------------------------------------------------------------- /doudizhu/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": 3 | { 4 | "pack_format": 6, 5 | "description": "斗地主" 6 | } 7 | } -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/debug/sw1.mcfunction: -------------------------------------------------------------------------------- 1 | tag @s remove Player1 2 | tag @s remove Player2 3 | tag @s remove Player3 4 | tag @s add Player1 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/debug/sw2.mcfunction: -------------------------------------------------------------------------------- 1 | tag @s remove Player1 2 | tag @s remove Player2 3 | tag @s remove Player3 4 | tag @s add Player2 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/debug/sw3.mcfunction: -------------------------------------------------------------------------------- 1 | tag @s remove Player1 2 | tag @s remove Player2 3 | tag @s remove Player3 4 | tag @s add Player3 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/structures/lobby.nbt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tml104/-Minecraft-Dou-Dizhu/HEAD/doudizhu/data/doudizhu/structures/lobby.nbt -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/structures/table.nbt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tml104/-Minecraft-Dou-Dizhu/HEAD/doudizhu/data/doudizhu/structures/table.nbt -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/structures/playing_room.nbt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tml104/-Minecraft-Dou-Dizhu/HEAD/doudizhu/data/doudizhu/structures/playing_room.nbt -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/gamemode_change.mcfunction: -------------------------------------------------------------------------------- 1 | #[GMC] 高频改变玩家的游戏模式(debug除外) (弃用) 2 | 3 | #execute as @a[gamemode=!adventure,tag=!doudizhu_DEBUG] run gamemode adventure @s -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/show_outcards_elapse.mcfunction: -------------------------------------------------------------------------------- 1 | # 延迟执行翻牌动作 2 | 3 | execute as @e[tag=doudizhu,tag=Outcard,type=armor_stand] run data merge entity @s {Pose:{Head:[-90.0f,0.0f,0.0f]}} -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/reset_scores.mcfunction: -------------------------------------------------------------------------------- 1 | #[] 重置所有玩家的分数为10000 2 | 3 | scoreboard players reset * score 4 | scoreboard players set @a score 10000 5 | scoreboard players set #base score 1000 6 | scoreboard players set #scale score 0 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/radix_sort.mcfunction: -------------------------------------------------------------------------------- 1 | #[RS] Radix sort 2 | #input: a list (in doudizhu:cards -> rs) 3 | #var: rs_k 4 | #return: rs 5 | 6 | scoreboard players set rs_k var 1 7 | function doudizhu:recursive/radix_sort_recursive 8 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/timer.mcfunction: -------------------------------------------------------------------------------- 1 | #[TM] 高频更新当前时间戳 2 | 3 | execute store result score now_time timer run time query gametime 4 | scoreboard players operation res timer = now_time timer 5 | scoreboard players operation res timer -= time_index timer 6 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/play_explosion.mcfunction: -------------------------------------------------------------------------------- 1 | #[PLE] 在doudizhu,Center处,播放爆炸效果 2 | 3 | execute as @e[tag=doudizhu,tag=Center] at @s run summon tnt ~ ~ ~ {Fuse:100} 4 | execute as @e[tag=doudizhu,tag=Center] at @s run schedule function doudizhu:play_explosion2 2s append -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # -Minecraft-Dou-Dizhu v1.3 2 | A Minecraft original mod for traditional Chinese three players poker card game "Dou Dizhu". 3 | Minecraft 斗地主 原版模组 v1.3 4 | 5 | 原帖链接(MCBBS):https://www.mcbbs.net/thread-1117895-1-1.html 6 | 安装前清先阅读原帖的各项说明~ 7 | 支持版本:Java Edition 1.16.2+ & 1.17.1 8 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/slime.mcfunction: -------------------------------------------------------------------------------- 1 | #[SLM] 史莱姆隐身/高频杀死史莱姆 2 | 3 | effect give @e[tag=Slime,tag=doudizhu] minecraft:invisibility 100 0 true 4 | #kill @e[tag=!Slime,tag=!doudizhu,type=slime] 5 | execute as @e[type=slime,tag=!Slime,tag=!doudizhu] at @s run tp @s ~ ~-64 ~ -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/shuffle.mcfunction: -------------------------------------------------------------------------------- 1 | #[SF] Shuffle card 2 | #return:- 3 | 4 | scoreboard players set sf_i var 54 5 | function doudizhu:recursive/shuffle_recursive 6 | 7 | data merge storage doudizhu:cards {cards:[]} 8 | scoreboard players set sf_i var 54 9 | function doudizhu:recursive/shuffle_recursive2 10 | 11 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/radix_sort_merge0.mcfunction: -------------------------------------------------------------------------------- 1 | #[RS] Radix sort, final merge rs_0..9 to rs 2 | 3 | data modify storage doudizhu:cards rs append from storage doudizhu:cards rs_0[0] 4 | data remove storage doudizhu:cards rs_0[0] 5 | execute if data storage doudizhu:cards rs_0[0] run function doudizhu:recursive/radix_sort_merge0 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/radix_sort_merge1.mcfunction: -------------------------------------------------------------------------------- 1 | #[RS] Radix sort, final merge rs_0..9 to rs 2 | 3 | data modify storage doudizhu:cards rs append from storage doudizhu:cards rs_1[0] 4 | data remove storage doudizhu:cards rs_1[0] 5 | execute if data storage doudizhu:cards rs_1[0] run function doudizhu:recursive/radix_sort_merge1 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/radix_sort_merge2.mcfunction: -------------------------------------------------------------------------------- 1 | #[RS] Radix sort, final merge rs_0..9 to rs 2 | 3 | data modify storage doudizhu:cards rs append from storage doudizhu:cards rs_2[0] 4 | data remove storage doudizhu:cards rs_2[0] 5 | execute if data storage doudizhu:cards rs_2[0] run function doudizhu:recursive/radix_sort_merge2 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/radix_sort_merge3.mcfunction: -------------------------------------------------------------------------------- 1 | #[RS] Radix sort, final merge rs_0..9 to rs 2 | 3 | data modify storage doudizhu:cards rs append from storage doudizhu:cards rs_3[0] 4 | data remove storage doudizhu:cards rs_3[0] 5 | execute if data storage doudizhu:cards rs_3[0] run function doudizhu:recursive/radix_sort_merge3 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/radix_sort_merge4.mcfunction: -------------------------------------------------------------------------------- 1 | #[RS] Radix sort, final merge rs_0..9 to rs 2 | 3 | data modify storage doudizhu:cards rs append from storage doudizhu:cards rs_4[0] 4 | data remove storage doudizhu:cards rs_4[0] 5 | execute if data storage doudizhu:cards rs_4[0] run function doudizhu:recursive/radix_sort_merge4 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/radix_sort_merge5.mcfunction: -------------------------------------------------------------------------------- 1 | #[RS] Radix sort, final merge rs_0..9 to rs 2 | 3 | data modify storage doudizhu:cards rs append from storage doudizhu:cards rs_5[0] 4 | data remove storage doudizhu:cards rs_5[0] 5 | execute if data storage doudizhu:cards rs_5[0] run function doudizhu:recursive/radix_sort_merge5 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/radix_sort_merge6.mcfunction: -------------------------------------------------------------------------------- 1 | #[RS] Radix sort, final merge rs_0..9 to rs 2 | 3 | data modify storage doudizhu:cards rs append from storage doudizhu:cards rs_6[0] 4 | data remove storage doudizhu:cards rs_6[0] 5 | execute if data storage doudizhu:cards rs_6[0] run function doudizhu:recursive/radix_sort_merge6 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/radix_sort_merge7.mcfunction: -------------------------------------------------------------------------------- 1 | #[RS] Radix sort, final merge rs_0..9 to rs 2 | 3 | data modify storage doudizhu:cards rs append from storage doudizhu:cards rs_7[0] 4 | data remove storage doudizhu:cards rs_7[0] 5 | execute if data storage doudizhu:cards rs_7[0] run function doudizhu:recursive/radix_sort_merge7 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/radix_sort_merge8.mcfunction: -------------------------------------------------------------------------------- 1 | #[RS] Radix sort, final merge rs_0..9 to rs 2 | 3 | data modify storage doudizhu:cards rs append from storage doudizhu:cards rs_8[0] 4 | data remove storage doudizhu:cards rs_8[0] 5 | execute if data storage doudizhu:cards rs_8[0] run function doudizhu:recursive/radix_sort_merge8 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/radix_sort_merge9.mcfunction: -------------------------------------------------------------------------------- 1 | #[RS] Radix sort, final merge rs_0..9 to rs 2 | 3 | data modify storage doudizhu:cards rs append from storage doudizhu:cards rs_9[0] 4 | data remove storage doudizhu:cards rs_9[0] 5 | execute if data storage doudizhu:cards rs_9[0] run function doudizhu:recursive/radix_sort_merge9 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/replaceitem_qiang.mcfunction: -------------------------------------------------------------------------------- 1 | #[RQ] 抢地主时,替换玩家物品栏 2 | #调用对象:玩家 3 | 4 | clear @s minecraft:carrot_on_a_stick 5 | replaceitem entity @s hotbar.0 minecraft:carrot_on_a_stick{display:{Name:'{"text":"Pass"}'},CustomModelData:303} 6 | replaceitem entity @s hotbar.1 minecraft:carrot_on_a_stick{display:{Name:'{"text":"叫分"}'},CustomModelData:311} -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/deliver_face_recursive.mcfunction: -------------------------------------------------------------------------------- 1 | #[DE] face 3 cards 2 | #input sf_i 3 | #return:- 4 | 5 | data modify storage doudizhu:cards facedown append from storage doudizhu:cards cards[0] 6 | data remove storage doudizhu:cards cards[0] 7 | scoreboard players remove sf_i var 1 8 | execute if score sf_i var matches 1.. run function doudizhu:recursive/deliver_face_recursive -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/play_explosion2.mcfunction: -------------------------------------------------------------------------------- 1 | #[PLE] 在doudizhu,Center处,播放爆炸效果 2 | 3 | execute as @e[tag=doudizhu,tag=Center] at @s run kill @e[type=tnt,limit=1,distance=..10] 4 | execute as @e[tag=doudizhu,tag=Center] at @s run playsound entity.generic.explode block @a ~ ~ ~ 5 | execute as @e[tag=doudizhu,tag=Center] at @s run particle minecraft:explosion_emitter ~ ~1 ~ .5 .5 .5 1 1 6 | 7 | #say @s -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/random_add_to_rs.mcfunction: -------------------------------------------------------------------------------- 1 | #Test use function 2 | function doudizhu:get_random 3 | execute store result storage doudizhu:cards temp int 1 run scoreboard players get rd_x var 4 | data modify storage doudizhu:cards rs append from storage doudizhu:cards temp 5 | 6 | scoreboard players remove sf_i var 1 7 | execute if score sf_i var matches 1.. run function doudizhu:random_add_to_rs -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/upd_remain_cards.mcfunction: -------------------------------------------------------------------------------- 1 | #[URM] 复制牌数剩余信息到玩家里 2 | 3 | 4 | scoreboard players operation @p[tag=Player1] remain_cards = @e[tag=Pos_Player1,tag=doudizhu,limit=1] remain_cards 5 | scoreboard players operation @p[tag=Player2] remain_cards = @e[tag=Pos_Player2,tag=doudizhu,limit=1] remain_cards 6 | scoreboard players operation @p[tag=Player3] remain_cards = @e[tag=Pos_Player3,tag=doudizhu,limit=1] remain_cards -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/upd_score_bossbar.mcfunction: -------------------------------------------------------------------------------- 1 | #[USB] 更新倍率和底分记分板的bossbar信息 2 | 3 | 4 | bossbar set show_score_and_scale visible true 5 | bossbar set show_score_and_scale name ["",{"text":"底分:","bold":true,"color":"light_purple"},{"score":{"name":"#base","objective":"score"},"bold":true,"color":"light_purple"},{"text":" "},{"text":"倍率:","bold":true,"color":"red"},{"score":{"name":"#scale","objective":"score"},"bold":true,"color":"red"}] -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/tp_first_players.mcfunction: -------------------------------------------------------------------------------- 1 | #[TFP] 传送首次进入服务器的玩家到大厅、调整游戏模式、重置记分板... 2 | 3 | 4 | execute as @a[tag=!TP_FIRST] run tp @s @e[limit=1,tag=doudizhu,tag=Join_game] 5 | execute as @a[tag=!TP_FIRST] run gamemode adventure @s 6 | execute as @a[tag=!TP_FIRST] run scoreboard players set @s score 10000 7 | execute as @a[tag=!TP_FIRST] run scoreboard players set @s remain_cards 0 8 | execute as @a[tag=!TP_FIRST] run tag @s add TP_FIRST -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/fill_barrier.mcfunction: -------------------------------------------------------------------------------- 1 | #[FRB]  穷举以填充场景 2 | #调用对象与位置:Center 3 | 4 | fill ~ ~1 ~ ~-1 ~3 ~-1 barrier 5 | 6 | fill ~1 ~1 ~1 ~1 ~3 ~1 barrier 7 | fill ~2 ~1 ~2 ~2 ~3 ~2 barrier 8 | 9 | fill ~-2 ~1 ~-2 ~-2 ~3 ~-2 barrier 10 | fill ~-3 ~1 ~-3 ~-3 ~3 ~-3 barrier 11 | 12 | fill ~1 ~1 ~-2 ~1 ~3 ~-2 barrier 13 | fill ~2 ~1 ~-3 ~2 ~3 ~-3 barrier 14 | 15 | fill ~-2 ~1 ~1 ~-2 ~3 ~1 barrier 16 | fill ~-3 ~1 ~2 ~-3 ~3 ~2 barrier -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/tp_between.mcfunction: -------------------------------------------------------------------------------- 1 | #[TB] 控制玩家在大厅和牌桌之间的传送…… 2 | 3 | #1:牌桌 2:大厅 4 | scoreboard players add @s pos 1 5 | scoreboard players operation @s pos %= 2 const 6 | execute if score @s pos matches 1 run tp @s @e[tag=doudizhu,tag=Center,limit=1] 7 | execute if score @s pos matches 1 at @s run tp @s ~ ~2 ~ 8 | execute unless score @s pos matches 1 run tp @s @e[tag=doudizhu,tag=Join_game,limit=1] 9 | 10 | 11 | scoreboard players set @s rclick 0 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/get_card_type/is_13.mcfunction: -------------------------------------------------------------------------------- 1 | #[CT] 王炸 2 | #input: scb -> outcards (1,2,...,15,sum) card_cnt 3 | #return: card_type max_card 4 | 5 | 6 | execute if score 14 outcards matches 1 if score 15 outcards matches 1 run scoreboard players set max_card outcards 15 7 | 8 | execute if score max_card outcards matches 1.. run scoreboard players set card_type outcards 13 9 | execute if score card_type outcards matches 0 run scoreboard players set max_card outcards 0 10 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/clear_rclick.mcfunction: -------------------------------------------------------------------------------- 1 | #[-] 最后清空所有玩家的点击记分板、杀物品实体 2 | 3 | kill @e[type=item,nbt={Item:{id:"minecraft:carrot_on_a_stick"}}] 4 | kill @e[type=item,nbt={Item:{id:"minecraft:green_dye"}}] 5 | kill @e[type=item,nbt={Item:{id:"minecraft:leather_helmet"}}] 6 | 7 | scoreboard players set @a rclick 0 8 | scoreboard players set @a test_f 0 9 | scoreboard players set @a test_q 0 10 | scoreboard players set @a test_empty 0 11 | scoreboard players set @a test_green_dye 0 12 | 13 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/final_show_cards.mcfunction: -------------------------------------------------------------------------------- 1 | #[FSC] 游戏结束后,玩家的摊牌环节 2 | #调用对象:Pos_Player 3 | #var: "FSC_1", i 4 | 5 | 6 | execute positioned ^ ^ ^-3 run summon area_effect_cloud ~ ~-1 ~ {Duration:2147483647,Tags:["doudizhu","FSC_1"]} 7 | data modify entity @e[tag=doudizhu,tag=FSC_1,limit=1] Rotation[0] set from entity @s Rotation[0] 8 | scoreboard players set i var 20 9 | execute positioned ^ ^ ^-3 run function doudizhu:recursive/final_show_cards_recursive 10 | 11 | 12 | kill @e[tag=doudizhu,tag=FSC_1] -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/replaceitem_jiao.mcfunction: -------------------------------------------------------------------------------- 1 | #[RJ] 叫地主时,替换玩家物品栏 2 | #调用对象:玩家 3 | 4 | clear @s minecraft:carrot_on_a_stick 5 | replaceitem entity @s hotbar.0 minecraft:carrot_on_a_stick{display:{Name:'{"text":"Pass"}'},CustomModelData:303} 6 | replaceitem entity @s hotbar.1 minecraft:carrot_on_a_stick{display:{Name:'{"text":"1分"}'},CustomModelData:304} 7 | replaceitem entity @s hotbar.2 minecraft:carrot_on_a_stick{display:{Name:'{"text":"2分"}'},CustomModelData:305} 8 | replaceitem entity @s hotbar.3 minecraft:carrot_on_a_stick{display:{Name:'{"text":"3分"}'},CustomModelData:306} -------------------------------------------------------------------------------- /doudizhu/data/minecraft/tags/functions/tick.json: -------------------------------------------------------------------------------- 1 | { 2 | "values": 3 | [ 4 | "doudizhu:loop/timer", 5 | "doudizhu:loop/bgm_ctrl", 6 | "doudizhu:loop/gamemode_change", 7 | "doudizhu:loop/slime", 8 | "doudizhu:loop/saturation", 9 | "doudizhu:loop/tp_first_players", 10 | "doudizhu:loop/rt", 11 | "doudizhu:loop/amplify", 12 | "doudizhu:loop/show_abandoned_cards", 13 | "doudizhu:loop/high_light", 14 | "doudizhu:loop/leave_hint", 15 | "doudizhu:loop/clear_rclick" 16 | ] 17 | } -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/amplify.mcfunction: -------------------------------------------------------------------------------- 1 | #[AF][loop] 放大镜 2 | #execute as @a[scores={rclick=1..},nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"放大镜"}'}}}}] run say @s 3 | execute as @a[scores={rclick=1..},nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"放大镜"}'}}}}] run scoreboard players add @s amplifier 1 4 | execute as @a run scoreboard players operation @s amplifier %= 2 const 5 | execute as @a[scores={amplifier=1}] run effect give @s slowness 10 137 true 6 | execute as @a[scores={amplifier=0}] run effect clear @s slowness 7 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/q_switch_prepared.mcfunction: -------------------------------------------------------------------------------- 1 | #[QSP] 按Q准备或者取消准备 2 | #调用:玩家 3 | #var: qsp_temp 4 | 5 | 6 | execute if entity @s[tag=!Prepared] run scoreboard players set qsp_temp var 1 7 | execute if entity @s[tag=Prepared] run scoreboard players set qsp_temp var 2 8 | 9 | execute if score qsp_temp var matches 1 run tellraw @s {"text":"您已准备","bold":true,"color":"green"} 10 | execute if score qsp_temp var matches 1 run tag @s add Prepared 11 | execute if score qsp_temp var matches 2 run tellraw @s {"text":"您已取消准备","bold":true,"color":"red"} 12 | execute if score qsp_temp var matches 2 run tag @s remove Prepared -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/stop_game.mcfunction: -------------------------------------------------------------------------------- 1 | #[STOP] 紧急停止游戏…… 2 | 3 | #草,得改成在出生点调用函数 4 | #已经修改,但仍有bug 5 | 6 | execute at @e[tag=doudizhu,tag=Center,limit=1] run summon area_effect_cloud ~ ~-5 ~ {Duration:2147483647,Tags:["doudizhu","stop"]} 7 | 8 | tellraw @a {"text":"正在停止游戏……","bold":true,"color":"red"} 9 | kill @e[tag=doudizhu,tag=!stop] 10 | tag @a remove Player1 11 | tag @a remove Player2 12 | tag @a remove Player3 13 | tag @a remove dizhu 14 | clear @a 15 | 16 | execute at @e[tag=doudizhu,tag=stop,limit=1] run function doudizhu:init 17 | kill @e[tag=doudizhu,tag=stop] 18 | kill @e[type=item,nbt={Item:{id:"minecraft:green_carpet"}}] -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/leave_hint.mcfunction: -------------------------------------------------------------------------------- 1 | #[LH] 离开游戏的提示 2 | 3 | execute as @a[scores={ddz_leavegame=1..},tag=Player1] run tellraw @s {"text":"注意:你在游戏过程中意外退出了游戏。如果原斗地主游戏仍在进行,请继续游戏,否则请输入/reload重置整个原版模组。若如此做,你的分数将不会消失。","color":"red"} 4 | execute as @a[scores={ddz_leavegame=1..},tag=Player2] run tellraw @s {"text":"注意:你在游戏过程中意外退出了游戏。如果原斗地主游戏仍在进行,请继续游戏,否则请输入/reload重置整个原版模组。若如此做,你的分数将不会消失。","color":"red"} 5 | execute as @a[scores={ddz_leavegame=1..},tag=Player3] run tellraw @s {"text":"注意:你在游戏过程中意外退出了游戏。如果原斗地主游戏仍在进行,请继续游戏,否则请输入/reload重置整个原版模组。若如此做,你的分数将不会消失。","color":"red"} 6 | 7 | execute as @a[scores={ddz_leavegame=1..}] run scoreboard players set @s ddz_leavegame 0 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/replaceitem_chupai.mcfunction: -------------------------------------------------------------------------------- 1 | #[RCH] 出牌时,替换玩家物品栏 2 | #调用对象:玩家 3 | 4 | clear @s minecraft:carrot_on_a_stick 5 | replaceitem entity @s hotbar.0 minecraft:carrot_on_a_stick{display:{Name:'{"text":"指针"}'},CustomModelData:301} 6 | replaceitem entity @s hotbar.1 minecraft:carrot_on_a_stick{display:{Name:'{"text":"出牌"}'},CustomModelData:307} 7 | replaceitem entity @s hotbar.2 minecraft:carrot_on_a_stick{display:{Name:'{"text":"Pass"}'},CustomModelData:303} 8 | replaceitem entity @s hotbar.3 minecraft:carrot_on_a_stick{display:{Name:'{"text":"放大镜"}'},CustomModelData:308} 9 | replaceitem entity @s hotbar.4 minecraft:carrot_on_a_stick{display:{Name:'{"text":"显示/隐藏弃牌堆记牌器"}'},CustomModelData:309} -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/deliver_players_recursive.mcfunction: -------------------------------------------------------------------------------- 1 | #[DE] every player 17 cards 2 | #input sf_i 3 | #return:- 4 | 5 | data modify storage doudizhu:cards player1 append from storage doudizhu:cards cards[0] 6 | data remove storage doudizhu:cards cards[0] 7 | 8 | data modify storage doudizhu:cards player2 append from storage doudizhu:cards cards[0] 9 | data remove storage doudizhu:cards cards[0] 10 | 11 | data modify storage doudizhu:cards player3 append from storage doudizhu:cards cards[0] 12 | data remove storage doudizhu:cards cards[0] 13 | 14 | scoreboard players remove sf_i var 1 15 | execute if score sf_i var matches 1.. run function doudizhu:recursive/deliver_players_recursive -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/shuffle_recursive.mcfunction: -------------------------------------------------------------------------------- 1 | #[SF] recursively summon 54 AEC 2 | #input:sf_i 3 | #return:54 aec with tags "Shuffle_used_aec" and score "card_id" 4 | 5 | execute at @e[type=area_effect_cloud,tag=doudizhu,tag=Center,limit=1] run summon area_effect_cloud ~ ~ ~ {Tags:["doudizhu","Shuffle_used_aec","need_score"],Duration:2147483647} 6 | scoreboard players operation @e[type=area_effect_cloud,tag=doudizhu,tag=Shuffle_used_aec,tag=need_score,limit=1] card_id = sf_i var 7 | tag @e[type=area_effect_cloud,tag=doudizhu,tag=Shuffle_used_aec,tag=need_score,limit=1] remove need_score 8 | scoreboard players remove sf_i var 1 9 | execute if score sf_i var matches 1.. run function doudizhu:recursive/shuffle_recursive -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/shuffle_recursive2.mcfunction: -------------------------------------------------------------------------------- 1 | #[SF] Pick cards 2 | #input: empty list (in doudizhu:cards -> cards) 3 | #var: temp (in doudizhu:cards -> temp) 4 | #return: a list (in doudizhu:cards -> cards) containing shuffled cards 5 | 6 | tag @e[sort=random,limit=1,tag=Shuffle_used_aec,tag=doudizhu] add Chosen 7 | execute store result storage doudizhu:cards temp int 1 run scoreboard players get @e[limit=1,tag=Shuffle_used_aec,tag=doudizhu,tag=Chosen] card_id 8 | data modify storage doudizhu:cards cards append from storage doudizhu:cards temp 9 | kill @e[limit=1,tag=Shuffle_used_aec,tag=doudizhu,tag=Chosen] 10 | scoreboard players remove sf_i var 1 11 | execute if score sf_i var matches 1.. run function doudizhu:recursive/shuffle_recursive2 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/show_pass.mcfunction: -------------------------------------------------------------------------------- 1 | #[SP] 展示pass AS 2 | 3 | execute if score round var matches 0 as @e[tag=doudizhu,tag=Pos_Player1] at @s positioned ^-3 ^ ^ run summon armor_stand ~ ~-1 ~ {Tags:["doudizhu","Card","Player1","Outcard"],CustomName:'{"text":"Pass"}',CustomNameVisible:true,Invisible:true,Invulnerable:true,Marker:true} 4 | execute if score round var matches 1 as @e[tag=doudizhu,tag=Pos_Player2] at @s positioned ^-3 ^ ^ run summon armor_stand ~ ~-1 ~ {Tags:["doudizhu","Card","Player2","Outcard"],CustomName:'{"text":"Pass"}',CustomNameVisible:true,Invisible:true,Invulnerable:true,Marker:true} 5 | execute if score round var matches 2 as @e[tag=doudizhu,tag=Pos_Player3] at @s positioned ^-3 ^ ^ run summon armor_stand ~ ~-1 ~ {Tags:["doudizhu","Card","Player3","Outcard"],CustomName:'{"text":"Pass"}',CustomNameVisible:true,Invisible:true,Invulnerable:true,Marker:true} 6 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/merge_cards_recursive1.mcfunction: -------------------------------------------------------------------------------- 1 | #[MC] 第一重循环 2 | #input:i 3 | #var: AEC with tag "MC_1", j 4 | 5 | scoreboard players set j var 19 6 | #execute as @e[tag=doudizhu,type=armor_stand,distance=..0.1,tag=!Selected] run say @s 7 | #execute unless entity @e[tag=doudizhu,type=armor_stand,distance=..0.1,tag=!Selected] run say NNN 8 | execute unless entity @e[tag=doudizhu,tag=Card,tag=!Onlyback,type=armor_stand,distance=..0.1,tag=!Selected] run summon area_effect_cloud ~ ~ ~ {Duration:2147483647,Tags:["MC_1","doudizhu"]} 9 | execute unless entity @e[tag=doudizhu,tag=Card,tag=!Onlyback,type=armor_stand,distance=..0.1,tag=!Selected] positioned ^-0.01 ^ ^0.4 run function doudizhu:recursive/merge_cards_recursive2 10 | kill @e[tag=doudizhu,tag=MC_1] 11 | 12 | scoreboard players remove i var 1 13 | execute if score i var matches 1.. positioned ^-0.01 ^ ^0.4 run function doudizhu:recursive/merge_cards_recursive1 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/replaceitem_beforestart.mcfunction: -------------------------------------------------------------------------------- 1 | #[RB] 游戏开始前,替换玩家物品栏 2 | 3 | clear @s minecraft:carrot_on_a_stick 4 | replaceitem entity @s hotbar.0 minecraft:carrot_on_a_stick{display:{Name:'{"text":"指针"}'},CustomModelData:301} 5 | replaceitem entity @s hotbar.1 minecraft:carrot_on_a_stick{display:{Name:'{"text":"前往牌桌/返回大厅"}'},CustomModelData:302} 6 | replaceitem entity @s hotbar.4 minecraft:carrot_on_a_stick{display:{Name:'{"text":"欢迎文字"}'},CustomModelData:310} 7 | replaceitem entity @s hotbar.5 minecraft:carrot_on_a_stick{display:{Name:'{"text":"基本操作说明"}'},CustomModelData:310} 8 | replaceitem entity @s hotbar.6 minecraft:carrot_on_a_stick{display:{Name:'{"text":"快速操作说明"}'},CustomModelData:310} 9 | replaceitem entity @s hotbar.7 minecraft:carrot_on_a_stick{display:{Name:'{"text":"声音与快速聊天说明"}'},CustomModelData:310} 10 | replaceitem entity @s hotbar.8 minecraft:carrot_on_a_stick{display:{Name:'{"text":"倍数与分数计算说明"}'},CustomModelData:310} 11 | 12 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/distribute_cards2.mcfunction: -------------------------------------------------------------------------------- 1 | #[DE] 生成牌实体,并且将统计信息保存在Pos_Player1(2,3)里 2 | #return:- 3 | 4 | #summon AS 5 | execute at @e[type=area_effect_cloud,tag=doudizhu,tag=Pos_Player1,limit=1] positioned ^ ^ ^-3 run function doudizhu:recursive/distribute_summon_as1 6 | execute at @e[type=area_effect_cloud,tag=doudizhu,tag=Pos_Player2,limit=1] positioned ^ ^ ^-3 run function doudizhu:recursive/distribute_summon_as2 7 | execute at @e[type=area_effect_cloud,tag=doudizhu,tag=Pos_Player3,limit=1] positioned ^ ^ ^-3 run function doudizhu:recursive/distribute_summon_as3 8 | execute at @e[type=area_effect_cloud,tag=doudizhu,tag=Pos_Facedown,limit=1] positioned ^ ^ ^-2 run function doudizhu:recursive/distribute_summon_as4 9 | 10 | scoreboard players set @e[tag=Pos_Player1,tag=doudizhu] remain_cards 17 11 | scoreboard players set @e[tag=Pos_Player2,tag=doudizhu] remain_cards 17 12 | scoreboard players set @e[tag=Pos_Player3,tag=doudizhu] remain_cards 17 13 | function doudizhu:upd_remain_cards -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/distribute_cards3.mcfunction: -------------------------------------------------------------------------------- 1 | #[DE] 生成背牌 2 | #return:- 3 | #注意:调用此函数之前务必特判skin_type==3 4 | 5 | kill @e[tag=doudizhu,tag=Card,tag=Onlyback] 6 | 7 | execute store result score de_i var run scoreboard players get @e[tag=doudizhu,tag=Pos_Player1,limit=1] remain_cards 8 | scoreboard players set de_as5dir var -90 9 | execute at @e[type=area_effect_cloud,tag=doudizhu,tag=Pos_Player1,limit=1] positioned ^ ^ ^-2.95 run function doudizhu:recursive/distribute_summon_as5 10 | execute store result score de_i var run scoreboard players get @e[tag=doudizhu,tag=Pos_Player2,limit=1] remain_cards 11 | scoreboard players set de_as5dir var 0 12 | execute at @e[type=area_effect_cloud,tag=doudizhu,tag=Pos_Player2,limit=1] positioned ^ ^ ^-2.95 run function doudizhu:recursive/distribute_summon_as5 13 | execute store result score de_i var run scoreboard players get @e[tag=doudizhu,tag=Pos_Player3,limit=1] remain_cards 14 | scoreboard players set de_as5dir var 180 15 | execute at @e[type=area_effect_cloud,tag=doudizhu,tag=Pos_Player3,limit=1] positioned ^ ^ ^-2.95 run function doudizhu:recursive/distribute_summon_as5 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/final_show_cards_recursive.mcfunction: -------------------------------------------------------------------------------- 1 | #[FSC] 摊牌循环 2 | #input: "FSC_1", i 3 | #var: "FSC_2" 4 | 5 | execute as @e[tag=doudizhu,tag=Card,type=armor_stand,distance=..0.1] run tag @s add FSC_2 6 | execute as @e[tag=doudizhu,tag=FSC_2,type=armor_stand] run data merge entity @s {Pose:{Head:[-90.0f,0.0f,0.0f]}} 7 | execute as @e[tag=doudizhu,tag=FSC_2,type=armor_stand] run data modify entity @s Pos[0] set from entity @e[limit=1,tag=FSC_1,tag=doudizhu] Pos[0] 8 | execute as @e[tag=doudizhu,tag=FSC_2,type=armor_stand] run data modify entity @s Pos[1] set from entity @e[limit=1,tag=FSC_1,tag=doudizhu] Pos[1] 9 | execute as @e[tag=doudizhu,tag=FSC_2,type=armor_stand] run data modify entity @s Pos[2] set from entity @e[limit=1,tag=FSC_1,tag=doudizhu] Pos[2] 10 | execute if entity @e[tag=doudizhu,tag=FSC_2,type=armor_stand] as @e[tag=doudizhu,tag=FSC_1] at @s positioned ~ ~-0.01 ~ run tp @s ^ ^ ^0.4 11 | tag @e[tag=doudizhu,tag=FSC_2,type=armor_stand] remove FSC_2 12 | 13 | 14 | scoreboard players remove i var 1 15 | execute if score i var matches 1.. positioned ^-0.01 ^ ^0.4 run function doudizhu:recursive/final_show_cards_recursive -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/radix_sort_recursive.mcfunction: -------------------------------------------------------------------------------- 1 | #[RS] Radix sort for bit k 2 | #input:a list (in doudizhu:cards -> rs), rs_k 3 | #var:lists (rs_0 to rs_9 in doudizhu:cards), rs_i(i-th number of list) 4 | #return:rs 5 | 6 | data merge storage doudizhu:cards {rs_0:[],rs_1:[],rs_2:[],rs_3:[],rs_4:[],rs_5:[],rs_6:[],rs_7:[],rs_8:[],rs_9:[]} 7 | #get rs length 8 | execute store result score rs_i var run data get storage doudizhu:cards rs 9 | function doudizhu:recursive/radix_sort_recursive2 10 | 11 | function doudizhu:recursive/radix_sort_merge0 12 | function doudizhu:recursive/radix_sort_merge1 13 | function doudizhu:recursive/radix_sort_merge2 14 | function doudizhu:recursive/radix_sort_merge3 15 | function doudizhu:recursive/radix_sort_merge4 16 | function doudizhu:recursive/radix_sort_merge5 17 | function doudizhu:recursive/radix_sort_merge6 18 | function doudizhu:recursive/radix_sort_merge7 19 | function doudizhu:recursive/radix_sort_merge8 20 | function doudizhu:recursive/radix_sort_merge9 21 | 22 | scoreboard players add rs_k var 1 23 | execute if score rs_k var matches ..10 run function doudizhu:recursive/radix_sort_recursive -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/show_abandoned_cards.mcfunction: -------------------------------------------------------------------------------- 1 | #[SAC][loop] 展示或隐藏记牌器 2 | 3 | execute as @a[scores={rclick=1..},nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"显示/隐藏弃牌堆记牌器"}'}}}}] run scoreboard players add @s abandoned_cards 1 4 | execute as @a run scoreboard players operation @s abandoned_cards %= 2 const 5 | 6 | execute if entity @a[scores={rclick=1..},nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"显示/隐藏弃牌堆记牌器"}'}}}}] run bossbar set show_abandoned_cards players 7 | execute if entity @a[scores={rclick=1..},nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"显示/隐藏弃牌堆记牌器"}'}}}}] run bossbar set show_abandoned_cards players @a[scores={abandoned_cards=1}] 8 | 9 | #execute if entity @a[scores={rclick=1..},nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"显示/隐藏弃牌堆记牌器"}'}}}}] run bossbar set show_abandoned_cards2 players 10 | #execute if entity @a[scores={rclick=1..},nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"显示/隐藏弃牌堆记牌器"}'}}}}] run bossbar set show_abandoned_cards2 players @a[scores={abandoned_cards=1}] 11 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/merge_cards.mcfunction: -------------------------------------------------------------------------------- 1 | #[MC] 合并卡牌 2 | #input:round(var)表示轮到谁出牌 3 | #var:i(剩余牌数) 4 | 5 | 6 | scoreboard players set i var 20 7 | #execute if score round var matches 0 as @e[tag=doudizhu,tag=Pos_Player1] at @s run scoreboard players operation i var = @s remain_cards 8 | #execute if score round var matches 0 run scoreboard players operation i var -= card_cnt outcards 9 | execute if score round var matches 0 as @e[tag=doudizhu,tag=Pos_Player1] at @s positioned ^ ^ ^-3 run function doudizhu:recursive/merge_cards_recursive1 10 | 11 | #execute if score round var matches 1 as @e[tag=doudizhu,tag=Pos_Player2] at @s run scoreboard players operation i var = @s remain_cards 12 | #execute if score round var matches 1 run scoreboard players operation i var -= card_cnt outcards 13 | execute if score round var matches 1 as @e[tag=doudizhu,tag=Pos_Player2] at @s positioned ^ ^ ^-3 run function doudizhu:recursive/merge_cards_recursive1 14 | 15 | #execute if score round var matches 2 as @e[tag=doudizhu,tag=Pos_Player3] at @s run scoreboard players operation i var = @s remain_cards 16 | #execute if score round var matches 2 run scoreboard players operation i var -= card_cnt outcards 17 | execute if score round var matches 2 as @e[tag=doudizhu,tag=Pos_Player3] at @s positioned ^ ^ ^-3 run function doudizhu:recursive/merge_cards_recursive1 18 | 19 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/show_outcards_recursive.mcfunction: -------------------------------------------------------------------------------- 1 | #[SO] 循环找到被选中的牌并转移到桌面上 2 | #input:i,"SO_1" 3 | #var:"SO_2" 4 | 5 | execute as @e[tag=doudizhu,tag=Selected,type=armor_stand,distance=..0.1] run tag @s add SO_2 6 | # 0 -> 90 -> -90 7 | execute as @e[tag=doudizhu,tag=SO_2,type=armor_stand] run data merge entity @s {Pose:{Head:[90.0f,0.0f,0.0f]}} 8 | execute as @e[tag=doudizhu,tag=SO_2,type=armor_stand] run data modify entity @s Pos[0] set from entity @e[limit=1,tag=SO_1,tag=doudizhu] Pos[0] 9 | execute as @e[tag=doudizhu,tag=SO_2,type=armor_stand] run data modify entity @s Pos[1] set from entity @e[limit=1,tag=SO_1,tag=doudizhu] Pos[1] 10 | execute as @e[tag=doudizhu,tag=SO_2,type=armor_stand] run data modify entity @s Pos[2] set from entity @e[limit=1,tag=SO_1,tag=doudizhu] Pos[2] 11 | execute if entity @e[tag=doudizhu,tag=SO_2,type=armor_stand] as @e[tag=doudizhu,tag=SO_1] at @s positioned ~ ~-0.01 ~ run tp @s ^ ^ ^0.4 12 | 13 | tag @e[tag=doudizhu,tag=SO_2,type=armor_stand] add Outcard 14 | tag @e[tag=doudizhu,tag=SO_2,type=armor_stand] remove Selected 15 | execute as @e[tag=doudizhu,tag=SO_2,type=armor_stand] run team leave @s 16 | tag @e[tag=doudizhu,tag=SO_2,type=armor_stand] remove SO_2 17 | 18 | scoreboard players remove i var 1 19 | execute if score i var matches 1.. positioned ^-0.01 ^ ^0.4 run function doudizhu:recursive/show_outcards_recursive -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/merge_cards_recursive2.mcfunction: -------------------------------------------------------------------------------- 1 | #[MC] 第二重循环 2 | #input:j "MC_2" 3 | #var:temp(标记成功执行) 4 | 5 | scoreboard players set temp var 0 6 | #execute as @e[tag=doudizhu,type=armor_stand,distance=..0.1,tag=!Selected] run say YYY 7 | execute as @e[tag=doudizhu,tag=Card,tag=!Onlyback,type=armor_stand,distance=..0.1,tag=!Selected] run scoreboard players set temp var 1 8 | execute as @e[tag=doudizhu,tag=Card,tag=!Onlyback,type=armor_stand,distance=..0.1,tag=!Selected] run tag @s add MC_2 9 | #execute as @e[tag=doudizhu,type=armor_stand,distance=..0.1,tag=!Selected] run tp @s @e[limit=1,tag=doudizhu,tag=MC_1] 10 | execute as @e[tag=doudizhu,tag=Card,tag=!Onlyback,type=armor_stand,tag=MC_2] run data modify entity @s Pos[0] set from entity @e[limit=1,tag=doudizhu,tag=MC_1] Pos[0] 11 | execute as @e[tag=doudizhu,tag=Card,tag=!Onlyback,type=armor_stand,tag=MC_2] run data modify entity @s Pos[1] set from entity @e[limit=1,tag=doudizhu,tag=MC_1] Pos[1] 12 | execute as @e[tag=doudizhu,tag=Card,tag=!Onlyback,type=armor_stand,tag=MC_2] run data modify entity @s Pos[2] set from entity @e[limit=1,tag=doudizhu,tag=MC_1] Pos[2] 13 | tag @e[tag=doudizhu,tag=MC_2,type=armor_stand] remove MC_2 14 | 15 | scoreboard players remove j var 1 16 | execute if score j var matches 1.. if score temp var matches 0 positioned ^-0.01 ^ ^0.4 run function doudizhu:recursive/merge_cards_recursive2 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/distribute_summon_as5.mcfunction: -------------------------------------------------------------------------------- 1 | #[DE] 2 | #input: de_i 3 | 4 | 5 | execute if score de_as5dir var matches -90 run summon armor_stand ~ ~ ~ {CustomName:'{"text":"Onlyback"}',CustomNameVisible:false,NoGravity:true,Invisible:true,Marker:true,Rotation:[-90.0f,0.0f],ArmorItems: [{}, {}, {}, {id: "minecraft:blue_dye", Count: 1b,tag:{CustomModelData:555}}],Tags:["doudizhu","Onlyback","Card"]} 6 | execute if score de_as5dir var matches 0 run summon armor_stand ~ ~ ~ {CustomName:'{"text":"Onlyback"}',CustomNameVisible:false,NoGravity:true,Invisible:true,Marker:true,Rotation:[0.0f,0.0f],ArmorItems: [{}, {}, {}, {id: "minecraft:blue_dye", Count: 1b,tag:{CustomModelData:555}}],Tags:["doudizhu","Onlyback","Card"]} 7 | execute if score de_as5dir var matches 180 run summon armor_stand ~ ~ ~ {CustomName:'{"text":"Onlyback"}',CustomNameVisible:false,NoGravity:true,Invisible:true,Marker:true,Rotation:[180.0f,0.0f],ArmorItems: [{}, {}, {}, {id: "minecraft:blue_dye", Count: 1b,tag:{CustomModelData:555}}],Tags:["doudizhu","Onlyback","Card"]} 8 | #execute as @e[tag=doudizhu,tag=Onlyback,tag=Card,type=armor_stand,sort=nearest,limit=1] store result entity @s Rotation[0] float 1 run scoreboard players get de_as5dir var 9 | 10 | scoreboard players remove de_i var 1 11 | execute if score de_i var matches 1.. positioned ^-0.01 ^ ^0.4 run function doudizhu:recursive/distribute_summon_as5 12 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/get_card_type/is_2.mcfunction: -------------------------------------------------------------------------------- 1 | #[CT] 一对 2 | #input: scb -> outcards (1,2,...,15,sum) card_cnt 3 | #return: card_type max_card 4 | 5 | 6 | execute if score 1 outcards matches 2 run scoreboard players set max_card outcards 1 7 | execute if score 2 outcards matches 2 run scoreboard players set max_card outcards 2 8 | execute if score 3 outcards matches 2 run scoreboard players set max_card outcards 3 9 | execute if score 4 outcards matches 2 run scoreboard players set max_card outcards 4 10 | execute if score 5 outcards matches 2 run scoreboard players set max_card outcards 5 11 | execute if score 6 outcards matches 2 run scoreboard players set max_card outcards 6 12 | execute if score 7 outcards matches 2 run scoreboard players set max_card outcards 7 13 | execute if score 8 outcards matches 2 run scoreboard players set max_card outcards 8 14 | execute if score 9 outcards matches 2 run scoreboard players set max_card outcards 9 15 | execute if score 10 outcards matches 2 run scoreboard players set max_card outcards 10 16 | execute if score 11 outcards matches 2 run scoreboard players set max_card outcards 11 17 | execute if score 12 outcards matches 2 run scoreboard players set max_card outcards 12 18 | execute if score 13 outcards matches 2 run scoreboard players set max_card outcards 13 19 | 20 | execute if score max_card outcards matches 1.. run scoreboard players set card_type outcards 2 21 | execute if score card_type outcards matches 0 run scoreboard players set max_card outcards 0 22 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/get_card_type/is_3.mcfunction: -------------------------------------------------------------------------------- 1 | #[CT] 三条 2 | #input: scb -> outcards (1,2,...,15,sum) card_cnt 3 | #return: card_type max_card 4 | 5 | 6 | execute if score 1 outcards matches 3 run scoreboard players set max_card outcards 1 7 | execute if score 2 outcards matches 3 run scoreboard players set max_card outcards 2 8 | execute if score 3 outcards matches 3 run scoreboard players set max_card outcards 3 9 | execute if score 4 outcards matches 3 run scoreboard players set max_card outcards 4 10 | execute if score 5 outcards matches 3 run scoreboard players set max_card outcards 5 11 | execute if score 6 outcards matches 3 run scoreboard players set max_card outcards 6 12 | execute if score 7 outcards matches 3 run scoreboard players set max_card outcards 7 13 | execute if score 8 outcards matches 3 run scoreboard players set max_card outcards 8 14 | execute if score 9 outcards matches 3 run scoreboard players set max_card outcards 9 15 | execute if score 10 outcards matches 3 run scoreboard players set max_card outcards 10 16 | execute if score 11 outcards matches 3 run scoreboard players set max_card outcards 11 17 | execute if score 12 outcards matches 3 run scoreboard players set max_card outcards 12 18 | execute if score 13 outcards matches 3 run scoreboard players set max_card outcards 13 19 | 20 | execute if score max_card outcards matches 1.. run scoreboard players set card_type outcards 3 21 | execute if score card_type outcards matches 0 run scoreboard players set max_card outcards 0 22 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/get_card_type/is_12.mcfunction: -------------------------------------------------------------------------------- 1 | #[CT] 炸弹(四条) 2 | #input: scb -> outcards (1,2,...,15,sum) card_cnt 3 | #return: card_type max_card 4 | 5 | 6 | execute if score 1 outcards matches 4 run scoreboard players set max_card outcards 1 7 | execute if score 2 outcards matches 4 run scoreboard players set max_card outcards 2 8 | execute if score 3 outcards matches 4 run scoreboard players set max_card outcards 3 9 | execute if score 4 outcards matches 4 run scoreboard players set max_card outcards 4 10 | execute if score 5 outcards matches 4 run scoreboard players set max_card outcards 5 11 | execute if score 6 outcards matches 4 run scoreboard players set max_card outcards 6 12 | execute if score 7 outcards matches 4 run scoreboard players set max_card outcards 7 13 | execute if score 8 outcards matches 4 run scoreboard players set max_card outcards 8 14 | execute if score 9 outcards matches 4 run scoreboard players set max_card outcards 9 15 | execute if score 10 outcards matches 4 run scoreboard players set max_card outcards 10 16 | execute if score 11 outcards matches 4 run scoreboard players set max_card outcards 11 17 | execute if score 12 outcards matches 4 run scoreboard players set max_card outcards 12 18 | execute if score 13 outcards matches 4 run scoreboard players set max_card outcards 13 19 | 20 | execute if score max_card outcards matches 1.. run scoreboard players set card_type outcards 12 21 | execute if score card_type outcards matches 0 run scoreboard players set max_card outcards 0 22 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/get_card_type/is_1.mcfunction: -------------------------------------------------------------------------------- 1 | #[CT] 单牌 2 | #input: scb -> outcards (1,2,...,15,sum) card_cnt 3 | #return: card_type max_card 4 | 5 | 6 | execute if score 1 outcards matches 1 run scoreboard players set max_card outcards 1 7 | execute if score 2 outcards matches 1 run scoreboard players set max_card outcards 2 8 | execute if score 3 outcards matches 1 run scoreboard players set max_card outcards 3 9 | execute if score 4 outcards matches 1 run scoreboard players set max_card outcards 4 10 | execute if score 5 outcards matches 1 run scoreboard players set max_card outcards 5 11 | execute if score 6 outcards matches 1 run scoreboard players set max_card outcards 6 12 | execute if score 7 outcards matches 1 run scoreboard players set max_card outcards 7 13 | execute if score 8 outcards matches 1 run scoreboard players set max_card outcards 8 14 | execute if score 9 outcards matches 1 run scoreboard players set max_card outcards 9 15 | execute if score 10 outcards matches 1 run scoreboard players set max_card outcards 10 16 | execute if score 11 outcards matches 1 run scoreboard players set max_card outcards 11 17 | execute if score 12 outcards matches 1 run scoreboard players set max_card outcards 12 18 | execute if score 13 outcards matches 1 run scoreboard players set max_card outcards 13 19 | execute if score 14 outcards matches 1 run scoreboard players set max_card outcards 14 20 | execute if score 15 outcards matches 1 run scoreboard players set max_card outcards 15 21 | #Always success 22 | scoreboard players set card_type outcards 1 23 | execute if score card_type outcards matches 0 run scoreboard players set max_card outcards 0 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/distribute_cards.mcfunction: -------------------------------------------------------------------------------- 1 | #[DE] Deliver cards to face-down cards, players1, 2 and 3. 2 | #return:- 3 | 4 | data merge storage doudizhu:cards {facedown:[],player1:[],player2:[],player3:[],player1_copy:[],player2_copy:[],player3_copy:[],facedown_copy:[]} 5 | 6 | scoreboard players set sf_i var 3 7 | function doudizhu:recursive/deliver_face_recursive 8 | 9 | scoreboard players set sf_i var 17 10 | function doudizhu:recursive/deliver_players_recursive 11 | 12 | #sort... 13 | data modify storage doudizhu:cards rs set from storage doudizhu:cards facedown 14 | function doudizhu:radix_sort 15 | data modify storage doudizhu:cards facedown set from storage doudizhu:cards rs 16 | 17 | data modify storage doudizhu:cards rs set from storage doudizhu:cards player1 18 | function doudizhu:radix_sort 19 | data modify storage doudizhu:cards player1 set from storage doudizhu:cards rs 20 | 21 | data modify storage doudizhu:cards rs set from storage doudizhu:cards player2 22 | function doudizhu:radix_sort 23 | data modify storage doudizhu:cards player2 set from storage doudizhu:cards rs 24 | 25 | data modify storage doudizhu:cards rs set from storage doudizhu:cards player3 26 | function doudizhu:radix_sort 27 | data modify storage doudizhu:cards player3 set from storage doudizhu:cards rs 28 | 29 | #copy 30 | data modify storage doudizhu:cards player1_copy set from storage doudizhu:cards player1 31 | data modify storage doudizhu:cards player2_copy set from storage doudizhu:cards player2 32 | data modify storage doudizhu:cards player3_copy set from storage doudizhu:cards player3 33 | data modify storage doudizhu:cards facedown_copy set from storage doudizhu:cards facedown 34 | 35 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/jiao_see3.mcfunction: -------------------------------------------------------------------------------- 1 | #[JS]叫地主阶段的叫分判定 2 | 3 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"1分"}'}}}},scores={rclick=1..}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player3] jiaofen 1 4 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"2分"}'}}}},scores={rclick=1..}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player3] jiaofen 2 5 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"3分"}'}}}},scores={rclick=1..}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player3] jiaofen 3 6 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"Pass"}'}}}},scores={rclick=1..}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player3] jiaofen -1 7 | #Q键 8 | execute as @s[scores={test_q=1..,rclick=0,test_f=0,test_empty=0}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player3] jiaofen -1 9 | execute if score @e[tag=doudizhu,tag=Pos_Player3,limit=1] jiaofen matches -1 as @s run tellraw @a [{"selector":"@s","bold":true},{"text":":不叫"}] 10 | execute if score @e[tag=doudizhu,tag=Pos_Player3,limit=1] jiaofen matches 1 as @s run tellraw @a [{"selector":"@s","bold":true},{"text":":"},{"text":"1","color":"dark_aqua"},{"text":"分"}] 11 | execute if score @e[tag=doudizhu,tag=Pos_Player3,limit=1] jiaofen matches 2 as @s run tellraw @a ["",{"selector":"@s","bold":true},{"text":":"},{"text":"2","color":"red"},{"text":"分"}] 12 | execute if score @e[tag=doudizhu,tag=Pos_Player3,limit=1] jiaofen matches 3 as @s run tellraw @a ["",{"selector":"@s","bold":true},{"text":":"},{"text":"3","color":"gold"},{"text":"分"}] 13 | 14 | 15 | execute as @e[tag=doudizhu,tag=Pos_Player3] unless score @s jiaofen matches 0 run function doudizhu:jiao_end_judge -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/jiao_see1.mcfunction: -------------------------------------------------------------------------------- 1 | #[JS]叫地主阶段的叫分判定 2 | 3 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"1分"}'}}}},scores={rclick=1..}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player1] jiaofen 1 4 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"2分"}'}}}},scores={rclick=1..}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player1] jiaofen 2 5 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"3分"}'}}}},scores={rclick=1..}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player1] jiaofen 3 6 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"Pass"}'}}}},scores={rclick=1..}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player1] jiaofen -1 7 | #Q键 8 | execute as @s[scores={test_q=1..,rclick=0,test_f=0,test_empty=0}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player1] jiaofen -1 9 | 10 | 11 | execute if score @e[tag=doudizhu,tag=Pos_Player1,limit=1] jiaofen matches -1 as @s run tellraw @a [{"selector":"@s","bold":true},{"text":":不叫"}] 12 | execute if score @e[tag=doudizhu,tag=Pos_Player1,limit=1] jiaofen matches 1 as @s run tellraw @a [{"selector":"@s","bold":true},{"text":":"},{"text":"1","color":"dark_aqua"},{"text":"分"}] 13 | execute if score @e[tag=doudizhu,tag=Pos_Player1,limit=1] jiaofen matches 2 as @s run tellraw @a ["",{"selector":"@s","bold":true},{"text":":"},{"text":"2","color":"red"},{"text":"分"}] 14 | execute if score @e[tag=doudizhu,tag=Pos_Player1,limit=1] jiaofen matches 3 as @s run tellraw @a ["",{"selector":"@s","bold":true},{"text":":"},{"text":"3","color":"gold"},{"text":"分"}] 15 | 16 | execute as @e[tag=doudizhu,tag=Pos_Player1] unless score @s jiaofen matches 0 run function doudizhu:jiao_end_judge -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/jiao_see2.mcfunction: -------------------------------------------------------------------------------- 1 | #[JS]叫地主阶段的叫分判定 2 | 3 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"1分"}'}}}},scores={rclick=1..}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player2] jiaofen 1 4 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"2分"}'}}}},scores={rclick=1..}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player2] jiaofen 2 5 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"3分"}'}}}},scores={rclick=1..}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player2] jiaofen 3 6 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"Pass"}'}}}},scores={rclick=1..}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player2] jiaofen -1 7 | #Q键 8 | execute as @s[scores={test_q=1..,rclick=0,test_f=0,test_empty=0}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player2] jiaofen -1 9 | execute if score @e[tag=doudizhu,tag=Pos_Player2,limit=1] jiaofen matches -1 as @s run tellraw @a [{"selector":"@s","bold":true},{"text":":不叫"}] 10 | execute if score @e[tag=doudizhu,tag=Pos_Player2,limit=1] jiaofen matches 1 as @s run tellraw @a [{"selector":"@s","bold":true},{"text":":"},{"text":"1","color":"dark_aqua"},{"text":"分"}] 11 | execute if score @e[tag=doudizhu,tag=Pos_Player2,limit=1] jiaofen matches 2 as @s run tellraw @a ["",{"selector":"@s","bold":true},{"text":":"},{"text":"2","color":"red"},{"text":"分"}] 12 | execute if score @e[tag=doudizhu,tag=Pos_Player2,limit=1] jiaofen matches 3 as @s run tellraw @a ["",{"selector":"@s","bold":true},{"text":":"},{"text":"3","color":"gold"},{"text":"分"}] 13 | 14 | 15 | 16 | execute as @e[tag=doudizhu,tag=Pos_Player2] unless score @s jiaofen matches 0 run function doudizhu:jiao_end_judge -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/detect_empty2.mcfunction: -------------------------------------------------------------------------------- 1 | #[DE2] 叫地主后给玩家帽子 2 | 3 | #CLEAR 4 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] as @a[nbt=!{Inventory:[{Slot:103b,id:"minecraft:leather_helmet"}]}] run clear @s leather_helmet 5 | #地主 6 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if entity @e[tag=doudizhu,tag=Pos_Player1,tag=dizhu] as @p[tag=Player1,nbt=!{Inventory:[{Slot:103b,id:"minecraft:leather_helmet"}]}] run replaceitem entity @s armor.head leather_helmet{display:{color:16701501,Name:'{"text":"地主帽子"}'}} 7 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if entity @e[tag=doudizhu,tag=Pos_Player2,tag=dizhu] as @p[tag=Player2,nbt=!{Inventory:[{Slot:103b,id:"minecraft:leather_helmet"}]}] run replaceitem entity @s armor.head leather_helmet{display:{color:16701501,Name:'{"text":"地主帽子"}'}} 8 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if entity @e[tag=doudizhu,tag=Pos_Player3,tag=dizhu] as @p[tag=Player3,nbt=!{Inventory:[{Slot:103b,id:"minecraft:leather_helmet"}]}] run replaceitem entity @s armor.head leather_helmet{display:{color:16701501,Name:'{"text":"地主帽子"}'}} 9 | #农民 10 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if entity @e[tag=doudizhu,tag=Pos_Player1,tag=!dizhu] as @p[tag=Player1,nbt=!{Inventory:[{Slot:103b,id:"minecraft:leather_helmet"}]}] run replaceitem entity @s armor.head leather_helmet{display:{color:16777215,Name:'{"text":"农民帽子"}'}} 11 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if entity @e[tag=doudizhu,tag=Pos_Player2,tag=!dizhu] as @p[tag=Player2,nbt=!{Inventory:[{Slot:103b,id:"minecraft:leather_helmet"}]}] run replaceitem entity @s armor.head leather_helmet{display:{color:16777215,Name:'{"text":"农民帽子"}'}} 12 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if entity @e[tag=doudizhu,tag=Pos_Player3,tag=!dizhu] as @p[tag=Player3,nbt=!{Inventory:[{Slot:103b,id:"minecraft:leather_helmet"}]}] run replaceitem entity @s armor.head leather_helmet{display:{color:16777215,Name:'{"text":"农民帽子"}'}} -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/qiang_see3.mcfunction: -------------------------------------------------------------------------------- 1 | #[QS] 抢地主阶段的叫分判定(player3) 2 | 3 | scoreboard players set qs_temp var 0 4 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"Pass"}'}}}},scores={rclick=1..}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player3] jiaofen -1 5 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"叫分"}'}}}},scores={rclick=1..}] run scoreboard players add @e[tag=doudizhu,tag=Pos_Player3] jiaofen 1 6 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"叫分"}'}}}},scores={rclick=1..}] run scoreboard players add jiaofen_times jiaofen 1 7 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick"}},scores={rclick=1..}] run scoreboard players set qs_temp var 1 8 | #Q 9 | execute as @s[scores={test_q=1..,rclick=0,test_f=0,test_empty=0}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player3] jiaofen -1 10 | execute as @s[scores={test_q=1..,rclick=0,test_f=0,test_empty=0}] run scoreboard players set qs_temp var 1 11 | 12 | execute if score qs_temp var matches 1 if score @e[tag=doudizhu,tag=Pos_Player3,limit=1] jiaofen matches -1 if score jiaofen_times jiaofen matches 0 as @s run tellraw @a [{"selector":"@s","bold":true},{"text":":不叫"}] 13 | execute if score qs_temp var matches 1 if score @e[tag=doudizhu,tag=Pos_Player3,limit=1] jiaofen matches -1 if score jiaofen_times jiaofen matches 1.. as @s run tellraw @a [{"selector":"@s","bold":true},{"text":":不抢"}] 14 | execute if score qs_temp var matches 1 if score @e[tag=doudizhu,tag=Pos_Player3,limit=1] jiaofen matches 1.. if score jiaofen_times jiaofen matches 1 as @s run tellraw @a [{"selector":"@s","bold":true},{"text":":叫地主"}] 15 | execute if score qs_temp var matches 1 if score @e[tag=doudizhu,tag=Pos_Player3,limit=1] jiaofen matches 1.. if score jiaofen_times jiaofen matches 2.. as @s run tellraw @a [{"selector":"@s","bold":true},{"text":":抢地主"}] 16 | 17 | execute as @e[tag=doudizhu,tag=Pos_Player3] unless score qs_temp var matches 0 run function doudizhu:qiang_end_judge -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/qiang_see2.mcfunction: -------------------------------------------------------------------------------- 1 | #[QS] 抢地主阶段的叫分判定(player2) 2 | 3 | scoreboard players set qs_temp var 0 4 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"Pass"}'}}}},scores={rclick=1..}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player2] jiaofen -1 5 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"叫分"}'}}}},scores={rclick=1..}] run scoreboard players add @e[tag=doudizhu,tag=Pos_Player2] jiaofen 1 6 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"叫分"}'}}}},scores={rclick=1..}] run scoreboard players add jiaofen_times jiaofen 1 7 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick"}},scores={rclick=1..}] run scoreboard players set qs_temp var 1 8 | #Q 9 | execute as @s[scores={test_q=1..,rclick=0,test_f=0,test_empty=0}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player2] jiaofen -1 10 | execute as @s[scores={test_q=1..,rclick=0,test_f=0,test_empty=0}] run scoreboard players set qs_temp var 1 11 | 12 | execute if score qs_temp var matches 1 if score @e[tag=doudizhu,tag=Pos_Player2,limit=1] jiaofen matches -1 if score jiaofen_times jiaofen matches 0 as @s run tellraw @a [{"selector":"@s","bold":true},{"text":":不叫"}] 13 | execute if score qs_temp var matches 1 if score @e[tag=doudizhu,tag=Pos_Player2,limit=1] jiaofen matches -1 if score jiaofen_times jiaofen matches 1.. as @s run tellraw @a [{"selector":"@s","bold":true},{"text":":不抢"}] 14 | execute if score qs_temp var matches 1 if score @e[tag=doudizhu,tag=Pos_Player2,limit=1] jiaofen matches 1.. if score jiaofen_times jiaofen matches 1 as @s run tellraw @a [{"selector":"@s","bold":true},{"text":":叫地主"}] 15 | execute if score qs_temp var matches 1 if score @e[tag=doudizhu,tag=Pos_Player2,limit=1] jiaofen matches 1.. if score jiaofen_times jiaofen matches 2.. as @s run tellraw @a [{"selector":"@s","bold":true},{"text":":抢地主"}] 16 | 17 | execute as @e[tag=doudizhu,tag=Pos_Player2] unless score qs_temp var matches 0 run function doudizhu:qiang_end_judge 18 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/check_valid_outcard.mcfunction: -------------------------------------------------------------------------------- 1 | #[CVO] 检查出牌是否合法 2 | #input:last_outcards, outcards记分板 3 | #var: cvo_max_card cvo_last_max_card 4 | #return: cvo (0不合法,1合法) 5 | 6 | #这里将最大牌标号重新编排: 7 | #3~13 对应3~K 8 | #14:A 9 | #15:2 10 | #16:joker 11 | #17:JOKER 12 | 13 | scoreboard players set cvo var 0 14 | scoreboard players operation cvo_max_card var = max_card outcards 15 | scoreboard players operation cvo_last_max_card var = max_card last_outcards 16 | 17 | execute if score max_card outcards matches 1 run scoreboard players set cvo_max_card var 14 18 | execute if score max_card outcards matches 2 run scoreboard players set cvo_max_card var 15 19 | execute if score max_card outcards matches 14 run scoreboard players set cvo_max_card var 16 20 | execute if score max_card outcards matches 15 run scoreboard players set cvo_max_card var 17 21 | 22 | execute if score max_card last_outcards matches 1 run scoreboard players set cvo_last_max_card var 14 23 | execute if score max_card last_outcards matches 2 run scoreboard players set cvo_last_max_card var 15 24 | execute if score max_card last_outcards matches 14 run scoreboard players set cvo_last_max_card var 16 25 | execute if score max_card last_outcards matches 15 run scoreboard players set cvo_last_max_card var 17 26 | 27 | 28 | #第一个出牌 29 | execute if score cvo_last_max_card var matches 0 if score card_type outcards matches 1.. run scoreboard players set cvo var 1 30 | 31 | #王炸 32 | execute if score card_type outcards matches 13 run scoreboard players set cvo var 1 33 | 34 | #炸弹 35 | execute if score card_type outcards matches 12 if score card_type last_outcards matches ..11 run scoreboard players set cvo var 1 36 | execute if score card_type outcards matches 12 if score card_type last_outcards matches 12 if score sum outcards = sum last_outcards if score cvo_max_card var > cvo_last_max_card var run scoreboard players set cvo var 1 37 | 38 | #其他牌型 39 | execute if score card_type outcards matches 1.. if score card_type outcards = card_type last_outcards if score sum outcards = sum last_outcards if score cvo_max_card var > cvo_last_max_card var run scoreboard players set cvo var 1 40 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/qiang_see1.mcfunction: -------------------------------------------------------------------------------- 1 | #[QS] 抢地主阶段的叫分判定(player1) 2 | #var: qs_temp 3 | 4 | scoreboard players set qs_temp var 0 5 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"Pass"}'}}}},scores={rclick=1..}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player1] jiaofen -1 6 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"叫分"}'}}}},scores={rclick=1..}] run scoreboard players add @e[tag=doudizhu,tag=Pos_Player1] jiaofen 1 7 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"叫分"}'}}}},scores={rclick=1..}] run scoreboard players add jiaofen_times jiaofen 1 8 | execute as @s[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick"}},scores={rclick=1..}] run scoreboard players set qs_temp var 1 9 | #Q 10 | execute as @s[scores={test_q=1..,rclick=0,test_f=0,test_empty=0}] run scoreboard players set @e[tag=doudizhu,tag=Pos_Player1] jiaofen -1 11 | execute as @s[scores={test_q=1..,rclick=0,test_f=0,test_empty=0}] run scoreboard players set qs_temp var 1 12 | #say yes 13 | #execute as @s[scores={test_q=1..,rclick=0,test_f=0,test_empty=0}] run say YES!!! 14 | 15 | execute if score qs_temp var matches 1 if score @e[tag=doudizhu,tag=Pos_Player1,limit=1] jiaofen matches -1 if score jiaofen_times jiaofen matches 0 as @s run tellraw @a [{"selector":"@s","bold":true},{"text":":不叫"}] 16 | execute if score qs_temp var matches 1 if score @e[tag=doudizhu,tag=Pos_Player1,limit=1] jiaofen matches -1 if score jiaofen_times jiaofen matches 1.. as @s run tellraw @a [{"selector":"@s","bold":true},{"text":":不抢"}] 17 | execute if score qs_temp var matches 1 if score @e[tag=doudizhu,tag=Pos_Player1,limit=1] jiaofen matches 1.. if score jiaofen_times jiaofen matches 1 as @s run tellraw @a [{"selector":"@s","bold":true},{"text":":叫地主"}] 18 | execute if score qs_temp var matches 1 if score @e[tag=doudizhu,tag=Pos_Player1,limit=1] jiaofen matches 1.. if score jiaofen_times jiaofen matches 2.. as @s run tellraw @a [{"selector":"@s","bold":true},{"text":":抢地主"}] 19 | 20 | execute as @e[tag=doudizhu,tag=Pos_Player1] unless score qs_temp var matches 0 run function doudizhu:qiang_end_judge -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/bgm_ctrl.mcfunction: -------------------------------------------------------------------------------- 1 | #[BC] 2 | #var: bc_res 3 | 4 | scoreboard players operation bc_res timer = res timer 5 | 6 | #BGM2 7 | execute if score bgm var matches 1 if score round var matches -1 run scoreboard players operation bc_res timer %= 700 const 8 | execute if score bgm var matches 1 if score round var matches -1 if score bc_res timer matches 1 as @a at @s run playsound minecraft:doudizhu.bgm2 record @s 9 | 10 | #BGM1 11 | execute if score bgm var matches 1 if score round var matches 0.. if score bomb_cnt bomb matches 0 run scoreboard players operation bc_res timer %= 700 const 12 | execute if score bgm var matches 1 if score round var matches 0.. if score bomb_cnt bomb matches 0 if score bc_res timer matches 1 run stopsound @a * minecraft:doudizhu.bgm1 13 | execute if score bgm var matches 1 if score round var matches 0.. if score bomb_cnt bomb matches 0 if score bc_res timer matches 1 run stopsound @a * minecraft:doudizhu.bgm2 14 | execute if score bgm var matches 1 if score round var matches 0.. if score bomb_cnt bomb matches 0 if score bc_res timer matches 1 run stopsound @a * minecraft:doudizhu.bgm3 15 | execute if score bgm var matches 1 if score round var matches 0.. if score bomb_cnt bomb matches 0 if score bc_res timer matches 1 as @a at @s run playsound minecraft:doudizhu.bgm1 record @s 16 | 17 | #BGM3 18 | execute if score bgm var matches 1 if score round var matches 0.. if score bomb_cnt bomb matches ..-1 run scoreboard players operation bc_res timer %= 700 const 19 | execute if score bgm var matches 1 if score round var matches 0.. if score bomb_cnt bomb matches ..-1 if score bc_res timer matches 1 run stopsound @a * minecraft:doudizhu.bgm1 20 | execute if score bgm var matches 1 if score round var matches 0.. if score bomb_cnt bomb matches ..-1 if score bc_res timer matches 1 run stopsound @a * minecraft:doudizhu.bgm2 21 | execute if score bgm var matches 1 if score round var matches 0.. if score bomb_cnt bomb matches ..-1 if score bc_res timer matches 1 run stopsound @a * minecraft:doudizhu.bgm3 22 | execute if score bgm var matches 1 if score round var matches 0.. if score bomb_cnt bomb matches ..-1 if score bc_res timer matches 1 as @a at @s run playsound minecraft:doudizhu.bgm3 record @s -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/see1.mcfunction: -------------------------------------------------------------------------------- 1 | #[RT] 游戏开始后对牌的选择(Player1) 2 | #var:temp 3 | 4 | 5 | scoreboard players set temp var 0 6 | execute as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player1,tag=!Outcard] run data merge entity @s {Glowing:1b} 7 | execute as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player1,tag=!Outcard] run scoreboard players set temp var -1 8 | #原来是选择的1,原来是没选的2,只是看着为-1 9 | execute if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Selected,tag=Card,tag=Player1,tag=!Outcard] run scoreboard players set temp var 1 10 | execute if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=!Selected,tag=Card,tag=Player1,tag=!Outcard] run scoreboard players set temp var 2 11 | execute if score temp var matches 1 if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player1,tag=!Outcard] run team leave @s 12 | execute if score temp var matches 1 if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player1,tag=!Outcard] run tag @s remove Selected 13 | execute if score temp var matches 1 if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player1,tag=!Outcard] at @s run tp @s ~ ~-0.5 ~ 14 | 15 | execute if score temp var matches 2 if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player1,tag=!Outcard] run team join Selected @s 16 | execute if score temp var matches 2 if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player1,tag=!Outcard] run tag @s add Selected 17 | execute if score temp var matches 2 if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player1,tag=!Outcard] at @s run tp @s ~ ~0.5 ~ 18 | 19 | 20 | 21 | #execute if entity @s[distance=..5] unless entity @e[type=armor_stand,tag=doudizhu,limit=1,distance=..0.3] positioned ^ ^ ^0.3 run function doudizhu:loop/see 22 | execute if entity @s[distance=..5] if score temp var matches 0 positioned ^ ^ ^0.3 run function doudizhu:loop/see1 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/see2.mcfunction: -------------------------------------------------------------------------------- 1 | #[RT] 游戏开始后对牌的选择(Player2) 2 | #var:temp 3 | 4 | 5 | scoreboard players set temp var 0 6 | execute as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player2,tag=!Outcard] run data merge entity @s {Glowing:1b} 7 | execute as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player2,tag=!Outcard] run scoreboard players set temp var -1 8 | #原来是选择的1,原来是没选的2,只是看着为-1 9 | execute if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Selected,tag=Card,tag=Player2,tag=!Outcard] run scoreboard players set temp var 1 10 | execute if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=!Selected,tag=Card,tag=Player2,tag=!Outcard] run scoreboard players set temp var 2 11 | execute if score temp var matches 1 if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player2,tag=!Outcard] run team leave @s 12 | execute if score temp var matches 1 if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player2,tag=!Outcard] run tag @s remove Selected 13 | execute if score temp var matches 1 if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player2,tag=!Outcard] at @s run tp @s ~ ~-0.5 ~ 14 | 15 | execute if score temp var matches 2 if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player2,tag=!Outcard] run team join Selected @s 16 | execute if score temp var matches 2 if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player2,tag=!Outcard] run tag @s add Selected 17 | execute if score temp var matches 2 if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player2,tag=!Outcard] at @s run tp @s ~ ~0.5 ~ 18 | 19 | 20 | 21 | #execute if entity @s[distance=..5] unless entity @e[type=armor_stand,tag=doudizhu,limit=1,distance=..0.3] positioned ^ ^ ^0.3 run function doudizhu:loop/see 22 | execute if entity @s[distance=..5] if score temp var matches 0 positioned ^ ^ ^0.3 run function doudizhu:loop/see2 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/see3.mcfunction: -------------------------------------------------------------------------------- 1 | #[RT] 游戏开始后对牌的选择(Player3) 2 | #var:temp 3 | 4 | #say 1 5 | #execute as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1] run say I see 6 | scoreboard players set temp var 0 7 | execute as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player3,tag=!Outcard] run data merge entity @s {Glowing:1b} 8 | execute as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player3,tag=!Outcard] run scoreboard players set temp var -1 9 | #原来是选择的1,原来是没选的2,只是看着为-1 10 | execute if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Selected,tag=Card,tag=Player3,tag=!Outcard] run scoreboard players set temp var 1 11 | execute if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=!Selected,tag=Card,tag=Player3,tag=!Outcard] run scoreboard players set temp var 2 12 | execute if score temp var matches 1 if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player3,tag=!Outcard] run team leave @s 13 | execute if score temp var matches 1 if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player3,tag=!Outcard] run tag @s remove Selected 14 | execute if score temp var matches 1 if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player3,tag=!Outcard] at @s run tp @s ~ ~-0.5 ~ 15 | 16 | execute if score temp var matches 2 if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player3,tag=!Outcard] run team join Selected @s 17 | execute if score temp var matches 2 if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player3,tag=!Outcard] run tag @s add Selected 18 | execute if score temp var matches 2 if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,type=armor_stand,distance=..0.3,limit=1,tag=Card,tag=Player3,tag=!Outcard] at @s run tp @s ~ ~0.5 ~ 19 | 20 | 21 | 22 | #execute if entity @s[distance=..5] unless entity @e[type=armor_stand,tag=doudizhu,limit=1,distance=..0.3] positioned ^ ^ ^0.3 run function doudizhu:loop/see 23 | execute if entity @s[distance=..5] if score temp var matches 0 positioned ^ ^ ^0.3 run function doudizhu:loop/see3 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/final_show_title.mcfunction: -------------------------------------------------------------------------------- 1 | #[FST] 游戏结束时,给玩家展示胜利或失败title, 同时播放音效 2 | 3 | title @a times 10 40 20 4 | #地主胜利 5 | execute if entity @e[tag=doudizhu,tag=Pos_Player,tag=Finished,tag=dizhu] run title @a[tag=dizhu,tag=Playing] subtitle [{"text":"+","bold":true,"color":"gold"},{"score":{"name":"#base1","objective":"score"},"bold":true,"color":"gold"}] 6 | execute if entity @e[tag=doudizhu,tag=Pos_Player,tag=Finished,tag=dizhu] run title @a[tag=!dizhu,tag=Playing] subtitle [{"text":"-","bold":true,"color":"red"},{"score":{"name":"#base2","objective":"score"},"bold":true,"color":"red"}] 7 | execute if entity @e[tag=doudizhu,tag=Pos_Player,tag=Finished,tag=dizhu] run title @a[tag=dizhu,tag=Playing] title {"text":"地主胜利","color":"yellow"} 8 | execute if entity @e[tag=doudizhu,tag=Pos_Player,tag=Finished,tag=dizhu] run title @a[tag=!dizhu,tag=Playing] title {"text":"农民失败","color":"gray"} 9 | execute if entity @e[tag=doudizhu,tag=Pos_Player,tag=Finished,tag=dizhu] as @e[tag=doudizhu,tag=Center,limit=1] at @s run playsound minecraft:doudizhu.win voice @a[tag=dizhu,tag=Playing] 10 | execute if entity @e[tag=doudizhu,tag=Pos_Player,tag=Finished,tag=dizhu] as @e[tag=doudizhu,tag=Center,limit=1] at @s run playsound minecraft:doudizhu.lose voice @a[tag=!dizhu,tag=Playing] 11 | 12 | #农民胜利 13 | execute if entity @e[tag=doudizhu,tag=Pos_Player,tag=Finished,tag=!dizhu] run title @a[tag=dizhu,tag=Playing] subtitle [{"text":"-","bold":true,"color":"gold"},{"score":{"name":"#base1","objective":"score"},"bold":true,"color":"gold"}] 14 | execute if entity @e[tag=doudizhu,tag=Pos_Player,tag=Finished,tag=!dizhu] run title @a[tag=!dizhu,tag=Playing] subtitle [{"text":"+","bold":true,"color":"red"},{"score":{"name":"#base2","objective":"score"},"bold":true,"color":"red"}] 15 | execute if entity @e[tag=doudizhu,tag=Pos_Player,tag=Finished,tag=!dizhu] run title @a[tag=dizhu,tag=Playing] title {"text":"地主失败","color":"gray"} 16 | execute if entity @e[tag=doudizhu,tag=Pos_Player,tag=Finished,tag=!dizhu] run title @a[tag=!dizhu,tag=Playing] title {"text":"农民胜利","color":"red"} 17 | execute if entity @e[tag=doudizhu,tag=Pos_Player,tag=Finished,tag=!dizhu] as @e[tag=doudizhu,tag=Center,limit=1] at @s run playsound minecraft:doudizhu.win voice @a[tag=!dizhu,tag=Playing] 18 | execute if entity @e[tag=doudizhu,tag=Pos_Player,tag=Finished,tag=!dizhu] as @e[tag=doudizhu,tag=Center,limit=1] at @s run playsound minecraft:doudizhu.lose voice @a[tag=dizhu,tag=Playing] -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/upd_info.mcfunction: -------------------------------------------------------------------------------- 1 | #[UI] 更新UI上的有关信息 2 | 3 | #解析用木板 4 | execute as @e[tag=doudizhu,tag=Center,limit=1] at @s positioned ~ 1 ~ run setblock ~ ~ ~ minecraft:oak_sign replace 5 | 6 | #更新Base_score信息 7 | execute as @e[tag=doudizhu,tag=Center,limit=1] at @s positioned ~ 1 ~ run data modify block ~ ~ ~ Text1 set value '{"score":{"name":"#base","objective":"score"},"bold":true,"color":"light_purple"}' 8 | execute as @e[tag=doudizhu,tag=Center,limit=1] at @s positioned ~ 1 ~ run data modify entity @e[tag=doudizhu,tag=UI,tag=Base_score,limit=1] CustomName set from block ~ ~ ~ Text1 9 | 10 | #更新Skin_type信息 11 | execute if score skin_type skin matches 1 run data modify entity @e[tag=doudizhu,tag=UI,tag=Skin_type,limit=1] CustomName set value '{"text":"Full screen (by KC)","bold":true,"color":"aqua"}' 12 | execute if score skin_type skin matches 2 run data modify entity @e[tag=doudizhu,tag=UI,tag=Skin_type,limit=1] CustomName set value '{"text":"Clover (by xwjcool)","bold":true,"color":"dark_green"}' 13 | execute if score skin_type skin matches 3 run data modify entity @e[tag=doudizhu,tag=UI,tag=Skin_type,limit=1] CustomName set value '{"text":"Clover 牌背分离版 (by xwjcool)","bold":true,"color":"dark_green"}' 14 | 15 | #更新switch 16 | execute if score voice_chat var matches 1 run data modify entity @e[tag=doudizhu,tag=UI,tag=Voice,limit=1] ArmorItems[3].tag.CustomModelData set value 204 17 | execute if score voice_chat var matches 0 run data modify entity @e[tag=doudizhu,tag=UI,tag=Voice,limit=1] ArmorItems[3].tag.CustomModelData set value 203 18 | execute if score bgm var matches 1 run data modify entity @e[tag=doudizhu,tag=UI,tag=BGM,limit=1] ArmorItems[3].tag.CustomModelData set value 204 19 | execute if score bgm var matches 0 run data modify entity @e[tag=doudizhu,tag=UI,tag=BGM,limit=1] ArmorItems[3].tag.CustomModelData set value 203 20 | execute if score google var matches 1 run data modify entity @e[tag=doudizhu,tag=UI,tag=Google,limit=1] ArmorItems[3].tag.CustomModelData set value 204 21 | execute if score google var matches 0 run data modify entity @e[tag=doudizhu,tag=UI,tag=Google,limit=1] ArmorItems[3].tag.CustomModelData set value 203 22 | execute if score qiang_mode var matches 1 run data modify entity @e[tag=doudizhu,tag=UI,tag=Qiang_Mode,limit=1] ArmorItems[3].tag.CustomModelData set value 204 23 | execute if score qiang_mode var matches 0 run data modify entity @e[tag=doudizhu,tag=UI,tag=Qiang_Mode,limit=1] ArmorItems[3].tag.CustomModelData set value 203 24 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/get_random.mcfunction: -------------------------------------------------------------------------------- 1 | #[RD] Get a random number in [0,2^31-1] 2 | #return:rd_x 3 | 4 | #declare objective rd_x 5 | scoreboard players set rd_x var 0 6 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 1073741824 7 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 536870912 8 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 268435456 9 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 134217728 10 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 67108864 11 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 33554432 12 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 16777216 13 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 8388608 14 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 4194304 15 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 2097152 16 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 1048576 17 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 524288 18 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 262144 19 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 131072 20 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 65536 21 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 32768 22 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 16384 23 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 8192 24 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 4096 25 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 2048 26 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 1024 27 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 512 28 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 256 29 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 128 30 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 64 31 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 32 32 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 16 33 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 8 34 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 4 35 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 2 36 | execute if predicate doudizhu:half_chance run scoreboard players add rd_x var 1 37 | 38 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/recursive/radix_sort_recursive2.mcfunction: -------------------------------------------------------------------------------- 1 | #[RS] Radix sort for bit k -> sf_i 2 | #input: rs(list), rs_i, rs_k, lists (rs_0 to rs_9 in doudizhu:cards) 3 | #var: temp(temporarily store rs[0] in var) 4 | 5 | #get value 6 | #data modify storage doudizhu:cards temp set from storage doudizhu:cards rs[0] 7 | execute store result score temp var run data get storage doudizhu:cards rs[0] 8 | #DEBUG 9 | #tellraw @a [{"score": {"name": "rs_k","objective": "var"}},{"text":" rs_k"}] 10 | #tellraw @a [{"score": {"name": "temp","objective": "var"}},{"text":" temp"}] 11 | 12 | execute if score rs_k var matches 2.. run scoreboard players operation temp var /= 10 const 13 | execute if score rs_k var matches 3.. run scoreboard players operation temp var /= 10 const 14 | execute if score rs_k var matches 4.. run scoreboard players operation temp var /= 10 const 15 | execute if score rs_k var matches 5.. run scoreboard players operation temp var /= 10 const 16 | execute if score rs_k var matches 6.. run scoreboard players operation temp var /= 10 const 17 | execute if score rs_k var matches 7.. run scoreboard players operation temp var /= 10 const 18 | execute if score rs_k var matches 8.. run scoreboard players operation temp var /= 10 const 19 | execute if score rs_k var matches 9.. run scoreboard players operation temp var /= 10 const 20 | execute if score rs_k var matches 10.. run scoreboard players operation temp var /= 10 const 21 | scoreboard players operation temp var %= 10 const 22 | 23 | execute if score temp var matches 0 run data modify storage doudizhu:cards rs_0 append from storage doudizhu:cards rs[0] 24 | execute if score temp var matches 1 run data modify storage doudizhu:cards rs_1 append from storage doudizhu:cards rs[0] 25 | execute if score temp var matches 2 run data modify storage doudizhu:cards rs_2 append from storage doudizhu:cards rs[0] 26 | execute if score temp var matches 3 run data modify storage doudizhu:cards rs_3 append from storage doudizhu:cards rs[0] 27 | execute if score temp var matches 4 run data modify storage doudizhu:cards rs_4 append from storage doudizhu:cards rs[0] 28 | execute if score temp var matches 5 run data modify storage doudizhu:cards rs_5 append from storage doudizhu:cards rs[0] 29 | execute if score temp var matches 6 run data modify storage doudizhu:cards rs_6 append from storage doudizhu:cards rs[0] 30 | execute if score temp var matches 7 run data modify storage doudizhu:cards rs_7 append from storage doudizhu:cards rs[0] 31 | execute if score temp var matches 8 run data modify storage doudizhu:cards rs_8 append from storage doudizhu:cards rs[0] 32 | execute if score temp var matches 9 run data modify storage doudizhu:cards rs_9 append from storage doudizhu:cards rs[0] 33 | 34 | data remove storage doudizhu:cards rs[0] 35 | scoreboard players remove rs_i var 1 36 | execute if score rs_i var matches 1.. run function doudizhu:recursive/radix_sort_recursive2 37 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/show_outcards.mcfunction: -------------------------------------------------------------------------------- 1 | #[SO] 将Selected的牌生成并kill掉Selected的牌 2 | #var:"SO_1",temp,i 3 | 4 | #确定初始位置 5 | execute if score round var matches 0 as @e[tag=doudizhu,tag=Pos_Player1] at @s positioned ^-3 ^ ^ run summon area_effect_cloud ~ ~-3 ~ {Duration:2147483647,Tags:["doudizhu","SO_1"]} 6 | execute if score round var matches 1 as @e[tag=doudizhu,tag=Pos_Player2] at @s positioned ^-3 ^ ^ run summon area_effect_cloud ~ ~-3 ~ {Duration:2147483647,Tags:["doudizhu","SO_1"]} 7 | execute if score round var matches 2 as @e[tag=doudizhu,tag=Pos_Player3] at @s positioned ^-3 ^ ^ run summon area_effect_cloud ~ ~-3 ~ {Duration:2147483647,Tags:["doudizhu","SO_1"]} 8 | execute if score round var matches 0 run data modify entity @e[tag=doudizhu,tag=SO_1,limit=1] Rotation[0] set from entity @e[tag=doudizhu,tag=Pos_Player1,limit=1] Rotation[0] 9 | execute if score round var matches 1 run data modify entity @e[tag=doudizhu,tag=SO_1,limit=1] Rotation[0] set from entity @e[tag=doudizhu,tag=Pos_Player2,limit=1] Rotation[0] 10 | execute if score round var matches 2 run data modify entity @e[tag=doudizhu,tag=SO_1,limit=1] Rotation[0] set from entity @e[tag=doudizhu,tag=Pos_Player3,limit=1] Rotation[0] 11 | 12 | execute if score card_cnt outcards matches 2.. as @e[tag=doudizhu,tag=SO_1] at @s run tp ^ ^ ^-0.4 13 | execute if score card_cnt outcards matches 4.. as @e[tag=doudizhu,tag=SO_1] at @s run tp ^ ^ ^-0.4 14 | execute if score card_cnt outcards matches 6.. as @e[tag=doudizhu,tag=SO_1] at @s run tp ^ ^ ^-0.4 15 | execute if score card_cnt outcards matches 8.. as @e[tag=doudizhu,tag=SO_1] at @s run tp ^ ^ ^-0.4 16 | execute if score card_cnt outcards matches 10.. as @e[tag=doudizhu,tag=SO_1] at @s run tp ^ ^ ^-0.4 17 | execute if score card_cnt outcards matches 12.. as @e[tag=doudizhu,tag=SO_1] at @s run tp ^ ^ ^-0.4 18 | execute if score card_cnt outcards matches 14.. as @e[tag=doudizhu,tag=SO_1] at @s run tp ^ ^ ^-0.4 19 | execute if score card_cnt outcards matches 16.. as @e[tag=doudizhu,tag=SO_1] at @s run tp ^ ^ ^-0.4 20 | execute if score card_cnt outcards matches 18.. as @e[tag=doudizhu,tag=SO_1] at @s run tp ^ ^ ^-0.4 21 | execute if score card_cnt outcards matches 20.. as @e[tag=doudizhu,tag=SO_1] at @s run tp ^ ^ ^-0.4 22 | 23 | #找被选择的牌并出牌 24 | scoreboard players set i var 20 25 | execute if score round var matches 0 as @e[tag=doudizhu,tag=Pos_Player1] at @s positioned ^ ^ ^-3 positioned ~ ~0.5 ~ run function doudizhu:recursive/show_outcards_recursive 26 | execute if score round var matches 1 as @e[tag=doudizhu,tag=Pos_Player2] at @s positioned ^ ^ ^-3 positioned ~ ~0.5 ~ run function doudizhu:recursive/show_outcards_recursive 27 | execute if score round var matches 2 as @e[tag=doudizhu,tag=Pos_Player3] at @s positioned ^ ^ ^-3 positioned ~ ~0.5 ~ run function doudizhu:recursive/show_outcards_recursive 28 | kill @e[tag=doudizhu,tag=SO_1] 29 | execute if score skin_type skin matches 3 run schedule function doudizhu:show_outcards_elapse 5t replace 30 | execute unless score skin_type skin matches 3 run function doudizhu:show_outcards_elapse 31 | 32 | #更新last_outcards记分板 33 | scoreboard players operation max_card last_outcards = max_card outcards 34 | scoreboard players operation card_type last_outcards = card_type outcards 35 | scoreboard players operation sum last_outcards = sum outcards 36 | 37 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/get_card_type/is_4.mcfunction: -------------------------------------------------------------------------------- 1 | #[CT] 三带一 2 | #input: scb -> outcards (1,2,...,15,sum) card_cnt 3 | #var: temp 4 | #return: card_type max_card 5 | 6 | #找主元 7 | execute if score 1 outcards matches 3 run scoreboard players set max_card outcards 1 8 | execute if score 2 outcards matches 3 run scoreboard players set max_card outcards 2 9 | execute if score 3 outcards matches 3 run scoreboard players set max_card outcards 3 10 | execute if score 4 outcards matches 3 run scoreboard players set max_card outcards 4 11 | execute if score 5 outcards matches 3 run scoreboard players set max_card outcards 5 12 | execute if score 6 outcards matches 3 run scoreboard players set max_card outcards 6 13 | execute if score 7 outcards matches 3 run scoreboard players set max_card outcards 7 14 | execute if score 8 outcards matches 3 run scoreboard players set max_card outcards 8 15 | execute if score 9 outcards matches 3 run scoreboard players set max_card outcards 9 16 | execute if score 10 outcards matches 3 run scoreboard players set max_card outcards 10 17 | execute if score 11 outcards matches 3 run scoreboard players set max_card outcards 11 18 | execute if score 12 outcards matches 3 run scoreboard players set max_card outcards 12 19 | execute if score 13 outcards matches 3 run scoreboard players set max_card outcards 13 20 | #找带牌 21 | scoreboard players set temp var 0 22 | execute if score max_card outcards matches 1.. if score 1 outcards matches 1 run scoreboard players set temp var 1 23 | execute if score max_card outcards matches 1.. if score 2 outcards matches 1 run scoreboard players set temp var 2 24 | execute if score max_card outcards matches 1.. if score 3 outcards matches 1 run scoreboard players set temp var 3 25 | execute if score max_card outcards matches 1.. if score 4 outcards matches 1 run scoreboard players set temp var 4 26 | execute if score max_card outcards matches 1.. if score 5 outcards matches 1 run scoreboard players set temp var 5 27 | execute if score max_card outcards matches 1.. if score 6 outcards matches 1 run scoreboard players set temp var 6 28 | execute if score max_card outcards matches 1.. if score 7 outcards matches 1 run scoreboard players set temp var 7 29 | execute if score max_card outcards matches 1.. if score 8 outcards matches 1 run scoreboard players set temp var 8 30 | execute if score max_card outcards matches 1.. if score 9 outcards matches 1 run scoreboard players set temp var 9 31 | execute if score max_card outcards matches 1.. if score 10 outcards matches 1 run scoreboard players set temp var 10 32 | execute if score max_card outcards matches 1.. if score 11 outcards matches 1 run scoreboard players set temp var 11 33 | execute if score max_card outcards matches 1.. if score 12 outcards matches 1 run scoreboard players set temp var 12 34 | execute if score max_card outcards matches 1.. if score 13 outcards matches 1 run scoreboard players set temp var 13 35 | execute if score max_card outcards matches 1.. if score 14 outcards matches 1 run scoreboard players set temp var 14 36 | execute if score max_card outcards matches 1.. if score 15 outcards matches 1 run scoreboard players set temp var 15 37 | 38 | execute if score max_card outcards matches 1.. if score temp var matches 1.. run scoreboard players set card_type outcards 4 39 | execute if score card_type outcards matches 0 run scoreboard players set max_card outcards 0 40 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/get_card_type/is_5.mcfunction: -------------------------------------------------------------------------------- 1 | #[CT] 三带二 2 | #input: scb -> outcards (1,2,...,15,sum) card_cnt 3 | #var: temp 4 | #return: card_type max_card 5 | 6 | #找主元 7 | execute if score 1 outcards matches 3 run scoreboard players set max_card outcards 1 8 | execute if score 2 outcards matches 3 run scoreboard players set max_card outcards 2 9 | execute if score 3 outcards matches 3 run scoreboard players set max_card outcards 3 10 | execute if score 4 outcards matches 3 run scoreboard players set max_card outcards 4 11 | execute if score 5 outcards matches 3 run scoreboard players set max_card outcards 5 12 | execute if score 6 outcards matches 3 run scoreboard players set max_card outcards 6 13 | execute if score 7 outcards matches 3 run scoreboard players set max_card outcards 7 14 | execute if score 8 outcards matches 3 run scoreboard players set max_card outcards 8 15 | execute if score 9 outcards matches 3 run scoreboard players set max_card outcards 9 16 | execute if score 10 outcards matches 3 run scoreboard players set max_card outcards 10 17 | execute if score 11 outcards matches 3 run scoreboard players set max_card outcards 11 18 | execute if score 12 outcards matches 3 run scoreboard players set max_card outcards 12 19 | execute if score 13 outcards matches 3 run scoreboard players set max_card outcards 13 20 | #找带牌 21 | scoreboard players set temp var 0 22 | execute if score max_card outcards matches 1.. if score 1 outcards matches 2 run scoreboard players set temp var 1 23 | execute if score max_card outcards matches 1.. if score 2 outcards matches 2 run scoreboard players set temp var 2 24 | execute if score max_card outcards matches 1.. if score 3 outcards matches 2 run scoreboard players set temp var 3 25 | execute if score max_card outcards matches 1.. if score 4 outcards matches 2 run scoreboard players set temp var 4 26 | execute if score max_card outcards matches 1.. if score 5 outcards matches 2 run scoreboard players set temp var 5 27 | execute if score max_card outcards matches 1.. if score 6 outcards matches 2 run scoreboard players set temp var 6 28 | execute if score max_card outcards matches 1.. if score 7 outcards matches 2 run scoreboard players set temp var 7 29 | execute if score max_card outcards matches 1.. if score 8 outcards matches 2 run scoreboard players set temp var 8 30 | execute if score max_card outcards matches 1.. if score 9 outcards matches 2 run scoreboard players set temp var 9 31 | execute if score max_card outcards matches 1.. if score 10 outcards matches 2 run scoreboard players set temp var 10 32 | execute if score max_card outcards matches 1.. if score 11 outcards matches 2 run scoreboard players set temp var 11 33 | execute if score max_card outcards matches 1.. if score 12 outcards matches 2 run scoreboard players set temp var 12 34 | execute if score max_card outcards matches 1.. if score 13 outcards matches 2 run scoreboard players set temp var 13 35 | execute if score max_card outcards matches 1.. if score 14 outcards matches 2 run scoreboard players set temp var 14 36 | execute if score max_card outcards matches 1.. if score 15 outcards matches 2 run scoreboard players set temp var 15 37 | 38 | execute if score max_card outcards matches 1.. if score temp var matches 1.. run scoreboard players set card_type outcards 5 39 | execute if score card_type outcards matches 0 run scoreboard players set max_card outcards 0 40 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/replaceitem_green_dye.mcfunction: -------------------------------------------------------------------------------- 1 | #[RGD] 重新填充使用voice chat的玩家背包 2 | 3 | clear @s minecraft:green_dye 4 | replaceitem entity @a inventory.0 minecraft:green_dye{CustomModelData:401,display:{Name:'{"text":"得"}',Lore:['{"text":"得✖17"}']}} 5 | 6 | replaceitem entity @a inventory.1 minecraft:green_dye{CustomModelData:402,display:{Name:'{"text":"赌怪"}',Lore:['{"text":"赌怪"}']}} 7 | 8 | replaceitem entity @a inventory.2 minecraft:green_dye{CustomModelData:403,display:{Name:'{"text":"陈刀仔"}',Lore:['{"text":"当年陈刀仔他能用20块赢到3700万"}','{"text":"我卢本伟用20万赢到500万不是问题"}']}} 9 | 10 | replaceitem entity @a inventory.3 minecraft:green_dye{CustomModelData:404,display:{Name:'{"text":"很NB这个牌"}',Lore:['{"text":"很NB这个牌"}']}} 11 | 12 | replaceitem entity @a inventory.4 minecraft:green_dye{CustomModelData:405,display:{Name:'{"text":"阿姨你快点"}',Lore:['{"text":"阿姨你快点别磨磨蹭蹭的"}']}} 13 | 14 | replaceitem entity @a inventory.5 minecraft:green_dye{CustomModelData:406,display:{Name:'{"text":"卡布奇诺"}',Lore:['{"text":"给阿姨倒杯茶好吧"}','{"text":"给阿姨倒一杯卡布奇诺"}']}} 15 | 16 | replaceitem entity @a inventory.6 minecraft:green_dye{CustomModelData:407,display:{Name:'{"text":"漂亮"}',Lore:['{"text":"漂亮"}']}} 17 | 18 | replaceitem entity @a inventory.7 minecraft:green_dye{CustomModelData:408,display:{Name:'{"text":"17张牌你能秒我?"}',Lore:['{"text":"17张牌,你能秒我?你能秒杀我?"}']}} 19 | 20 | replaceitem entity @a inventory.8 minecraft:green_dye{CustomModelData:409,display:{Name:'{"text":"吃屏幕"}',Lore:['{"text":"你今天能17张牌把卢本伟秒了"}','{"text":"我当场就把这个电脑屏幕吃掉"}']}} 21 | 22 | 23 | replaceitem entity @a inventory.9 minecraft:green_dye{CustomModelData:410,display:{Name:'{"text":"炸弹秀"}',Lore:['{"text":"开始你的炸弹秀"}']}} 24 | 25 | replaceitem entity @a inventory.10 minecraft:green_dye{CustomModelData:411,display:{Name:'{"text":"闷声发大财"}',Lore:['{"text":"闷声发大财"}']}} 26 | 27 | replaceitem entity @a inventory.11 minecraft:green_dye{CustomModelData:412,display:{Name:'{"text":"赢不了我"}',Lore:['{"text":"TA的牌赢不了我"}']}} 28 | 29 | replaceitem entity @a inventory.12 minecraft:green_dye{CustomModelData:413,display:{Name:'{"text":"可是换不得"}',Lore:['{"text":"可是换不得"}']}} 30 | 31 | replaceitem entity @a inventory.13 minecraft:green_dye{CustomModelData:414,display:{Name:'{"text":"阿姨你K都不要吗"}',Lore:['{"text":"阿姨你K都不要吗"}']}} 32 | 33 | replaceitem entity @a inventory.14 minecraft:green_dye{CustomModelData:415,display:{Name:'{"text":"理性打牌"}',Lore:['{"text":"理性打牌"}']}} 34 | 35 | replaceitem entity @a inventory.15 minecraft:green_dye{CustomModelData:416,display:{Name:'{"text":"头有亿点痛"}',Lore:['{"text":"我现在头有亿点痛"}']}} 36 | 37 | replaceitem entity @a inventory.16 minecraft:green_dye{CustomModelData:417,display:{Name:'{"text":"最后的倔强"}',Lore:['{"text":"这400万是我最后的倔强"}']}} 38 | 39 | replaceitem entity @a inventory.17 minecraft:green_dye{CustomModelData:418,display:{Name:'{"text":"快点啊我等到花都谢了"}',Lore:['{"text":"快点啊我等到花都谢了"}']}} 40 | 41 | 42 | replaceitem entity @a inventory.18 minecraft:green_dye{CustomModelData:419,display:{Name:'{"text":"你的牌打的也忒好了"}',Lore:['{"text":"你的牌打的也忒好了"}']}} 43 | 44 | replaceitem entity @a inventory.19 minecraft:green_dye{CustomModelData:420,display:{Name:'{"text":"你是MM还是GG"}',Lore:['{"text":"你是MM还是GG"}']}} 45 | 46 | replaceitem entity @a inventory.20 minecraft:green_dye{CustomModelData:421,display:{Name:'{"text":"决战到天亮"}',Lore:['{"text":"不要走,决战到天亮"}']}} 47 | 48 | replaceitem entity @a inventory.21 minecraft:green_dye{CustomModelData:422,display:{Name:'{"text":"离开"}',Lore:['{"text":"各位,真不好意思,我得离开一会"}']}} 49 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/detect_green_dye.mcfunction: -------------------------------------------------------------------------------- 1 | #[DGD] 检测玩家使用voice chat(green_dye) 2 | 3 | execute if entity @s[nbt=!{Inventory:[{Slot:9b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 1 4 | execute if entity @s[nbt=!{Inventory:[{Slot:10b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 2 5 | execute if entity @s[nbt=!{Inventory:[{Slot:11b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 3 6 | execute if entity @s[nbt=!{Inventory:[{Slot:12b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 4 7 | execute if entity @s[nbt=!{Inventory:[{Slot:13b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 5 8 | execute if entity @s[nbt=!{Inventory:[{Slot:14b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 6 9 | execute if entity @s[nbt=!{Inventory:[{Slot:15b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 7 10 | execute if entity @s[nbt=!{Inventory:[{Slot:16b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 8 11 | execute if entity @s[nbt=!{Inventory:[{Slot:17b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 9 12 | 13 | execute if entity @s[nbt=!{Inventory:[{Slot:18b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 10 14 | execute if entity @s[nbt=!{Inventory:[{Slot:19b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 11 15 | execute if entity @s[nbt=!{Inventory:[{Slot:20b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 12 16 | execute if entity @s[nbt=!{Inventory:[{Slot:21b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 13 17 | execute if entity @s[nbt=!{Inventory:[{Slot:22b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 14 18 | execute if entity @s[nbt=!{Inventory:[{Slot:23b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 15 19 | execute if entity @s[nbt=!{Inventory:[{Slot:24b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 16 20 | execute if entity @s[nbt=!{Inventory:[{Slot:25b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 17 21 | execute if entity @s[nbt=!{Inventory:[{Slot:26b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 18 22 | execute if entity @s[nbt=!{Inventory:[{Slot:27b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 19 23 | 24 | execute if entity @s[nbt=!{Inventory:[{Slot:28b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 20 25 | execute if entity @s[nbt=!{Inventory:[{Slot:29b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 21 26 | execute if entity @s[nbt=!{Inventory:[{Slot:30b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 22 27 | 28 | 29 | #阻止刚进入的玩家播放语音 30 | execute if entity @s[nbt=!{Inventory:[{Slot:17b,id:"minecraft:green_dye"}]}] if entity @s[nbt=!{Inventory:[{Slot:16b,id:"minecraft:green_dye"}]}] run scoreboard players set @s test_green_dye 114514 31 | #execute if entity @s[nbt=!{Inventory:[{Slot:0b,id:"minecraft:carrot_on_a_stick"},{Slot:1b,id:"minecraft:carrot_on_a_stick"}]}] run scoreboard players set @s test_green_dye 114514 32 | #execute if score res timer matches 0 run scoreboard players set @s test_green_dye 114514 33 | #execute if score @s test_green_dye matches 13 if entity @s[nbt=!{Inventory:[{Slot:17b,id:"minecraft:green_dye"}]}] 34 | 35 | #tellraw @a {"score":{"name":"@s","objective":"test_green_dye"}} -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/upd_abandoned_cards_bossbar.mcfunction: -------------------------------------------------------------------------------- 1 | #[UACB] 更新弃牌堆Bossbar 2 | 3 | 4 | #bossbar set show_abandoned_cards name [{"text":"\u0003","font":"m"},{"text":" \u0004","font":"m"},{"text":" \u0005","font":"m"},{"text":" \u0006","font":"m"},{"text":" \u0007","font":"m"},{"text":" \u0008","font":"m"},{"text":" \u0009","font":"m"},{"text":" \u000a","font":"m"},{"text":" \u000b","font":"m"},{"text":" \u000c","font":"m"},{"text":" \u000d","font":"m"},{"text":" \u0001","font":"m"},{"text":" \u0002","font":"m"},{"text":" \u000e","font":"m"},{"text":" \u000f","font":"m"}] 5 | #bossbar set show_abandoned_cards2 name [{"score":{"name":"3","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" "},{"score":{"name":"4","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" "},{"score":{"name":"5","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" "},{"score":{"name":"6","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" "},{"score":{"name":"7","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" "},{"score":{"name":"8","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" "},{"score":{"name":"9","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" "},{"score":{"name":"10","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" "},{"score":{"name":"11","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" "},{"score":{"name":"12","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" "},{"score":{"name":"13","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" "},{"score":{"name":"1","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" "},{"score":{"name":"2","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" "},{"score":{"name":"14","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" "},{"score":{"name":"15","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" "}] 6 | 7 | 8 | bossbar set show_abandoned_cards name ["",{"text":"\u0003","font":"m"},{"score":{"name":"3","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" \u0004","font":"m"},{"score":{"name":"4","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" \u0005","font":"m"},{"score":{"name":"5","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" \u0006","font":"m"},{"score":{"name":"6","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" \u0007","font":"m"},{"score":{"name":"7","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" \u0008","font":"m"},{"score":{"name":"8","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" \u0009","font":"m"},{"score":{"name":"9","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" \u000a","font":"m"},{"score":{"name":"10","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" \u000b","font":"m"},{"score":{"name":"11","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" \u000c","font":"m"},{"score":{"name":"12","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" \u000d","font":"m"},{"score":{"name":"13","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" \u0001","font":"m"},{"score":{"name":"1","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" \u0002","font":"m"},{"score":{"name":"2","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" \u000e","font":"m"},{"score":{"name":"14","objective":"abandoned_cards"},"color":"red","bold":true},{"text":" \u000f","font":"m"},{"score":{"name":"15","objective":"abandoned_cards"},"color":"red","bold":true}] -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/high_light.mcfunction: -------------------------------------------------------------------------------- 1 | #[HL] 高亮正在出牌玩家,并且显示按键提示 2 | 3 | execute if score round var matches -1 run effect give @e[tag=Prepared] glowing 1 0 true 4 | execute if score round var matches 0 run effect give @p[tag=Player1] glowing 1 0 true 5 | execute if score round var matches 1 run effect give @p[tag=Player2] glowing 1 0 true 6 | execute if score round var matches 2 run effect give @p[tag=Player3] glowing 1 0 true 7 | 8 | 9 | #游戏开始前 10 | execute if score round var matches -1 run title @a actionbar ["",{"text":"[Q]","bold":true,"color":"gold"},{"text":": 准备/取消准备 ","color":"gold"},{"text":"[F]","bold":true,"color":"gold"},{"text":": 开始游戏","color":"gold"}] 11 | #叫地主 12 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase1] if score round var matches 0 as @p[tag=Player1] run title @s actionbar ["",{"text":"[Q]","bold":true,"color":"gold"},{"text":": Pass","color":"gold"}] 13 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase1] if score round var matches 1 as @p[tag=Player2] run title @s actionbar ["",{"text":"[Q]","bold":true,"color":"gold"},{"text":": Pass","color":"gold"}] 14 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase1] if score round var matches 2 as @p[tag=Player3] run title @s actionbar ["",{"text":"[Q]","bold":true,"color":"gold"},{"text":": Pass","color":"gold"}] 15 | 16 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase3] if score round var matches 0 as @p[tag=Player1] run title @s actionbar ["",{"text":"[Q]","bold":true,"color":"gold"},{"text":": Pass","color":"gold"}] 17 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase3] if score round var matches 1 as @p[tag=Player2] run title @s actionbar ["",{"text":"[Q]","bold":true,"color":"gold"},{"text":": Pass","color":"gold"}] 18 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase3] if score round var matches 2 as @p[tag=Player3] run title @s actionbar ["",{"text":"[Q]","bold":true,"color":"gold"},{"text":": Pass","color":"gold"}] 19 | #出牌(第一个) 20 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if score round var matches 0 if score sum last_outcards matches 0 as @p[tag=Player1] run title @s actionbar [{"text":"[","color":"gold"},{"text":"F","bold":true,"color":"gold"},{"text":"]: 出牌","color":"gold"}] 21 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if score round var matches 1 if score sum last_outcards matches 0 as @p[tag=Player2] run title @s actionbar [{"text":"[","color":"gold"},{"text":"F","bold":true,"color":"gold"},{"text":"]: 出牌","color":"gold"}] 22 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if score round var matches 2 if score sum last_outcards matches 0 as @p[tag=Player3] run title @s actionbar [{"text":"[","color":"gold"},{"text":"F","bold":true,"color":"gold"},{"text":"]: 出牌","color":"gold"}] 23 | #出牌 24 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if score round var matches 0 if score sum last_outcards matches 1.. as @p[tag=Player1] run title @s actionbar ["",{"text":"[","color":"gold"},{"text":"Q","bold":true,"color":"gold"},{"text":"]: Pass ","color":"gold"},{"text":"[","color":"gold"},{"text":"F","bold":true,"color":"gold"},{"text":"]: 出牌 ","color":"gold"},{"text":"当前牌型长度:","bold":true,"color":"red"},{"score":{"name":"sum","objective":"last_outcards"},"color":"red"}] 25 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if score round var matches 1 if score sum last_outcards matches 1.. as @p[tag=Player2] run title @s actionbar ["",{"text":"[","color":"gold"},{"text":"Q","bold":true,"color":"gold"},{"text":"]: Pass ","color":"gold"},{"text":"[","color":"gold"},{"text":"F","bold":true,"color":"gold"},{"text":"]: 出牌 ","color":"gold"},{"text":"当前牌型长度:","bold":true,"color":"red"},{"score":{"name":"sum","objective":"last_outcards"},"color":"red"}] 26 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if score round var matches 2 if score sum last_outcards matches 1.. as @p[tag=Player3] run title @s actionbar ["",{"text":"[","color":"gold"},{"text":"Q","bold":true,"color":"gold"},{"text":"]: Pass ","color":"gold"},{"text":"[","color":"gold"},{"text":"F","bold":true,"color":"gold"},{"text":"]: 出牌 ","color":"gold"},{"text":"当前牌型长度:","bold":true,"color":"red"},{"score":{"name":"sum","objective":"last_outcards"},"color":"red"}] 27 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/detect_empty1.mcfunction: -------------------------------------------------------------------------------- 1 | #[DE] 错位探测 2 | #调用对象:玩家 3 | 4 | #游戏开始前 5 | execute if score round var matches -1 if entity @s[nbt=!{Inventory:[{Slot:0b,id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"指针"}'}}}]}] run scoreboard players set @s test_empty 1 6 | execute if score round var matches -1 if entity @s[nbt=!{Inventory:[{Slot:1b,id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"前往牌桌/返回大厅"}'}}}]}] run scoreboard players set @s test_empty 1 7 | execute if score round var matches -1 if entity @s[nbt=!{Inventory:[{Slot:4b,id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"欢迎文字"}'}}}]}] run scoreboard players set @s test_empty 1 8 | execute if score round var matches -1 if entity @s[nbt=!{Inventory:[{Slot:5b,id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"基本操作说明"}'}}}]}] run scoreboard players set @s test_empty 1 9 | execute if score round var matches -1 if entity @s[nbt=!{Inventory:[{Slot:6b,id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"快速操作说明"}'}}}]}] run scoreboard players set @s test_empty 1 10 | execute if score round var matches -1 if entity @s[nbt=!{Inventory:[{Slot:7b,id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"声音与快速聊天说明"}'}}}]}] run scoreboard players set @s test_empty 1 11 | execute if score round var matches -1 if entity @s[nbt=!{Inventory:[{Slot:8b,id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"倍数与分数计算说明"}'}}}]}] run scoreboard players set @s test_empty 1 12 | 13 | 14 | #叫地主 15 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase1] if entity @s[nbt=!{Inventory:[{Slot:0b,id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"Pass"}'}}}]}] run scoreboard players set @s test_empty 1 16 | #execute if entity @e[tag=doudizhu,tag=Center,tag=Phase1] if entity @s[scores={test_empty=1..}] run say ~1 17 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase1] if entity @s[nbt=!{Inventory:[{Slot:1b,id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"1分"}'}}}]}] run scoreboard players set @s test_empty 1 18 | #execute if entity @e[tag=doudizhu,tag=Center,tag=Phase1] if entity @s[scores={test_empty=1..}] run say ~2 19 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase1] if entity @s[nbt=!{Inventory:[{Slot:2b,id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"2分"}'}}}]}] run scoreboard players set @s test_empty 1 20 | #execute if entity @e[tag=doudizhu,tag=Center,tag=Phase1] if entity @s[scores={test_empty=1..}] run say ~3 21 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase1] if entity @s[nbt=!{Inventory:[{Slot:3b,id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"3分"}'}}}]}] run scoreboard players set @s test_empty 1 22 | #execute if entity @e[tag=doudizhu,tag=Center,tag=Phase1] if entity @s[scores={test_empty=1..}] run say ~4 23 | 24 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase3] if entity @s[nbt=!{Inventory:[{Slot:0b,id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"Pass"}'}}}]}] run scoreboard players set @s test_empty 1 25 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase3] if entity @s[nbt=!{Inventory:[{Slot:1b,id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"叫分"}'}}}]}] run scoreboard players set @s test_empty 1 26 | 27 | 28 | 29 | #出牌 30 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if entity @s[nbt=!{Inventory:[{Slot:0b,id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"指针"}'}}}]}] run scoreboard players set @s test_empty 1 31 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if entity @s[nbt=!{Inventory:[{Slot:1b,id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"出牌"}'}}}]}] run scoreboard players set @s test_empty 1 32 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if entity @s[nbt=!{Inventory:[{Slot:2b,id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"Pass"}'}}}]}] run scoreboard players set @s test_empty 1 33 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if entity @s[nbt=!{Inventory:[{Slot:3b,id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"放大镜"}'}}}]}] run scoreboard players set @s test_empty 1 34 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if entity @s[nbt=!{Inventory:[{Slot:4b,id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"显示/隐藏弃牌堆记牌器"}'}}}]}] run scoreboard players set @s test_empty 1 35 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/see.mcfunction: -------------------------------------------------------------------------------- 1 | #[RT] 未在游戏中的玩家 2 | #var:rt_temp 3 | 4 | scoreboard players set rt_temp var 0 5 | execute as @e[tag=doudizhu,tag=UI,type=armor_stand,distance=..0.3,limit=1] run data merge entity @s {Glowing:1b} 6 | execute as @e[tag=doudizhu,tag=UI,type=armor_stand,distance=..0.3,limit=1] run scoreboard players set rt_temp var -1 7 | 8 | #execute if score rt_temp var matches -1 run say -1 9 | #准备 10 | #原来有prepar的为1,否则为2,只是看着为-1 11 | execute if entity @s[scores={rclick=1..},tag=Prepared] as @e[tag=doudizhu,tag=UI,type=armor_stand,distance=..0.3,limit=1,tag=Join_game] run scoreboard players set rt_temp var 1 12 | execute if entity @s[scores={rclick=1..},tag=!Prepared] as @e[tag=doudizhu,tag=UI,type=armor_stand,distance=..0.3,limit=1,tag=Join_game] run scoreboard players set rt_temp var 2 13 | execute if score rt_temp var matches 2 run tag @s add Prepared 14 | execute if score rt_temp var matches 2 run tellraw @s {"text":"您已准备","bold":true,"color":"green"} 15 | execute if score rt_temp var matches 1 run tag @s remove Prepared 16 | execute if score rt_temp var matches 1 run tellraw @s {"text":"您已取消准备","bold":true,"color":"red"} 17 | 18 | #开始游戏 19 | execute if entity @s[scores={rclick=1..}] if entity @e[tag=doudizhu,tag=UI,type=armor_stand,distance=..0.3,limit=1,tag=Start_game] as @s run function doudizhu:start_game 20 | 21 | #调节底分 22 | execute if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,tag=UI,type=armor_stand,distance=..0.3,limit=1,tag=L_score] run scoreboard players remove #base score 100 23 | execute if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,tag=UI,type=armor_stand,distance=..0.3,limit=1,tag=R_score] run scoreboard players add #base score 100 24 | execute if entity @s[scores={rclick=1..}] if score rt_temp var matches -1 if score #base score matches ..0 run scoreboard players set #base score 10000 25 | execute if entity @s[scores={rclick=1..}] if score rt_temp var matches -1 if score #base score matches 10001.. run scoreboard players set #base score 100 26 | 27 | #皮肤调节 28 | execute if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,tag=UI,type=armor_stand,distance=..0.3,limit=1,tag=L_skin] run scoreboard players remove skin_type skin 1 29 | execute if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,tag=UI,type=armor_stand,distance=..0.3,limit=1,tag=R_skin] run scoreboard players add skin_type skin 1 30 | execute if entity @s[scores={rclick=1..}] if score rt_temp var matches -1 if score skin_type skin matches ..0 run scoreboard players set skin_type skin 3 31 | execute if entity @s[scores={rclick=1..}] if score rt_temp var matches -1 if score skin_type skin matches 4.. run scoreboard players set skin_type skin 1 32 | 33 | #启用/禁用voice chat 34 | execute if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,tag=UI,type=armor_stand,distance=..0.3,limit=1,tag=Voice] run scoreboard players add voice_chat var 1 35 | execute if entity @s[scores={rclick=1..}] if score rt_temp var matches -1 if score voice_chat var matches 2.. run scoreboard players set voice_chat var 0 36 | 37 | #启用/禁用BGM 38 | execute if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,tag=UI,type=armor_stand,distance=..0.3,limit=1,tag=BGM] run scoreboard players add bgm var 1 39 | execute if entity @s[scores={rclick=1..}] if score rt_temp var matches -1 if score bgm var matches 2.. run scoreboard players set bgm var 0 40 | execute if entity @s[scores={rclick=1..}] if score rt_temp var matches -1 if score bgm var matches 0 if entity @e[tag=doudizhu,tag=UI,type=armor_stand,distance=..0.3,limit=1,tag=BGM] run stopsound @a 41 | execute if entity @s[scores={rclick=1..}] if score rt_temp var matches -1 if score bgm var matches 1 if entity @e[tag=doudizhu,tag=UI,type=armor_stand,distance=..0.3,limit=1,tag=BGM] run scoreboard players operation time_index timer = now_time timer 42 | 43 | #启用/禁用出牌声音 44 | execute if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,tag=UI,type=armor_stand,distance=..0.3,limit=1,tag=Google] run scoreboard players add google var 1 45 | execute if entity @s[scores={rclick=1..}] if score rt_temp var matches -1 if score google var matches 2.. run scoreboard players set google var 0 46 | 47 | #启用/禁用抢地主模式 48 | execute if entity @s[scores={rclick=1..}] as @e[tag=doudizhu,tag=UI,type=armor_stand,distance=..0.3,limit=1,tag=Qiang_Mode] run scoreboard players add qiang_mode var 1 49 | execute if entity @s[scores={rclick=1..}] if score rt_temp var matches -1 if score qiang_mode var matches 2.. run scoreboard players set qiang_mode var 0 50 | 51 | 52 | #更新UI显示 53 | execute if entity @s[scores={rclick=1..}] if score rt_temp var matches -1 run function doudizhu:upd_info 54 | 55 | 56 | execute if entity @s[scores={rclick=1..}] if score rt_temp var matches -1 run scoreboard players set @s rclick 0 57 | execute if entity @s[distance=..5] if score rt_temp var matches 0 positioned ^ ^ ^0.3 run function doudizhu:loop/see -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/get_card_type/is_6.mcfunction: -------------------------------------------------------------------------------- 1 | #[CT] 四带二 2 | #input: scb -> outcards (1,2,...,15,sum) card_cnt 3 | #var: temp 4 | #return: card_type max_card 5 | 6 | #找主元 7 | execute if score 1 outcards matches 4 run scoreboard players set max_card outcards 1 8 | execute if score 2 outcards matches 4 run scoreboard players set max_card outcards 2 9 | execute if score 3 outcards matches 4 run scoreboard players set max_card outcards 3 10 | execute if score 4 outcards matches 4 run scoreboard players set max_card outcards 4 11 | execute if score 5 outcards matches 4 run scoreboard players set max_card outcards 5 12 | execute if score 6 outcards matches 4 run scoreboard players set max_card outcards 6 13 | execute if score 7 outcards matches 4 run scoreboard players set max_card outcards 7 14 | execute if score 8 outcards matches 4 run scoreboard players set max_card outcards 8 15 | execute if score 9 outcards matches 4 run scoreboard players set max_card outcards 9 16 | execute if score 10 outcards matches 4 run scoreboard players set max_card outcards 10 17 | execute if score 11 outcards matches 4 run scoreboard players set max_card outcards 11 18 | execute if score 12 outcards matches 4 run scoreboard players set max_card outcards 12 19 | execute if score 13 outcards matches 4 run scoreboard players set max_card outcards 13 20 | #找带牌 21 | #scoreboard players set temp var 0 22 | #execute if score max_card outcards matches 1.. if score 1 outcards matches 2 run scoreboard players set temp var 1 23 | #execute if score max_card outcards matches 1.. if score 2 outcards matches 2 run scoreboard players set temp var 2 24 | #execute if score max_card outcards matches 1.. if score 3 outcards matches 2 run scoreboard players set temp var 3 25 | #execute if score max_card outcards matches 1.. if score 4 outcards matches 2 run scoreboard players set temp var 4 26 | #execute if score max_card outcards matches 1.. if score 5 outcards matches 2 run scoreboard players set temp var 5 27 | #execute if score max_card outcards matches 1.. if score 6 outcards matches 2 run scoreboard players set temp var 6 28 | #execute if score max_card outcards matches 1.. if score 7 outcards matches 2 run scoreboard players set temp var 7 29 | #execute if score max_card outcards matches 1.. if score 8 outcards matches 2 run scoreboard players set temp var 8 30 | #execute if score max_card outcards matches 1.. if score 9 outcards matches 2 run scoreboard players set temp var 9 31 | #execute if score max_card outcards matches 1.. if score 10 outcards matches 2 run scoreboard players set temp var 10 32 | #execute if score max_card outcards matches 1.. if score 11 outcards matches 2 run scoreboard players set temp var 11 33 | #execute if score max_card outcards matches 1.. if score 12 outcards matches 2 run scoreboard players set temp var 12 34 | #execute if score max_card outcards matches 1.. if score 13 outcards matches 2 run scoreboard players set temp var 13 35 | #execute if score max_card outcards matches 1.. if score 14 outcards matches 2 run scoreboard players set temp var 14 36 | #execute if score max_card outcards matches 1.. if score 15 outcards matches 2 run scoreboard players set temp var 15 37 | scoreboard players set temp var 0 38 | #六张牌的情况:双王不能四带二 39 | execute if score card_cnt outcards matches 6 run scoreboard players set temp var 1 40 | execute if score max_card outcards matches 1.. if score card_cnt outcards matches 6 if score 15 outcards matches 1 if score 14 outcards matches 1 run scoreboard players set temp var 0 41 | 42 | #八张牌的情况 43 | execute if score card_cnt outcards matches 8 run scoreboard players set temp var 0 44 | execute if score card_cnt outcards matches 8 if score max_card outcards matches 1.. if score 1 outcards matches 2 run scoreboard players add temp var 1 45 | execute if score card_cnt outcards matches 8 if score max_card outcards matches 1.. if score 2 outcards matches 2 run scoreboard players add temp var 1 46 | execute if score card_cnt outcards matches 8 if score max_card outcards matches 1.. if score 3 outcards matches 2 run scoreboard players add temp var 1 47 | execute if score card_cnt outcards matches 8 if score max_card outcards matches 1.. if score 4 outcards matches 2 run scoreboard players add temp var 1 48 | execute if score card_cnt outcards matches 8 if score max_card outcards matches 1.. if score 5 outcards matches 2 run scoreboard players add temp var 1 49 | execute if score card_cnt outcards matches 8 if score max_card outcards matches 1.. if score 6 outcards matches 2 run scoreboard players add temp var 1 50 | execute if score card_cnt outcards matches 8 if score max_card outcards matches 1.. if score 7 outcards matches 2 run scoreboard players add temp var 1 51 | execute if score card_cnt outcards matches 8 if score max_card outcards matches 1.. if score 8 outcards matches 2 run scoreboard players add temp var 1 52 | execute if score card_cnt outcards matches 8 if score max_card outcards matches 1.. if score 9 outcards matches 2 run scoreboard players add temp var 1 53 | execute if score card_cnt outcards matches 8 if score max_card outcards matches 1.. if score 10 outcards matches 2 run scoreboard players add temp var 1 54 | execute if score card_cnt outcards matches 8 if score max_card outcards matches 1.. if score 11 outcards matches 2 run scoreboard players add temp var 1 55 | execute if score card_cnt outcards matches 8 if score max_card outcards matches 1.. if score 12 outcards matches 2 run scoreboard players add temp var 1 56 | execute if score card_cnt outcards matches 8 if score max_card outcards matches 1.. if score 13 outcards matches 2 run scoreboard players add temp var 1 57 | 58 | execute if score card_cnt outcards matches 8 if score max_card outcards matches 1.. unless score temp var matches 2 run scoreboard players set temp var 0 59 | 60 | execute if score max_card outcards matches 1.. if score temp var matches 1.. run scoreboard players set card_type outcards 6 61 | execute if score card_type outcards matches 0 run scoreboard players set max_card outcards 0 62 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/conver_selected.mcfunction: -------------------------------------------------------------------------------- 1 | #[CS] 将已经选中的牌转换成桶信息 2 | 3 | scoreboard players set sum outcards 0 4 | scoreboard players set 1 outcards 0 5 | scoreboard players set 2 outcards 0 6 | scoreboard players set 3 outcards 0 7 | scoreboard players set 4 outcards 0 8 | scoreboard players set 5 outcards 0 9 | scoreboard players set 6 outcards 0 10 | scoreboard players set 7 outcards 0 11 | scoreboard players set 8 outcards 0 12 | scoreboard players set 9 outcards 0 13 | scoreboard players set 10 outcards 0 14 | scoreboard players set 11 outcards 0 15 | scoreboard players set 12 outcards 0 16 | scoreboard players set 13 outcards 0 17 | scoreboard players set 14 outcards 0 18 | scoreboard players set 15 outcards 0 19 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected] run scoreboard players add sum outcards 1 20 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=1] run scoreboard players add 3 outcards 1 21 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=2] run scoreboard players add 3 outcards 1 22 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=3] run scoreboard players add 3 outcards 1 23 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=4] run scoreboard players add 3 outcards 1 24 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=5] run scoreboard players add 4 outcards 1 25 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=6] run scoreboard players add 4 outcards 1 26 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=7] run scoreboard players add 4 outcards 1 27 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=8] run scoreboard players add 4 outcards 1 28 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=9] run scoreboard players add 5 outcards 1 29 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=10] run scoreboard players add 5 outcards 1 30 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=11] run scoreboard players add 5 outcards 1 31 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=12] run scoreboard players add 5 outcards 1 32 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=13] run scoreboard players add 6 outcards 1 33 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=14] run scoreboard players add 6 outcards 1 34 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=15] run scoreboard players add 6 outcards 1 35 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=16] run scoreboard players add 6 outcards 1 36 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=17] run scoreboard players add 7 outcards 1 37 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=18] run scoreboard players add 7 outcards 1 38 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=19] run scoreboard players add 7 outcards 1 39 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=20] run scoreboard players add 7 outcards 1 40 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=21] run scoreboard players add 8 outcards 1 41 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=22] run scoreboard players add 8 outcards 1 42 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=23] run scoreboard players add 8 outcards 1 43 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=24] run scoreboard players add 8 outcards 1 44 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=25] run scoreboard players add 9 outcards 1 45 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=26] run scoreboard players add 9 outcards 1 46 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=27] run scoreboard players add 9 outcards 1 47 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=28] run scoreboard players add 9 outcards 1 48 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=29] run scoreboard players add 10 outcards 1 49 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=30] run scoreboard players add 10 outcards 1 50 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=31] run scoreboard players add 10 outcards 1 51 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=32] run scoreboard players add 10 outcards 1 52 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=33] run scoreboard players add 11 outcards 1 53 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=34] run scoreboard players add 11 outcards 1 54 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=35] run scoreboard players add 11 outcards 1 55 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=36] run scoreboard players add 11 outcards 1 56 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=37] run scoreboard players add 12 outcards 1 57 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=38] run scoreboard players add 12 outcards 1 58 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=39] run scoreboard players add 12 outcards 1 59 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=40] run scoreboard players add 12 outcards 1 60 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=41] run scoreboard players add 13 outcards 1 61 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=42] run scoreboard players add 13 outcards 1 62 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=43] run scoreboard players add 13 outcards 1 63 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=44] run scoreboard players add 13 outcards 1 64 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=45] run scoreboard players add 1 outcards 1 65 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=46] run scoreboard players add 1 outcards 1 66 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=47] run scoreboard players add 1 outcards 1 67 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=48] run scoreboard players add 1 outcards 1 68 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=49] run scoreboard players add 2 outcards 1 69 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=50] run scoreboard players add 2 outcards 1 70 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=51] run scoreboard players add 2 outcards 1 71 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=52] run scoreboard players add 2 outcards 1 72 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=53] run scoreboard players add 14 outcards 1 73 | execute as @e[type=armor_stand,tag=doudizhu,tag=Selected,tag=54] run scoreboard players add 15 outcards 1 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/get_card_type.mcfunction: -------------------------------------------------------------------------------- 1 | #[CT] 2 | #input: scb -> outcards (1,2,...,15,sum) 3 | #var:card_type max_card card_cnt 4 | #return: card_type max_card card_cnt 5 | 6 | scoreboard players set card_type outcards 0 7 | scoreboard players set max_card outcards 0 8 | scoreboard players operation card_cnt outcards = sum outcards 9 | 10 | #固定长度牌型 11 | execute if score card_type outcards matches 0 if score card_cnt outcards matches 1 run function doudizhu:get_card_type/is_1 12 | #tellraw @a [{"score": {"name": "card_type","objective": "outcards"}},{"score": {"name": "max_card","objective": "outcards"}},{"score": {"name": "card_cnt","objective": "outcards"}}] 13 | execute if score card_type outcards matches 0 if score card_cnt outcards matches 2 run function doudizhu:get_card_type/is_2 14 | #tellraw @a [{"score": {"name": "card_type","objective": "outcards"}},{"score": {"name": "max_card","objective": "outcards"}},{"score": {"name": "card_cnt","objective": "outcards"}}] 15 | execute if score card_type outcards matches 0 if score card_cnt outcards matches 3 run function doudizhu:get_card_type/is_3 16 | #tellraw @a [{"score": {"name": "card_type","objective": "outcards"}},{"score": {"name": "max_card","objective": "outcards"}},{"score": {"name": "card_cnt","objective": "outcards"}}] 17 | 18 | execute if score card_type outcards matches 0 if score card_cnt outcards matches 4 run function doudizhu:get_card_type/is_12 19 | #tellraw @a [{"score": {"name": "card_type","objective": "outcards"}},{"score": {"name": "max_card","objective": "outcards"}},{"score": {"name": "card_cnt","objective": "outcards"}}] 20 | 21 | execute if score card_type outcards matches 0 if score card_cnt outcards matches 2 run function doudizhu:get_card_type/is_13 22 | #tellraw @a [{"score": {"name": "card_type","objective": "outcards"}},{"score": {"name": "max_card","objective": "outcards"}},{"score": {"name": "card_cnt","objective": "outcards"}}] 23 | 24 | execute if score card_type outcards matches 0 if score card_cnt outcards matches 4 run function doudizhu:get_card_type/is_4 25 | #tellraw @a [{"score": {"name": "card_type","objective": "outcards"}},{"score": {"name": "max_card","objective": "outcards"}},{"score": {"name": "card_cnt","objective": "outcards"}}] 26 | 27 | execute if score card_type outcards matches 0 if score card_cnt outcards matches 5 run function doudizhu:get_card_type/is_5 28 | #tellraw @a [{"score": {"name": "card_type","objective": "outcards"}},{"score": {"name": "max_card","objective": "outcards"}},{"score": {"name": "card_cnt","objective": "outcards"}}] 29 | 30 | execute if score card_type outcards matches 0 if score card_cnt outcards matches 6 run function doudizhu:get_card_type/is_6 31 | #tellraw @a [{"score": {"name": "card_type","objective": "outcards"}},{"score": {"name": "max_card","objective": "outcards"}},{"score": {"name": "card_cnt","objective": "outcards"}}] 32 | #四带二的8张牌形式 33 | execute if score card_type outcards matches 0 if score card_cnt outcards matches 8 run function doudizhu:get_card_type/is_6 34 | 35 | #不定长牌型 36 | execute if score card_type outcards matches 0 if score card_cnt outcards matches 6.. run function doudizhu:get_card_type/is_7 37 | #tellraw @a [{"score": {"name": "card_type","objective": "outcards"}},{"score": {"name": "max_card","objective": "outcards"}},{"score": {"name": "card_cnt","objective": "outcards"}}] 38 | 39 | execute if score card_type outcards matches 0 if score card_cnt outcards matches 5.. run function doudizhu:get_card_type/is_8 40 | #tellraw @a [{"score": {"name": "card_type","objective": "outcards"}},{"score": {"name": "max_card","objective": "outcards"}},{"score": {"name": "card_cnt","objective": "outcards"}}] 41 | 42 | execute if score card_type outcards matches 0 if score card_cnt outcards matches 6.. run function doudizhu:get_card_type/is_9 43 | #tellraw @a [{"score": {"name": "card_type","objective": "outcards"}},{"score": {"name": "max_card","objective": "outcards"}},{"score": {"name": "card_cnt","objective": "outcards"}}] 44 | 45 | execute if score card_type outcards matches 0 if score card_cnt outcards matches 8.. run function doudizhu:get_card_type/is_10 46 | #tellraw @a [{"score": {"name": "card_type","objective": "outcards"}},{"score": {"name": "max_card","objective": "outcards"}},{"score": {"name": "card_cnt","objective": "outcards"}}] 47 | 48 | execute if score card_type outcards matches 0 if score card_cnt outcards matches 10.. run function doudizhu:get_card_type/is_11 49 | #tellraw @a [{"score": {"name": "card_type","objective": "outcards"}},{"score": {"name": "max_card","objective": "outcards"}},{"score": {"name": "card_cnt","objective": "outcards"}}] 50 | 51 | 52 | #DEBUG 53 | #execute if score card_type outcards matches 1 run say 单牌 54 | #execute if score card_type outcards matches 2 run say 一对 55 | #execute if score card_type outcards matches 3 run say 三条 56 | #execute if score card_type outcards matches 4 run say 三带一 57 | #execute if score card_type outcards matches 5 run say 三带二 58 | #execute if score card_type outcards matches 6 run say 四带二 59 | #execute if score card_type outcards matches 7 run say 连对 60 | #execute if score card_type outcards matches 8 run say 顺子 61 | #execute if score card_type outcards matches 9 run say 飞机不带翼 62 | #execute if score card_type outcards matches 10 run say 飞机带单翼 63 | #execute if score card_type outcards matches 11 run say 飞机带双翼 64 | #execute if score card_type outcards matches 12 run say 炸弹 65 | #execute if score card_type outcards matches 13 run say 王炸 66 | #execute if score card_type outcards matches 1 run tellraw @a ["",{"selector":"@s","bold":true},{"text":": 单牌"}] 67 | #execute if score card_type outcards matches 2 run tellraw @a ["",{"selector":"@s","bold":true},{"text":": 一对"}] 68 | #execute if score card_type outcards matches 3 run tellraw @a ["",{"selector":"@s","bold":true},{"text":": 三条"}] 69 | #execute if score card_type outcards matches 4 run tellraw @a ["",{"selector":"@s","bold":true},{"text":": 三带一"}] 70 | #execute if score card_type outcards matches 5 run tellraw @a ["",{"selector":"@s","bold":true},{"text":": 三带二"}] 71 | #execute if score card_type outcards matches 6 run tellraw @a ["",{"selector":"@s","bold":true},{"text":": 四带二"}] 72 | #execute if score card_type outcards matches 7 run tellraw @a ["",{"selector":"@s","bold":true},{"text":": 连对"}] 73 | #execute if score card_type outcards matches 8 run tellraw @a ["",{"selector":"@s","bold":true},{"text":": 顺子"}] 74 | #execute if score card_type outcards matches 9 run tellraw @a ["",{"selector":"@s","bold":true},{"text":": 飞机"}] 75 | #execute if score card_type outcards matches 10 run tellraw @a ["",{"selector":"@s","bold":true},{"text":": 飞机"}] 76 | #execute if score card_type outcards matches 11 run tellraw @a ["",{"selector":"@s","bold":true},{"text":": 飞机"}] 77 | #execute if score card_type outcards matches 12 run tellraw @a ["",{"selector":"@s","bold":true},{"text":": 炸弹"}] 78 | #execute if score card_type outcards matches 13 run tellraw @a ["",{"selector":"@s","bold":true},{"text":": 王炸"}] -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/show_voice_chat_info.mcfunction: -------------------------------------------------------------------------------- 1 | #[SVCI] 显示voice chat information 并播放声音 2 | 3 | execute if score voice_chat var matches 0 run scoreboard players set @s test_green_dye 0 4 | 5 | execute if score @s test_green_dye matches 1 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“得”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":{"text":"得✖17"}}}] 6 | execute if score @s test_green_dye matches 2 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“赌怪”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":{"text":"赌怪"}}}] 7 | execute if score @s test_green_dye matches 3 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“陈刀仔”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":["",{"text":"当年陈刀仔他能用20块赢到3700万"},{"text":"我卢本伟用20万赢到500万不是问题"}]}}] 8 | execute if score @s test_green_dye matches 4 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“很NB这个牌”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":{"text":"很NB这个牌"}}}] 9 | execute if score @s test_green_dye matches 5 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“阿姨你快点”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":{"text":"阿姨你快点别磨磨蹭蹭的"}}}] 10 | execute if score @s test_green_dye matches 6 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“卡布奇诺”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":["",{"text":"给阿姨倒杯茶好吧"},{"text":"给阿姨倒一杯卡布奇诺"}]}}] 11 | execute if score @s test_green_dye matches 7 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“漂亮”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":{"text":"漂亮"}}}] 12 | execute if score @s test_green_dye matches 8 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“17张牌你能秒我?”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":{"text":"17张牌,你能秒我?你能秒杀我?"}}}] 13 | execute if score @s test_green_dye matches 9 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“吃屏幕”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":["",{"text":"你今天能17张牌把卢本伟秒了"},{"text":"我当场就把这个电脑屏幕吃掉"}]}}] 14 | 15 | execute if score @s test_green_dye matches 10 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“炸弹秀”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"开始你的炸弹秀"}]}}] 16 | execute if score @s test_green_dye matches 11 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“闷声发大财”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"闷声发大财"}]}}] 17 | execute if score @s test_green_dye matches 12 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“赢不了我”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"TA的牌赢不了我"}]}}] 18 | execute if score @s test_green_dye matches 13 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“可是换不得”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"可是换不得"}]}}] 19 | execute if score @s test_green_dye matches 14 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“阿姨你K都不要吗”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"阿姨你K都不要吗"}]}}] 20 | execute if score @s test_green_dye matches 15 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“理性打牌”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"理性打牌"}]}}] 21 | execute if score @s test_green_dye matches 16 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“头有亿点痛”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"我现在头有亿点痛"}]}}] 22 | execute if score @s test_green_dye matches 17 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“最后的倔强”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"这400万是我最后的倔强"}]}}] 23 | execute if score @s test_green_dye matches 18 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“快点啊我等到花都谢了”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"快点啊我等到花都谢了"}]}}] 24 | execute if score @s test_green_dye matches 19 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“你的牌打的也忒好了”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"你的牌打的也忒好了"}]}}] 25 | 26 | execute if score @s test_green_dye matches 20 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“你是MM还是GG”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"你是MM还是GG"}]}}] 27 | execute if score @s test_green_dye matches 21 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“决战到天亮”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"不要走,决战到天亮"}]}}] 28 | execute if score @s test_green_dye matches 22 run tellraw @a ["",{"selector":"@s"},{"text":"播放了语音"},{"text":"“离开”","bold":true,"color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"各位,真不好意思,我得离开一会"}]}}] 29 | 30 | 31 | stopsound @a * minecraft:doudizhu.v1 32 | stopsound @a * minecraft:doudizhu.v2 33 | stopsound @a * minecraft:doudizhu.v3 34 | stopsound @a * minecraft:doudizhu.v4 35 | stopsound @a * minecraft:doudizhu.v5 36 | stopsound @a * minecraft:doudizhu.v6 37 | stopsound @a * minecraft:doudizhu.v7 38 | stopsound @a * minecraft:doudizhu.v8 39 | stopsound @a * minecraft:doudizhu.v9 40 | stopsound @a * minecraft:doudizhu.v10 41 | stopsound @a * minecraft:doudizhu.v11 42 | stopsound @a * minecraft:doudizhu.v12 43 | stopsound @a * minecraft:doudizhu.v13 44 | stopsound @a * minecraft:doudizhu.v14 45 | stopsound @a * minecraft:doudizhu.v15 46 | stopsound @a * minecraft:doudizhu.v16 47 | stopsound @a * minecraft:doudizhu.v17 48 | stopsound @a * minecraft:doudizhu.v18 49 | stopsound @a * minecraft:doudizhu.v19 50 | stopsound @a * minecraft:doudizhu.v20 51 | stopsound @a * minecraft:doudizhu.v21 52 | stopsound @a * minecraft:doudizhu.v22 53 | 54 | 55 | 56 | 57 | execute if score @s test_green_dye matches 1 as @a at @s run playsound minecraft:doudizhu.v1 player @s 58 | execute if score @s test_green_dye matches 2 as @a at @s run playsound minecraft:doudizhu.v2 player @s 59 | execute if score @s test_green_dye matches 3 as @a at @s run playsound minecraft:doudizhu.v3 player @s 60 | execute if score @s test_green_dye matches 4 as @a at @s run playsound minecraft:doudizhu.v4 player @s 61 | execute if score @s test_green_dye matches 5 as @a at @s run playsound minecraft:doudizhu.v5 player @s 62 | execute if score @s test_green_dye matches 6 as @a at @s run playsound minecraft:doudizhu.v6 player @s 63 | execute if score @s test_green_dye matches 7 as @a at @s run playsound minecraft:doudizhu.v7 player @s 64 | execute if score @s test_green_dye matches 8 as @a at @s run playsound minecraft:doudizhu.v8 player @s 65 | execute if score @s test_green_dye matches 9 as @a at @s run playsound minecraft:doudizhu.v9 player @s 66 | 67 | execute if score @s test_green_dye matches 10 as @a at @s run playsound minecraft:doudizhu.v10 player @s 68 | execute if score @s test_green_dye matches 11 as @a at @s run playsound minecraft:doudizhu.v11 player @s 69 | execute if score @s test_green_dye matches 12 as @a at @s run playsound minecraft:doudizhu.v12 player @s 70 | execute if score @s test_green_dye matches 13 as @a at @s run playsound minecraft:doudizhu.v13 player @s 71 | execute if score @s test_green_dye matches 14 as @a at @s run playsound minecraft:doudizhu.v14 player @s 72 | execute if score @s test_green_dye matches 15 as @a at @s run playsound minecraft:doudizhu.v15 player @s 73 | execute if score @s test_green_dye matches 16 as @a at @s run playsound minecraft:doudizhu.v16 player @s 74 | execute if score @s test_green_dye matches 17 as @a at @s run playsound minecraft:doudizhu.v17 player @s 75 | execute if score @s test_green_dye matches 18 as @a at @s run playsound minecraft:doudizhu.v18 player @s 76 | execute if score @s test_green_dye matches 19 as @a at @s run playsound minecraft:doudizhu.v19 player @s 77 | 78 | execute if score @s test_green_dye matches 20 as @a at @s run playsound minecraft:doudizhu.v20 player @s 79 | execute if score @s test_green_dye matches 21 as @a at @s run playsound minecraft:doudizhu.v21 player @s 80 | execute if score @s test_green_dye matches 22 as @a at @s run playsound minecraft:doudizhu.v22 player @s 81 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/start_game.mcfunction: -------------------------------------------------------------------------------- 1 | #[SG] 检查准备人数,然后开始游戏 2 | #调用:玩家 3 | #var:sg_temp 4 | #注:结束游戏的逻辑在use_other_see1里面 5 | 6 | 7 | scoreboard players set sg_temp var 0 8 | #execute as @a[tag=Prepared] run scoreboard players add sg_temp var 1 9 | #DEBUG 10 | execute as @e[tag=Prepared] run scoreboard players add sg_temp var 1 11 | #tellraw @a {"score":{"name":"sg_temp","objective":"var"}} 12 | 13 | #sg_temp==3 开始游戏 14 | #加标签 15 | execute if score sg_temp var matches 3 run tag @r[tag=Prepared,tag=!Player1,tag=!Player2,tag=!Player3] add Player1 16 | execute if score sg_temp var matches 3 run tag @r[tag=Prepared,tag=!Player1,tag=!Player2,tag=!Player3] add Player2 17 | execute if score sg_temp var matches 3 run tag @r[tag=Prepared,tag=!Player1,tag=!Player2,tag=!Player3] add Player3 18 | #传送玩家 19 | execute if score sg_temp var matches 3 run gamemode adventure @a[tag=Prepared] 20 | execute if score sg_temp var matches 3 run gamemode spectator @a[tag=!Prepared] 21 | execute if score sg_temp var matches 3 at @e[limit=1,tag=doudizhu,tag=Pos_Player1] run tp @a[tag=Player1] ~ ~2 ~ ~90 ~ 22 | execute if score sg_temp var matches 3 at @e[limit=1,tag=doudizhu,tag=Pos_Player2] run tp @a[tag=Player2] ~ ~2 ~ ~90 ~ 23 | execute if score sg_temp var matches 3 at @e[limit=1,tag=doudizhu,tag=Pos_Player3] run tp @a[tag=Player3] ~ ~2 ~ ~90 ~ 24 | execute if score sg_temp var matches 3 at @e[limit=1,tag=doudizhu,tag=Center] run tp @a[tag=!Prepared] ~ ~2 ~ 25 | #给东西 26 | execute if score sg_temp var matches 3 run clear @a minecraft:carrot_on_a_stick 27 | execute if score sg_temp var matches 3 if score qiang_mode var matches 0 as @a[tag=Prepared] run function doudizhu:replaceitem_jiao 28 | execute if score sg_temp var matches 3 if score qiang_mode var matches 1 as @a[tag=Prepared] run function doudizhu:replaceitem_qiang 29 | #execute if score sg_temp var matches 3 run replaceitem entity @a[tag=Prepared] hotbar.0 minecraft:carrot_on_a_stick{display:{Name:'{"text":"Pass"}'}} 30 | #execute if score sg_temp var matches 3 run replaceitem entity @a[tag=Prepared] hotbar.1 minecraft:carrot_on_a_stick{display:{Name:'{"text":"1分"}'}} 31 | #execute if score sg_temp var matches 3 run replaceitem entity @a[tag=Prepared] hotbar.2 minecraft:carrot_on_a_stick{display:{Name:'{"text":"2分"}'}} 32 | #execute if score sg_temp var matches 3 run replaceitem entity @a[tag=Prepared] hotbar.3 minecraft:carrot_on_a_stick{display:{Name:'{"text":"3分"}'}} 33 | #清空头盔 34 | execute if score sg_temp var matches 3 run clear @a leather_helmet 35 | 36 | #确定开始叫牌的人 37 | execute if score sg_temp var matches 3 run function doudizhu:get_random 38 | execute if score sg_temp var matches 3 run scoreboard players operation rd_x var %= 3 const 39 | execute if score sg_temp var matches 3 run scoreboard players operation round var = rd_x var 40 | execute if score sg_temp var matches 3 if score round var matches 0 run tellraw @a ["",{"selector":"@p[tag=Player1]","bold":true,"color":"gold"},{"text":"开始叫分","color":"gold"}] 41 | execute if score sg_temp var matches 3 if score round var matches 1 run tellraw @a ["",{"selector":"@p[tag=Player2]","bold":true,"color":"gold"},{"text":"开始叫分","color":"gold"}] 42 | execute if score sg_temp var matches 3 if score round var matches 2 run tellraw @a ["",{"selector":"@p[tag=Player3]","bold":true,"color":"gold"},{"text":"开始叫分","color":"gold"}] 43 | 44 | #发牌 45 | #先清空所有玩家的牌 46 | execute if score sg_temp var matches 3 run scoreboard players set @a remain_cards 0 47 | execute if score sg_temp var matches 3 run kill @e[tag=doudizhu,tag=Card] 48 | execute if score sg_temp var matches 3 run function doudizhu:shuffle 49 | execute if score sg_temp var matches 3 run function doudizhu:distribute_cards 50 | execute if score sg_temp var matches 3 run function doudizhu:distribute_cards2 51 | execute if score sg_temp var matches 3 if score skin_type skin matches 3 run function doudizhu:distribute_cards3 52 | #清空记分板 53 | execute if score sg_temp var matches 3 run scoreboard players set max_card last_outcards 0 54 | execute if score sg_temp var matches 3 run scoreboard players set card_type last_outcards 0 55 | execute if score sg_temp var matches 3 run scoreboard players set card_cnt last_outcards 0 56 | execute if score sg_temp var matches 3 run scoreboard players set sum last_outcards 0 57 | 58 | execute if score sg_temp var matches 3 run scoreboard players set max_card outcards 0 59 | execute if score sg_temp var matches 3 run scoreboard players set card_type outcards 0 60 | execute if score sg_temp var matches 3 run scoreboard players set card_cnt outcards 0 61 | execute if score sg_temp var matches 3 run scoreboard players set sum outcards 0 62 | 63 | execute if score sg_temp var matches 3 run scoreboard players set pass_cnt var 0 64 | execute if score sg_temp var matches 3 run scoreboard objectives setdisplay list remain_cards 65 | execute if score sg_temp var matches 3 run scoreboard objectives setdisplay sidebar score 66 | execute if score sg_temp var matches 3 run scoreboard players set bomb_cnt bomb 0 67 | #放大镜也重置了 68 | execute if score sg_temp var matches 3 run scoreboard players set @a amplifier 0 69 | 70 | 71 | #积分重置 72 | #execute if score sg_temp var matches 3 run scoreboard players set #base score 1000 73 | execute if score sg_temp var matches 3 run scoreboard players set #scale score 1 74 | execute if score sg_temp var matches 3 run function doudizhu:upd_score_bossbar 75 | execute if score sg_temp var matches 3 run scoreboard players set @e[tag=doudizhu,tag=Pos_Player] shed_time 0 76 | #弃牌堆重置 77 | execute if score sg_temp var matches 3 run scoreboard players set 1 abandoned_cards 0 78 | execute if score sg_temp var matches 3 run scoreboard players set 2 abandoned_cards 0 79 | execute if score sg_temp var matches 3 run scoreboard players set 3 abandoned_cards 0 80 | execute if score sg_temp var matches 3 run scoreboard players set 4 abandoned_cards 0 81 | execute if score sg_temp var matches 3 run scoreboard players set 5 abandoned_cards 0 82 | execute if score sg_temp var matches 3 run scoreboard players set 6 abandoned_cards 0 83 | execute if score sg_temp var matches 3 run scoreboard players set 7 abandoned_cards 0 84 | execute if score sg_temp var matches 3 run scoreboard players set 8 abandoned_cards 0 85 | execute if score sg_temp var matches 3 run scoreboard players set 9 abandoned_cards 0 86 | execute if score sg_temp var matches 3 run scoreboard players set 10 abandoned_cards 0 87 | execute if score sg_temp var matches 3 run scoreboard players set 11 abandoned_cards 0 88 | execute if score sg_temp var matches 3 run scoreboard players set 12 abandoned_cards 0 89 | execute if score sg_temp var matches 3 run scoreboard players set 13 abandoned_cards 0 90 | execute if score sg_temp var matches 3 run scoreboard players set 14 abandoned_cards 0 91 | execute if score sg_temp var matches 3 run scoreboard players set 15 abandoned_cards 0 92 | execute if score sg_temp var matches 3 run function doudizhu:upd_abandoned_cards_bossbar 93 | #Phase1 叫地主阶段 Phase2 出牌阶段 Phase3 抢地主阶段 94 | execute if score sg_temp var matches 3 run tag @e[tag=doudizhu,tag=Center] remove Phase1 95 | execute if score sg_temp var matches 3 run tag @e[tag=doudizhu,tag=Center] remove Phase2 96 | execute if score sg_temp var matches 3 run tag @e[tag=doudizhu,tag=Center] remove Phase3 97 | execute if score sg_temp var matches 3 if score qiang_mode var matches 0 run tag @e[tag=doudizhu,tag=Center] add Phase1 98 | execute if score sg_temp var matches 3 if score qiang_mode var matches 1 run tag @e[tag=doudizhu,tag=Center] add Phase3 99 | execute if score sg_temp var matches 3 run scoreboard players set @e[tag=doudizhu,tag=Pos_Player] jiaofen 0 100 | execute if score sg_temp var matches 3 run scoreboard players set maxscore jiaofen 0 101 | execute if score sg_temp var matches 3 run scoreboard players set jiaofen_times jiaofen 0 102 | execute if score sg_temp var matches 3 run tag @e[tag=doudizhu,tag=Pos_Player] remove dizhu 103 | execute if score sg_temp var matches 3 run tag @e[tag=doudizhu,tag=Pos_Player] remove Finished 104 | execute if score sg_temp var matches 3 run tag @a remove Prepared 105 | #Bossbar 106 | execute if score sg_temp var matches 3 run bossbar set show_score_and_scale visible true 107 | execute if score sg_temp var matches 3 run bossbar set show_abandoned_cards visible true 108 | #execute if score sg_temp var matches 3 run bossbar set show_abandoned_cards2 visible true 109 | 110 | 111 | #BGM 112 | execute if score sg_temp var matches 3 run stopsound @a 113 | execute if score sg_temp var matches 3 run scoreboard players operation time_index timer = now_time timer 114 | #重置场景 改为手动填充场景…… 115 | execute if score sg_temp var matches 3 as @e[tag=doudizhu,tag=Center,limit=1] at @s run function doudizhu:fill_barrier 116 | #execute if score sg_temp var matches 3 as @e[tag=Center,tag=doudizhu,limit=1] at @s run setblock ~-5 ~-6 ~-10 minecraft:structure_block{mode:"LOAD",name:"doudizhu:playing_room",posX:0,posY:1,posZ:0,sizeX:30,sizeY:10,sizeZ:20} destroy 117 | #execute if score sg_temp var matches 3 as @e[tag=Center,tag=doudizhu,limit=1] at @s run setblock ~-5 ~-5 ~-10 minecraft:redstone_block 118 | #execute if score sg_temp var matches 3 as @e[tag=Center,tag=doudizhu,limit=1] at @s run setblock ~-5 ~-6 ~-10 minecraft:air 119 | 120 | #sg_temp!=3 提示人数不足 121 | execute unless score sg_temp var matches 3 run tellraw @s ["",{"text":"在?没三个人怎么玩斗地主?","bold":true,"color":"red"},{"text":"(当前有","color":"red"},{"score":{"name":"sg_temp","objective":"var"},"color":"red"},{"text":"人准备)","color":"red"}] 122 | 123 | 124 | scoreboard players set @a rclick 0 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/get_card_type/is_9.mcfunction: -------------------------------------------------------------------------------- 1 | #[CT] 飞机不带翼 2 | #input: scb -> outcards (1,2,...,15,sum) card_cnt 3 | #var: temp 4 | #return: card_type max_card 5 | 6 | execute if score card_cnt outcards matches 6 if score 3 outcards matches 3 if score 4 outcards matches 3 run scoreboard players set max_card outcards 4 7 | execute if score card_cnt outcards matches 6 if score 4 outcards matches 3 if score 5 outcards matches 3 run scoreboard players set max_card outcards 5 8 | execute if score card_cnt outcards matches 6 if score 5 outcards matches 3 if score 6 outcards matches 3 run scoreboard players set max_card outcards 6 9 | execute if score card_cnt outcards matches 6 if score 6 outcards matches 3 if score 7 outcards matches 3 run scoreboard players set max_card outcards 7 10 | execute if score card_cnt outcards matches 6 if score 7 outcards matches 3 if score 8 outcards matches 3 run scoreboard players set max_card outcards 8 11 | execute if score card_cnt outcards matches 6 if score 8 outcards matches 3 if score 9 outcards matches 3 run scoreboard players set max_card outcards 9 12 | execute if score card_cnt outcards matches 6 if score 9 outcards matches 3 if score 10 outcards matches 3 run scoreboard players set max_card outcards 10 13 | execute if score card_cnt outcards matches 6 if score 10 outcards matches 3 if score 11 outcards matches 3 run scoreboard players set max_card outcards 11 14 | execute if score card_cnt outcards matches 6 if score 11 outcards matches 3 if score 12 outcards matches 3 run scoreboard players set max_card outcards 12 15 | execute if score card_cnt outcards matches 6 if score 12 outcards matches 3 if score 13 outcards matches 3 run scoreboard players set max_card outcards 13 16 | execute if score card_cnt outcards matches 6 if score 13 outcards matches 3 if score 1 outcards matches 3 run scoreboard players set max_card outcards 1 17 | execute if score card_cnt outcards matches 9 if score 3 outcards matches 3 if score 4 outcards matches 3 if score 5 outcards matches 3 run scoreboard players set max_card outcards 5 18 | execute if score card_cnt outcards matches 9 if score 4 outcards matches 3 if score 5 outcards matches 3 if score 6 outcards matches 3 run scoreboard players set max_card outcards 6 19 | execute if score card_cnt outcards matches 9 if score 5 outcards matches 3 if score 6 outcards matches 3 if score 7 outcards matches 3 run scoreboard players set max_card outcards 7 20 | execute if score card_cnt outcards matches 9 if score 6 outcards matches 3 if score 7 outcards matches 3 if score 8 outcards matches 3 run scoreboard players set max_card outcards 8 21 | execute if score card_cnt outcards matches 9 if score 7 outcards matches 3 if score 8 outcards matches 3 if score 9 outcards matches 3 run scoreboard players set max_card outcards 9 22 | execute if score card_cnt outcards matches 9 if score 8 outcards matches 3 if score 9 outcards matches 3 if score 10 outcards matches 3 run scoreboard players set max_card outcards 10 23 | execute if score card_cnt outcards matches 9 if score 9 outcards matches 3 if score 10 outcards matches 3 if score 11 outcards matches 3 run scoreboard players set max_card outcards 11 24 | execute if score card_cnt outcards matches 9 if score 10 outcards matches 3 if score 11 outcards matches 3 if score 12 outcards matches 3 run scoreboard players set max_card outcards 12 25 | execute if score card_cnt outcards matches 9 if score 11 outcards matches 3 if score 12 outcards matches 3 if score 13 outcards matches 3 run scoreboard players set max_card outcards 13 26 | execute if score card_cnt outcards matches 9 if score 12 outcards matches 3 if score 13 outcards matches 3 if score 1 outcards matches 3 run scoreboard players set max_card outcards 1 27 | execute if score card_cnt outcards matches 12 if score 3 outcards matches 3 if score 4 outcards matches 3 if score 5 outcards matches 3 if score 6 outcards matches 3 run scoreboard players set max_card outcards 6 28 | execute if score card_cnt outcards matches 12 if score 4 outcards matches 3 if score 5 outcards matches 3 if score 6 outcards matches 3 if score 7 outcards matches 3 run scoreboard players set max_card outcards 7 29 | execute if score card_cnt outcards matches 12 if score 5 outcards matches 3 if score 6 outcards matches 3 if score 7 outcards matches 3 if score 8 outcards matches 3 run scoreboard players set max_card outcards 8 30 | execute if score card_cnt outcards matches 12 if score 6 outcards matches 3 if score 7 outcards matches 3 if score 8 outcards matches 3 if score 9 outcards matches 3 run scoreboard players set max_card outcards 9 31 | execute if score card_cnt outcards matches 12 if score 7 outcards matches 3 if score 8 outcards matches 3 if score 9 outcards matches 3 if score 10 outcards matches 3 run scoreboard players set max_card outcards 10 32 | execute if score card_cnt outcards matches 12 if score 8 outcards matches 3 if score 9 outcards matches 3 if score 10 outcards matches 3 if score 11 outcards matches 3 run scoreboard players set max_card outcards 11 33 | execute if score card_cnt outcards matches 12 if score 9 outcards matches 3 if score 10 outcards matches 3 if score 11 outcards matches 3 if score 12 outcards matches 3 run scoreboard players set max_card outcards 12 34 | execute if score card_cnt outcards matches 12 if score 10 outcards matches 3 if score 11 outcards matches 3 if score 12 outcards matches 3 if score 13 outcards matches 3 run scoreboard players set max_card outcards 13 35 | execute if score card_cnt outcards matches 12 if score 11 outcards matches 3 if score 12 outcards matches 3 if score 13 outcards matches 3 if score 1 outcards matches 3 run scoreboard players set max_card outcards 1 36 | execute if score card_cnt outcards matches 15 if score 3 outcards matches 3 if score 4 outcards matches 3 if score 5 outcards matches 3 if score 6 outcards matches 3 if score 7 outcards matches 3 run scoreboard players set max_card outcards 7 37 | execute if score card_cnt outcards matches 15 if score 4 outcards matches 3 if score 5 outcards matches 3 if score 6 outcards matches 3 if score 7 outcards matches 3 if score 8 outcards matches 3 run scoreboard players set max_card outcards 8 38 | execute if score card_cnt outcards matches 15 if score 5 outcards matches 3 if score 6 outcards matches 3 if score 7 outcards matches 3 if score 8 outcards matches 3 if score 9 outcards matches 3 run scoreboard players set max_card outcards 9 39 | execute if score card_cnt outcards matches 15 if score 6 outcards matches 3 if score 7 outcards matches 3 if score 8 outcards matches 3 if score 9 outcards matches 3 if score 10 outcards matches 3 run scoreboard players set max_card outcards 10 40 | execute if score card_cnt outcards matches 15 if score 7 outcards matches 3 if score 8 outcards matches 3 if score 9 outcards matches 3 if score 10 outcards matches 3 if score 11 outcards matches 3 run scoreboard players set max_card outcards 11 41 | execute if score card_cnt outcards matches 15 if score 8 outcards matches 3 if score 9 outcards matches 3 if score 10 outcards matches 3 if score 11 outcards matches 3 if score 12 outcards matches 3 run scoreboard players set max_card outcards 12 42 | execute if score card_cnt outcards matches 15 if score 9 outcards matches 3 if score 10 outcards matches 3 if score 11 outcards matches 3 if score 12 outcards matches 3 if score 13 outcards matches 3 run scoreboard players set max_card outcards 13 43 | execute if score card_cnt outcards matches 15 if score 10 outcards matches 3 if score 11 outcards matches 3 if score 12 outcards matches 3 if score 13 outcards matches 3 if score 1 outcards matches 3 run scoreboard players set max_card outcards 1 44 | execute if score card_cnt outcards matches 18 if score 3 outcards matches 3 if score 4 outcards matches 3 if score 5 outcards matches 3 if score 6 outcards matches 3 if score 7 outcards matches 3 if score 8 outcards matches 3 run scoreboard players set max_card outcards 8 45 | execute if score card_cnt outcards matches 18 if score 4 outcards matches 3 if score 5 outcards matches 3 if score 6 outcards matches 3 if score 7 outcards matches 3 if score 8 outcards matches 3 if score 9 outcards matches 3 run scoreboard players set max_card outcards 9 46 | execute if score card_cnt outcards matches 18 if score 5 outcards matches 3 if score 6 outcards matches 3 if score 7 outcards matches 3 if score 8 outcards matches 3 if score 9 outcards matches 3 if score 10 outcards matches 3 run scoreboard players set max_card outcards 10 47 | execute if score card_cnt outcards matches 18 if score 6 outcards matches 3 if score 7 outcards matches 3 if score 8 outcards matches 3 if score 9 outcards matches 3 if score 10 outcards matches 3 if score 11 outcards matches 3 run scoreboard players set max_card outcards 11 48 | execute if score card_cnt outcards matches 18 if score 7 outcards matches 3 if score 8 outcards matches 3 if score 9 outcards matches 3 if score 10 outcards matches 3 if score 11 outcards matches 3 if score 12 outcards matches 3 run scoreboard players set max_card outcards 12 49 | execute if score card_cnt outcards matches 18 if score 8 outcards matches 3 if score 9 outcards matches 3 if score 10 outcards matches 3 if score 11 outcards matches 3 if score 12 outcards matches 3 if score 13 outcards matches 3 run scoreboard players set max_card outcards 13 50 | execute if score card_cnt outcards matches 18 if score 9 outcards matches 3 if score 10 outcards matches 3 if score 11 outcards matches 3 if score 12 outcards matches 3 if score 13 outcards matches 3 if score 1 outcards matches 3 run scoreboard players set max_card outcards 1 51 | 52 | 53 | execute if score max_card outcards matches 1.. run scoreboard players set card_type outcards 9 54 | execute if score card_type outcards matches 0 run scoreboard players set max_card outcards 0 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/get_card_type/is_8.mcfunction: -------------------------------------------------------------------------------- 1 | #[CT] 顺子 2 | #input: scb -> outcards (1,2,...,15,sum) card_cnt 3 | #var: temp 4 | #return: card_type max_card 5 | 6 | execute if score card_cnt outcards matches 5 if score 3 outcards matches 1 if score 4 outcards matches 1 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 run scoreboard players set max_card outcards 7 7 | execute if score card_cnt outcards matches 5 if score 4 outcards matches 1 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 run scoreboard players set max_card outcards 8 8 | execute if score card_cnt outcards matches 5 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 run scoreboard players set max_card outcards 9 9 | execute if score card_cnt outcards matches 5 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 run scoreboard players set max_card outcards 10 10 | execute if score card_cnt outcards matches 5 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 run scoreboard players set max_card outcards 11 11 | execute if score card_cnt outcards matches 5 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 run scoreboard players set max_card outcards 12 12 | execute if score card_cnt outcards matches 5 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 if score 13 outcards matches 1 run scoreboard players set max_card outcards 13 13 | execute if score card_cnt outcards matches 5 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 if score 13 outcards matches 1 if score 1 outcards matches 1 run scoreboard players set max_card outcards 1 14 | execute if score card_cnt outcards matches 6 if score 3 outcards matches 1 if score 4 outcards matches 1 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 run scoreboard players set max_card outcards 8 15 | execute if score card_cnt outcards matches 6 if score 4 outcards matches 1 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 run scoreboard players set max_card outcards 9 16 | execute if score card_cnt outcards matches 6 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 run scoreboard players set max_card outcards 10 17 | execute if score card_cnt outcards matches 6 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 run scoreboard players set max_card outcards 11 18 | execute if score card_cnt outcards matches 6 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 run scoreboard players set max_card outcards 12 19 | execute if score card_cnt outcards matches 6 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 if score 13 outcards matches 1 run scoreboard players set max_card outcards 13 20 | execute if score card_cnt outcards matches 6 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 if score 13 outcards matches 1 if score 1 outcards matches 1 run scoreboard players set max_card outcards 1 21 | execute if score card_cnt outcards matches 7 if score 3 outcards matches 1 if score 4 outcards matches 1 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 run scoreboard players set max_card outcards 9 22 | execute if score card_cnt outcards matches 7 if score 4 outcards matches 1 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 run scoreboard players set max_card outcards 10 23 | execute if score card_cnt outcards matches 7 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 run scoreboard players set max_card outcards 11 24 | execute if score card_cnt outcards matches 7 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 run scoreboard players set max_card outcards 12 25 | execute if score card_cnt outcards matches 7 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 if score 13 outcards matches 1 run scoreboard players set max_card outcards 13 26 | execute if score card_cnt outcards matches 7 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 if score 13 outcards matches 1 if score 1 outcards matches 1 run scoreboard players set max_card outcards 1 27 | execute if score card_cnt outcards matches 8 if score 3 outcards matches 1 if score 4 outcards matches 1 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 run scoreboard players set max_card outcards 10 28 | execute if score card_cnt outcards matches 8 if score 4 outcards matches 1 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 run scoreboard players set max_card outcards 11 29 | execute if score card_cnt outcards matches 8 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 run scoreboard players set max_card outcards 12 30 | execute if score card_cnt outcards matches 8 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 if score 13 outcards matches 1 run scoreboard players set max_card outcards 13 31 | execute if score card_cnt outcards matches 8 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 if score 13 outcards matches 1 if score 1 outcards matches 1 run scoreboard players set max_card outcards 1 32 | execute if score card_cnt outcards matches 9 if score 3 outcards matches 1 if score 4 outcards matches 1 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 run scoreboard players set max_card outcards 11 33 | execute if score card_cnt outcards matches 9 if score 4 outcards matches 1 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 run scoreboard players set max_card outcards 12 34 | execute if score card_cnt outcards matches 9 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 if score 13 outcards matches 1 run scoreboard players set max_card outcards 13 35 | execute if score card_cnt outcards matches 9 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 if score 13 outcards matches 1 if score 1 outcards matches 1 run scoreboard players set max_card outcards 1 36 | execute if score card_cnt outcards matches 10 if score 3 outcards matches 1 if score 4 outcards matches 1 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 run scoreboard players set max_card outcards 12 37 | execute if score card_cnt outcards matches 10 if score 4 outcards matches 1 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 if score 13 outcards matches 1 run scoreboard players set max_card outcards 13 38 | execute if score card_cnt outcards matches 10 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 if score 13 outcards matches 1 if score 1 outcards matches 1 run scoreboard players set max_card outcards 1 39 | execute if score card_cnt outcards matches 11 if score 3 outcards matches 1 if score 4 outcards matches 1 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 if score 13 outcards matches 1 run scoreboard players set max_card outcards 13 40 | execute if score card_cnt outcards matches 11 if score 4 outcards matches 1 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 if score 13 outcards matches 1 if score 1 outcards matches 1 run scoreboard players set max_card outcards 1 41 | execute if score card_cnt outcards matches 12 if score 3 outcards matches 1 if score 4 outcards matches 1 if score 5 outcards matches 1 if score 6 outcards matches 1 if score 7 outcards matches 1 if score 8 outcards matches 1 if score 9 outcards matches 1 if score 10 outcards matches 1 if score 11 outcards matches 1 if score 12 outcards matches 1 if score 13 outcards matches 1 if score 1 outcards matches 1 run scoreboard players set max_card outcards 1 42 | 43 | 44 | execute if score max_card outcards matches 1.. run scoreboard players set card_type outcards 8 45 | execute if score card_type outcards matches 0 run scoreboard players set max_card outcards 0 -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/jiao_end_judge.mcfunction: -------------------------------------------------------------------------------- 1 | #[JS] 叫地主的结束判定 2 | #调用对象:Pos_Player123 3 | #var:js_temp 4 | 5 | scoreboard players set js_temp var 0 6 | #声音 7 | execute if score google var matches 1 if score @s jiaofen matches -1 as @a at @s run playsound minecraft:doudizhu.pass_jiao voice @s 8 | execute if score google var matches 1 if score @s jiaofen matches 1 as @a at @s run playsound minecraft:doudizhu.1p voice @s 9 | execute if score google var matches 1 if score @s jiaofen matches 2 as @a at @s run playsound minecraft:doudizhu.2p voice @s 10 | execute if score google var matches 1 if score @s jiaofen matches 3 as @a at @s run playsound minecraft:doudizhu.3p voice @s 11 | 12 | 13 | #更新倍率记分板 14 | execute if score @s jiaofen matches 1.. run scoreboard players operation #scale score += @s jiaofen 15 | execute if score @s jiaofen matches 1.. run function doudizhu:upd_score_bossbar 16 | 17 | #三分直接结束 18 | execute if score @s jiaofen matches 3 run tag @s add dizhu 19 | 20 | #否则最后叫分最大者成为地主 21 | #更新叫分最大者 22 | execute if score @s jiaofen >= maxscore jiaofen run tag @e[tag=doudizhu,tag=Pos_Player] remove Maxscore 23 | execute if score @s jiaofen >= maxscore jiaofen run tag @s add Maxscore 24 | execute if score @s jiaofen >= maxscore jiaofen run scoreboard players operation maxscore jiaofen = @s jiaofen 25 | 26 | #当所有玩家分数都有,那么确定Maxscore标签者为地主 27 | execute unless score @e[tag=doudizhu,tag=Pos_Player1,limit=1] jiaofen matches 0 unless score @e[tag=doudizhu,tag=Pos_Player2,limit=1] jiaofen matches 0 unless score @e[tag=doudizhu,tag=Pos_Player3,limit=1] jiaofen matches 0 run tag @e[tag=Maxscore,limit=1] add dizhu 28 | 29 | #地主存在,结束叫分 30 | execute if entity @e[tag=dizhu] run tag @e[tag=doudizhu,tag=Pos_Player] remove Maxscore 31 | execute if entity @e[tag=dizhu] run tag @e[tag=doudizhu,tag=Center] remove Phase1 32 | execute if entity @e[tag=dizhu] run tag @e[tag=doudizhu,tag=Center] add Phase2 33 | execute if entity @e[tag=dizhu] run scoreboard players set js_temp var 1 34 | execute if score js_temp var matches 1 run clear @a minecraft:carrot_on_a_stick 35 | execute if score js_temp var matches 1 run scoreboard players set @a rclick 0 36 | 37 | #添加底牌 38 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run tellraw @a ["",{"selector":"@p[tag=Player1]","bold":true,"color":"gold"},{"text":"成为地主,由其开始出牌","color":"gold"}] 39 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run kill @e[tag=doudizhu,tag=Card,tag=Player1] 40 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run data modify storage doudizhu:cards player1_copy append from storage doudizhu:cards facedown_copy[0] 41 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run data modify storage doudizhu:cards player1_copy append from storage doudizhu:cards facedown_copy[1] 42 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run data modify storage doudizhu:cards player1_copy append from storage doudizhu:cards facedown_copy[2] 43 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run data modify storage doudizhu:cards rs set from storage doudizhu:cards player1_copy 44 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run function doudizhu:radix_sort 45 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run data modify storage doudizhu:cards player1 set from storage doudizhu:cards rs 46 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] at @e[type=area_effect_cloud,tag=doudizhu,tag=Pos_Player1,limit=1] positioned ^ ^ ^-3 run function doudizhu:recursive/distribute_summon_as1 47 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run scoreboard players add @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] remain_cards 3 48 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run scoreboard players set round var 0 49 | #execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run replaceitem entity @p[tag=Player1] armor.head minecraft:leather_helmet{display:{color:16701501}} 50 | #execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run replaceitem entity @p[tag=Player2] armor.head minecraft:leather_helmet{display:{color:16777215}} 51 | #execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run replaceitem entity @p[tag=Player3] armor.head minecraft:leather_helmet{display:{color:16777215}} 52 | 53 | 54 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run tellraw @a ["",{"selector":"@p[tag=Player2]","bold":true,"color":"gold"},{"text":"成为地主,由其开始出牌","color":"gold"}] 55 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run kill @e[tag=doudizhu,tag=Card,tag=Player2] 56 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run data modify storage doudizhu:cards player2_copy append from storage doudizhu:cards facedown_copy[0] 57 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run data modify storage doudizhu:cards player2_copy append from storage doudizhu:cards facedown_copy[1] 58 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run data modify storage doudizhu:cards player2_copy append from storage doudizhu:cards facedown_copy[2] 59 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run data modify storage doudizhu:cards rs set from storage doudizhu:cards player2_copy 60 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run function doudizhu:radix_sort 61 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run data modify storage doudizhu:cards player2 set from storage doudizhu:cards rs 62 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] at @e[type=area_effect_cloud,tag=doudizhu,tag=Pos_Player2,limit=1] positioned ^ ^ ^-3 run function doudizhu:recursive/distribute_summon_as2 63 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run scoreboard players add @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] remain_cards 3 64 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run scoreboard players set round var 1 65 | #execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run replaceitem entity @p[tag=Player1] armor.head minecraft:leather_helmet{display:{color:16777215}} 66 | #execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run replaceitem entity @p[tag=Player2] armor.head minecraft:leather_helmet{display:{color:16701501}} 67 | #execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run replaceitem entity @p[tag=Player3] armor.head minecraft:leather_helmet{display:{color:16777215}} 68 | 69 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run tellraw @a ["",{"selector":"@p[tag=Player3]","bold":true,"color":"gold"},{"text":"成为地主,由其开始出牌","color":"gold"}] 70 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run kill @e[tag=doudizhu,tag=Card,tag=Player3] 71 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run data modify storage doudizhu:cards player3_copy append from storage doudizhu:cards facedown_copy[0] 72 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run data modify storage doudizhu:cards player3_copy append from storage doudizhu:cards facedown_copy[1] 73 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run data modify storage doudizhu:cards player3_copy append from storage doudizhu:cards facedown_copy[2] 74 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run data modify storage doudizhu:cards rs set from storage doudizhu:cards player3_copy 75 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run function doudizhu:radix_sort 76 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run data modify storage doudizhu:cards player3 set from storage doudizhu:cards rs 77 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] at @e[type=area_effect_cloud,tag=doudizhu,tag=Pos_Player3,limit=1] positioned ^ ^ ^-3 run function doudizhu:recursive/distribute_summon_as3 78 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run scoreboard players add @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] remain_cards 3 79 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run scoreboard players set round var 2 80 | #execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run replaceitem entity @p[tag=Player1] armor.head minecraft:leather_helmet{display:{color:16777215}} 81 | #execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run replaceitem entity @p[tag=Player2] armor.head minecraft:leather_helmet{display:{color:16777215}} 82 | #execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run replaceitem entity @p[tag=Player3] armor.head minecraft:leather_helmet{display:{color:16701501}} 83 | #底牌翻过来,更新牌信息 84 | execute if score js_temp var matches 1 as @e[tag=doudizhu,tag=Facedown] run data merge entity @s {Rotation:[-90.0f,0.0f]} 85 | execute if score js_temp var matches 1 if score skin_type skin matches 3 run function doudizhu:distribute_cards3 86 | function doudizhu:upd_remain_cards 87 | 88 | #更新钓竿 89 | execute if score js_temp var matches 1 as @e[tag=Player1] run function doudizhu:replaceitem_chupai 90 | execute if score js_temp var matches 1 as @e[tag=Player2] run function doudizhu:replaceitem_chupai 91 | execute if score js_temp var matches 1 as @e[tag=Player3] run function doudizhu:replaceitem_chupai 92 | 93 | 94 | #全部Pass(-1),重新发牌并决定谁叫地主 95 | execute if score @e[tag=doudizhu,tag=Pos_Player1,limit=1] jiaofen matches -1 if score @e[tag=doudizhu,tag=Pos_Player2,limit=1] jiaofen matches -1 if score @e[tag=doudizhu,tag=Pos_Player3,limit=1] jiaofen matches -1 run scoreboard players set js_temp var -1 96 | execute if score js_temp var matches -1 run tellraw @a {"text":"无人叫地主,重新发牌……"} 97 | execute if score js_temp var matches -1 run kill @e[tag=doudizhu,tag=Card] 98 | execute if score js_temp var matches -1 run function doudizhu:shuffle 99 | execute if score js_temp var matches -1 run function doudizhu:distribute_cards 100 | execute if score js_temp var matches -1 run function doudizhu:distribute_cards2 101 | execute if score js_temp var matches -1 if score skin_type skin matches 3 run function doudizhu:distribute_cards3 102 | execute if score js_temp var matches -1 run function doudizhu:get_random 103 | execute if score js_temp var matches -1 run scoreboard players operation rd_x var %= 3 const 104 | execute if score js_temp var matches -1 run scoreboard players operation round var = rd_x var 105 | execute if score js_temp var matches -1 if score round var matches 0 run tellraw @a ["",{"selector":"@p[tag=Player1]","bold":true,"color":"gold"},{"text":"开始叫分","color":"gold"}] 106 | execute if score js_temp var matches -1 if score round var matches 1 run tellraw @a ["",{"selector":"@p[tag=Player2]","bold":true,"color":"gold"},{"text":"开始叫分","color":"gold"}] 107 | execute if score js_temp var matches -1 if score round var matches 2 run tellraw @a ["",{"selector":"@p[tag=Player3]","bold":true,"color":"gold"},{"text":"开始叫分","color":"gold"}] 108 | execute if score js_temp var matches -1 run tag @e[tag=doudizhu,tag=Center] remove Phase1 109 | execute if score js_temp var matches -1 run tag @e[tag=doudizhu,tag=Center] remove Phase2 110 | execute if score js_temp var matches -1 run tag @e[tag=doudizhu,tag=Center] add Phase1 111 | execute if score js_temp var matches -1 run scoreboard players set @e[tag=doudizhu,tag=Pos_Player1] jiaofen 0 112 | execute if score js_temp var matches -1 run scoreboard players set @e[tag=doudizhu,tag=Pos_Player2] jiaofen 0 113 | execute if score js_temp var matches -1 run scoreboard players set @e[tag=doudizhu,tag=Pos_Player3] jiaofen 0 114 | execute if score js_temp var matches -1 run scoreboard players set maxscore jiaofen 0 115 | 116 | #否则轮到下一个玩家打分 117 | execute if score js_temp var matches 0 run scoreboard players add round var 1 118 | execute if score js_temp var matches 0 run scoreboard players operation round var %= 3 const 119 | execute if score js_temp var matches 0 if score round var matches 0 run tellraw @a ["",{"text":"轮到","color":"gold"},{"selector":"@p[tag=Player1]","bold":true,"color":"gold"},{"text":"叫分","color":"gold"}] 120 | execute if score js_temp var matches 0 if score round var matches 1 run tellraw @a ["",{"text":"轮到","color":"gold"},{"selector":"@p[tag=Player2]","bold":true,"color":"gold"},{"text":"叫分","color":"gold"}] 121 | execute if score js_temp var matches 0 if score round var matches 2 run tellraw @a ["",{"text":"轮到","color":"gold"},{"selector":"@p[tag=Player3]","bold":true,"color":"gold"},{"text":"叫分","color":"gold"}] 122 | 123 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/loop/rt.mcfunction: -------------------------------------------------------------------------------- 1 | #[RT][loop] 对右键(Q、F)的各种探测操作 2 | #注:按键提示在high light函数里 3 | 4 | #重设盔甲架Glowing 5 | execute as @e[type=armor_stand,tag=doudizhu] run data merge entity @s {Glowing:0b} 6 | #execute as @e[type=armor_stand,tag=doudizhu,team=Selected] run data merge entity @s {Glowing:1b} 7 | #检测Q:test_q由游戏修改 8 | execute if score round var matches -1 as @a[scores={test_q=1..}] run function doudizhu:replaceitem_beforestart 9 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase1] as @a[scores={test_q=1..}] run function doudizhu:replaceitem_jiao 10 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase3] as @a[scores={test_q=1..}] run function doudizhu:replaceitem_qiang 11 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] as @a[scores={test_q=1..}] run function doudizhu:replaceitem_chupai 12 | #检测F:F需要手动判定 13 | execute as @a[nbt={Inventory:[{Slot:-106b,id:"minecraft:carrot_on_a_stick"}]}] run scoreboard players set @s test_f 1 14 | execute if score round var matches -1 as @a[nbt={Inventory:[{Slot:-106b,id:"minecraft:carrot_on_a_stick"}]}] run function doudizhu:replaceitem_beforestart 15 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase1] as @a[nbt={Inventory:[{Slot:-106b,id:"minecraft:carrot_on_a_stick"}]}] run function doudizhu:replaceitem_jiao 16 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase3] as @a[nbt={Inventory:[{Slot:-106b,id:"minecraft:carrot_on_a_stick"}]}] run function doudizhu:replaceitem_qiang 17 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] as @a[nbt={Inventory:[{Slot:-106b,id:"minecraft:carrot_on_a_stick"}]}] run function doudizhu:replaceitem_chupai 18 | #检测错位 19 | execute as @a run function doudizhu:loop/detect_empty1 20 | execute if score round var matches -1 as @a[scores={test_empty=1..}] run function doudizhu:replaceitem_beforestart 21 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase1] as @a[scores={test_empty=1..}] run function doudizhu:replaceitem_jiao 22 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase3] as @a[scores={test_empty=1..}] run function doudizhu:replaceitem_qiang 23 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] as @a[scores={test_empty=1..}] run function doudizhu:replaceitem_chupai 24 | #检测green_dye 25 | execute as @a run function doudizhu:loop/detect_green_dye 26 | execute as @a[scores={test_green_dye=1..}] at @s run function doudizhu:replaceitem_green_dye 27 | execute as @a[scores={test_green_dye=1..22}] run function doudizhu:show_voice_chat_info 28 | #帽子检测 29 | execute as @a run function doudizhu:loop/detect_empty2 30 | 31 | #execute as @a[scores={test_q=1..}] run say @s Q 32 | #execute as @a[scores={test_f=1..}] run say @s F 33 | #execute as @a[scores={test_empty=1..}] run say @s 错位 34 | #execute as @a[scores={test_q=1..,test_empty=1..}] run say @s Q错位 35 | 36 | #游戏未开始时的选项选择 以及 说明性文字 37 | execute if score round var matches -1 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"指针"}'}}}},tag=!Player1,tag=!Player2,tag=!Player3] at @s positioned ~ ~1.8 ~ run function doudizhu:loop/see 38 | execute if score round var matches -1 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"前往牌桌/返回大厅"}'}}}},tag=!Player1,tag=!Player2,tag=!Player3,scores={rclick=1..}] at @s run function doudizhu:tp_between 39 | execute if score round var matches -1 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"欢迎文字"}'}}}},tag=!Player1,tag=!Player2,tag=!Player3,scores={rclick=1..}] at @s run tellraw @s ["",{"text":"=====斗 地 主=====","bold":true,"color":"red"},{"text":"\n"},{"text":"v1.2 (2021.2.9)","italic":true,"color":"red"},{"text":"\n"},{"text":"游戏规则:","bold":true,"color":"gold"},{"text":"维基百科","underlined":true,"clickEvent":{"action":"open_url","value":"https://zh.wikipedia.org/wiki/%E9%AC%A5%E5%9C%B0%E4%B8%BB"}},{"text":"\n\n"},{"text":"制作人员名单(顺序不分先后):","bold":true,"color":"red"},{"text":"\n"},{"text":"命令:","bold":true,"color":"gold"},{"text":"TML_104","underlined":true,"clickEvent":{"action":"open_url","value":"https://space.bilibili.com/1862695"}},{"text":"\n"},{"text":"牌面:","bold":true,"color":"gold"},{"text":"xwjcool","underlined":true,"clickEvent":{"action":"open_url","value":"https://www.mcbbs.net/?259064"}},{"text":","},{"text":"mc_Kevin_Creeper","underlined":true,"clickEvent":{"action":"open_url","value":"https://space.bilibili.com/38899104"}},{"text":"\n"},{"text":"建筑:","bold":true,"color":"gold"},{"text":"落天望月","underlined":true,"clickEvent":{"action":"open_url","value":"https://space.bilibili.com/26260796"}},{"text":"\n"},{"text":"测试:","bold":true,"color":"gold"},{"text":"TML_104","underlined":true,"clickEvent":{"action":"open_url","value":"https://space.bilibili.com/1862695"}},{"text":","},{"text":"mc_Kevin_Creeper","underlined":true,"clickEvent":{"action":"open_url","value":"https://space.bilibili.com/38899104"}},{"text":","},{"text":"Sunny_loy_Kyle","underlined":true,"clickEvent":{"action":"open_url","value":"https://space.bilibili.com/33229178"}},{"text":"\n"}] 40 | execute if score round var matches -1 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"基本操作说明"}'}}}},tag=!Player1,tag=!Player2,tag=!Player3,scores={rclick=1..}] at @s run tellraw @s ["",{"text":"====基本操作====","bold":true,"color":"red"},{"text":"\n"},{"text":"> ","bold":true,"color":"gold"},{"text":"手持"},{"text":"“指针”","bold":true,"color":"aqua"},{"text":"对准大厅各个按钮并按下使用键即可交互"},{"text":"\n"},{"text":"> ","bold":true,"color":"gold"},{"text":"使用"},{"text":"“前往牌桌/返回大厅”","bold":true,"color":"aqua"},{"text":"以在牌桌和大厅之间传送"},{"text":"\n"},{"text":"> ","bold":true,"color":"gold"},{"text":"叫地主阶段,手持"},{"text":"1、2、3","bold":true,"color":"aqua"},{"text":"或"},{"text":"Pass","bold":true,"color":"aqua"},{"text":"并按下使用键即可叫分"},{"text":"\n"},{"text":"> ","bold":true,"color":"gold"},{"text":"使用"},{"text":"“放大镜”(4号位)","bold":true,"color":"aqua"},{"text":"可启用/取消放大效果"},{"text":"\n"},{"text":"> ","bold":true,"color":"gold"},{"text":"使用"},{"text":"“弃牌堆记牌器”(5号位)","bold":true,"color":"aqua"},{"text":"可在屏幕上方显示/隐藏各个已打出牌的数量"},{"text":"\n"},{"text":"> ","bold":true,"color":"gold"},{"text":"开启"},{"text":"“玩家列表”","bold":true,"color":"red"},{"text":"可查看玩家的剩余牌数"},{"text":"\n"}] 41 | execute if score round var matches -1 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"快速操作说明"}'}}}},tag=!Player1,tag=!Player2,tag=!Player3,scores={rclick=1..}] at @s run tellraw @s ["",{"text":"====快速操作====","bold":true,"color":"red"},{"text":"\n"},{"text":"(操作以默认按键为准)"},{"text":"\n"},{"text":"大厅:","bold":true,"color":"gold"},{"text":"[Q]:准备/取消准备 [F]:开始游戏"},{"text":"\n"},{"text":"游戏中","bold":true,"color":"gold"},{"text":"[Q]:Pass [F]:出牌"},{"text":"\n"}] 42 | execute if score round var matches -1 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"声音与快速聊天说明"}'}}}},tag=!Player1,tag=!Player2,tag=!Player3,scores={rclick=1..}] at @s run tellraw @s ["",{"text":"====声音与快速聊天====","bold":true,"color":"red"},{"text":"\n"},{"text":"> ","bold":true,"color":"gold"},{"text":"启用时,打开物品栏并点击对应图标以发送快速语音聊天"},{"text":"\n"},{"text":"“快速语音聊天”的音量:","bold":true,"color":"gold"},{"text":"“设置->音乐和声音->玩家”"},{"text":"\n"},{"text":"“背景音乐”的音量:","bold":true,"color":"gold"},{"text":"“设置->音乐和声音->唱片机/音符盒”"},{"text":"\n"},{"text":"“语音报牌”的音量:","bold":true,"color":"gold"},{"text":"“设置->音乐和声音->声音/语音”"},{"text":"\n"},{"text":"> ","bold":true,"color":"gold"},{"text":"推荐启用快速语音聊天时将对应音量调至50%以下"},{"text":"\n"}] 43 | execute if score round var matches -1 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"倍数与分数计算说明"}'}}}},tag=!Player1,tag=!Player2,tag=!Player3,scores={rclick=1..}] at @s run tellraw @s ["",{"text":"====倍数与分数计算====","bold":true,"color":"red"},{"text":"\n"},{"text":"> ","bold":true,"color":"gold"},{"text":"以所有玩家叫分总和为初始倍率"},{"text":"\n"},{"text":"> ","bold":true,"color":"gold"},{"text":"每回合结束,倍率+1"},{"text":"\n"},{"text":"> ","bold":true,"color":"gold"},{"text":"炸弹:倍率✖2; 王炸:倍率✖4"},{"text":"\n"},{"text":"> ","bold":true,"color":"gold"},{"text":"春天、反向春天:倍率✖4"},{"text":"\n"},{"text":"> ","bold":true,"color":"gold"},{"text":"最终地主分数为:底分✖倍数; 每个农民分数为:底分✖倍数✖1/2"},{"text":"\n"}] 44 | 45 | #Q准备/取消准备 46 | execute if score round var matches -1 as @a[scores={test_q=1..}] run function doudizhu:q_switch_prepared 47 | #F 尝试开始游戏 48 | execute if score round var matches -1 as @a[scores={test_f=1..}] run function doudizhu:start_game 49 | 50 | #游戏开始后 51 | #阶段1 叫地主 52 | #注意这里不能给玩家的@a选择器添加rclick限制,否则F和Q键会不可用 53 | #execute as @e[scores={test_q=1..,rclick=0,test_f=0,test_empty=0}] run say @s 54 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase1] if score round var matches 0 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick"}},tag=Player1] run function doudizhu:loop/jiao_see1 55 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase1] if score round var matches 1 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick"}},tag=Player2] run function doudizhu:loop/jiao_see2 56 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase1] if score round var matches 2 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick"}},tag=Player3] run function doudizhu:loop/jiao_see3 57 | 58 | 59 | #阶段3 抢地主 60 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase3] if score round var matches 0 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick"}},tag=Player1] run function doudizhu:loop/qiang_see1 61 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase3] if score round var matches 1 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick"}},tag=Player2] run function doudizhu:loop/qiang_see2 62 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase3] if score round var matches 2 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick"}},tag=Player3] run function doudizhu:loop/qiang_see3 63 | 64 | 65 | #阶段2 出牌 66 | #选牌 67 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if score round var matches 0 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"指针"}'}}}},tag=Player1] at @s positioned ~ ~1.8 ~ run function doudizhu:loop/see1 68 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if score round var matches 1 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"指针"}'}}}},tag=Player2] at @s positioned ~ ~1.8 ~ run function doudizhu:loop/see2 69 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if score round var matches 2 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"指针"}'}}}},tag=Player3] at @s positioned ~ ~1.8 ~ run function doudizhu:loop/see3 70 | #使用其他钓竿(这里“其他钓竿”特指“出牌”和“pass”这两个钓竿) 71 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if score round var matches 0 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick"}},nbt=!{SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"指针"}'}}}},scores={rclick=1..},tag=Player1] run function doudizhu:loop/use_other_see1 72 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if score round var matches 1 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick"}},nbt=!{SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"指针"}'}}}},scores={rclick=1..},tag=Player2] run function doudizhu:loop/use_other_see1 73 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if score round var matches 2 as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick"}},nbt=!{SelectedItem:{id:"minecraft:carrot_on_a_stick",tag:{display:{Name:'{"text":"指针"}'}}}},scores={rclick=1..},tag=Player3] run function doudizhu:loop/use_other_see1 74 | #F (和上一步类似) 75 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if score round var matches 0 as @a[tag=Player1,scores={test_empty=0,test_f=1..,test_q=0}] run function doudizhu:loop/use_other_see1 76 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if score round var matches 1 as @a[tag=Player2,scores={test_empty=0,test_f=1..,test_q=0}] run function doudizhu:loop/use_other_see1 77 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if score round var matches 2 as @a[tag=Player3,scores={test_empty=0,test_f=1..,test_q=0}] run function doudizhu:loop/use_other_see1 78 | #Q (和上一步类似) 79 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if score round var matches 0 as @a[tag=Player1,scores={test_empty=0,test_f=0,test_q=1..}] run function doudizhu:loop/use_other_see1 80 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if score round var matches 1 as @a[tag=Player2,scores={test_empty=0,test_f=0,test_q=1..}] run function doudizhu:loop/use_other_see1 81 | execute if entity @e[tag=doudizhu,tag=Center,tag=Phase2] if score round var matches 2 as @a[tag=Player3,scores={test_empty=0,test_f=0,test_q=1..}] run function doudizhu:loop/use_other_see1 82 | 83 | #Reset in other function 84 | #execute as @a[nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick"}},scores={rclick=1..}] run scoreboard players set @s rclick 0 85 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/qiang_end_judge.mcfunction: -------------------------------------------------------------------------------- 1 | #[QS] 抢地主的结束判定 2 | #调用对象:Pos_Player123 3 | #var:js_temp 4 | 5 | scoreboard players set js_temp var 0 6 | #声音 7 | execute if score google var matches 1 if score @s jiaofen matches -1 if score jiaofen_times jiaofen matches 0 as @a at @s run playsound minecraft:doudizhu.pass_jiao voice @s 8 | execute if score google var matches 1 if score @s jiaofen matches -1 if score jiaofen_times jiaofen matches 1.. as @a at @s run playsound minecraft:doudizhu.buqiang voice @s 9 | #抢地主、叫地主的声音 10 | execute if score google var matches 1 if score @s jiaofen matches 1.. if score jiaofen_times jiaofen matches 1 as @a at @s run playsound minecraft:doudizhu.jiaodizhu voice @s 11 | execute if score google var matches 1 if score @s jiaofen matches 1.. if score jiaofen_times jiaofen matches 2.. as @a at @s run playsound minecraft:doudizhu.qiangdizhu voice @s 12 | 13 | #更新倍率记分板 14 | execute if score @s jiaofen matches 1.. run scoreboard players operation #scale score *= 2 const 15 | execute if score @s jiaofen matches 1.. run function doudizhu:upd_score_bossbar 16 | 17 | #已经有2分那么直接结束 18 | execute if score @s jiaofen matches 2 run tag @s add dizhu 19 | 20 | #否则不是负分的人成为地主(此时叫分情况一定是形如1,-1,-1) 21 | execute if score @e[tag=doudizhu,tag=Pos_Player1,limit=1] jiaofen matches 1.. if score @e[tag=doudizhu,tag=Pos_Player2,limit=1] jiaofen matches -1 if score @e[tag=doudizhu,tag=Pos_Player3,limit=1] jiaofen matches -1 run tag @e[tag=doudizhu,tag=Pos_Player1,limit=1] add dizhu 22 | execute if score @e[tag=doudizhu,tag=Pos_Player1,limit=1] jiaofen matches -1 if score @e[tag=doudizhu,tag=Pos_Player2,limit=1] jiaofen matches 1.. if score @e[tag=doudizhu,tag=Pos_Player3,limit=1] jiaofen matches -1 run tag @e[tag=doudizhu,tag=Pos_Player2,limit=1] add dizhu 23 | execute if score @e[tag=doudizhu,tag=Pos_Player1,limit=1] jiaofen matches -1 if score @e[tag=doudizhu,tag=Pos_Player2,limit=1] jiaofen matches -1 if score @e[tag=doudizhu,tag=Pos_Player3,limit=1] jiaofen matches 1.. run tag @e[tag=doudizhu,tag=Pos_Player3,limit=1] add dizhu 24 | 25 | #地主存在,结束叫分 26 | execute if entity @e[tag=dizhu] run tag @e[tag=doudizhu,tag=Center] remove Phase3 27 | execute if entity @e[tag=dizhu] run tag @e[tag=doudizhu,tag=Center] add Phase2 28 | execute if entity @e[tag=dizhu] run scoreboard players set js_temp var 1 29 | execute if score js_temp var matches 1 run clear @a minecraft:carrot_on_a_stick 30 | execute if score js_temp var matches 1 run scoreboard players set @a rclick 0 31 | 32 | #添加底牌 33 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run tellraw @a ["",{"selector":"@p[tag=Player1]","bold":true,"color":"gold"},{"text":"成为地主,由其开始出牌","color":"gold"}] 34 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run kill @e[tag=doudizhu,tag=Card,tag=Player1] 35 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run data modify storage doudizhu:cards player1_copy append from storage doudizhu:cards facedown_copy[0] 36 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run data modify storage doudizhu:cards player1_copy append from storage doudizhu:cards facedown_copy[1] 37 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run data modify storage doudizhu:cards player1_copy append from storage doudizhu:cards facedown_copy[2] 38 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run data modify storage doudizhu:cards rs set from storage doudizhu:cards player1_copy 39 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run function doudizhu:radix_sort 40 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run data modify storage doudizhu:cards player1 set from storage doudizhu:cards rs 41 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] at @e[type=area_effect_cloud,tag=doudizhu,tag=Pos_Player1,limit=1] positioned ^ ^ ^-3 run function doudizhu:recursive/distribute_summon_as1 42 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run scoreboard players add @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] remain_cards 3 43 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run scoreboard players set round var 0 44 | #execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run replaceitem entity @p[tag=Player1] armor.head minecraft:leather_helmet{display:{color:16701501}} 45 | #execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run replaceitem entity @p[tag=Player2] armor.head minecraft:leather_helmet{display:{color:16777215}} 46 | #execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run replaceitem entity @p[tag=Player3] armor.head minecraft:leather_helmet{display:{color:16777215}} 47 | 48 | 49 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run tellraw @a ["",{"selector":"@p[tag=Player2]","bold":true,"color":"gold"},{"text":"成为地主,由其开始出牌","color":"gold"}] 50 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run kill @e[tag=doudizhu,tag=Card,tag=Player2] 51 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run data modify storage doudizhu:cards player2_copy append from storage doudizhu:cards facedown_copy[0] 52 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run data modify storage doudizhu:cards player2_copy append from storage doudizhu:cards facedown_copy[1] 53 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run data modify storage doudizhu:cards player2_copy append from storage doudizhu:cards facedown_copy[2] 54 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run data modify storage doudizhu:cards rs set from storage doudizhu:cards player2_copy 55 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run function doudizhu:radix_sort 56 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run data modify storage doudizhu:cards player2 set from storage doudizhu:cards rs 57 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] at @e[type=area_effect_cloud,tag=doudizhu,tag=Pos_Player2,limit=1] positioned ^ ^ ^-3 run function doudizhu:recursive/distribute_summon_as2 58 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run scoreboard players add @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] remain_cards 3 59 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player2] run scoreboard players set round var 1 60 | #execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run replaceitem entity @p[tag=Player1] armor.head minecraft:leather_helmet{display:{color:16777215}} 61 | #execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run replaceitem entity @p[tag=Player2] armor.head minecraft:leather_helmet{display:{color:16701501}} 62 | #execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run replaceitem entity @p[tag=Player3] armor.head minecraft:leather_helmet{display:{color:16777215}} 63 | 64 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run tellraw @a ["",{"selector":"@p[tag=Player3]","bold":true,"color":"gold"},{"text":"成为地主,由其开始出牌","color":"gold"}] 65 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run kill @e[tag=doudizhu,tag=Card,tag=Player3] 66 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run data modify storage doudizhu:cards player3_copy append from storage doudizhu:cards facedown_copy[0] 67 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run data modify storage doudizhu:cards player3_copy append from storage doudizhu:cards facedown_copy[1] 68 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run data modify storage doudizhu:cards player3_copy append from storage doudizhu:cards facedown_copy[2] 69 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run data modify storage doudizhu:cards rs set from storage doudizhu:cards player3_copy 70 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run function doudizhu:radix_sort 71 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run data modify storage doudizhu:cards player3 set from storage doudizhu:cards rs 72 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] at @e[type=area_effect_cloud,tag=doudizhu,tag=Pos_Player3,limit=1] positioned ^ ^ ^-3 run function doudizhu:recursive/distribute_summon_as3 73 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run scoreboard players add @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] remain_cards 3 74 | execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player3] run scoreboard players set round var 2 75 | #execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run replaceitem entity @p[tag=Player1] armor.head minecraft:leather_helmet{display:{color:16777215}} 76 | #execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run replaceitem entity @p[tag=Player2] armor.head minecraft:leather_helmet{display:{color:16777215}} 77 | #execute if entity @e[tag=dizhu,tag=doudizhu,tag=Pos_Player1] run replaceitem entity @p[tag=Player3] armor.head minecraft:leather_helmet{display:{color:16701501}} 78 | #底牌翻过来,更新牌信息 79 | execute if score js_temp var matches 1 as @e[tag=doudizhu,tag=Facedown] run data merge entity @s {Rotation:[-90.0f,0.0f]} 80 | execute if score js_temp var matches 1 if score skin_type skin matches 3 run function doudizhu:distribute_cards3 81 | function doudizhu:upd_remain_cards 82 | 83 | #更新钓竿 84 | execute if score js_temp var matches 1 as @e[tag=Player1] run function doudizhu:replaceitem_chupai 85 | execute if score js_temp var matches 1 as @e[tag=Player2] run function doudizhu:replaceitem_chupai 86 | execute if score js_temp var matches 1 as @e[tag=Player3] run function doudizhu:replaceitem_chupai 87 | 88 | 89 | #全部Pass(-1),重新发牌并决定谁叫地主 90 | execute if score @e[tag=doudizhu,tag=Pos_Player1,limit=1] jiaofen matches -1 if score @e[tag=doudizhu,tag=Pos_Player2,limit=1] jiaofen matches -1 if score @e[tag=doudizhu,tag=Pos_Player3,limit=1] jiaofen matches -1 run scoreboard players set js_temp var -1 91 | execute if score js_temp var matches -1 run tellraw @a {"text":"无人叫地主,重新发牌……"} 92 | execute if score js_temp var matches -1 run kill @e[tag=doudizhu,tag=Card] 93 | execute if score js_temp var matches -1 run function doudizhu:shuffle 94 | execute if score js_temp var matches -1 run function doudizhu:distribute_cards 95 | execute if score js_temp var matches -1 run function doudizhu:distribute_cards2 96 | execute if score js_temp var matches -1 if score skin_type skin matches 3 run function doudizhu:distribute_cards3 97 | execute if score js_temp var matches -1 run function doudizhu:get_random 98 | execute if score js_temp var matches -1 run scoreboard players operation rd_x var %= 3 const 99 | execute if score js_temp var matches -1 run scoreboard players operation round var = rd_x var 100 | execute if score js_temp var matches -1 if score round var matches 0 run tellraw @a ["",{"selector":"@p[tag=Player1]","bold":true,"color":"gold"},{"text":"开始叫分","color":"gold"}] 101 | execute if score js_temp var matches -1 if score round var matches 1 run tellraw @a ["",{"selector":"@p[tag=Player2]","bold":true,"color":"gold"},{"text":"开始叫分","color":"gold"}] 102 | execute if score js_temp var matches -1 if score round var matches 2 run tellraw @a ["",{"selector":"@p[tag=Player3]","bold":true,"color":"gold"},{"text":"开始叫分","color":"gold"}] 103 | execute if score js_temp var matches -1 run tag @e[tag=doudizhu,tag=Center] remove Phase3 104 | execute if score js_temp var matches -1 run tag @e[tag=doudizhu,tag=Center] remove Phase2 105 | execute if score js_temp var matches -1 run tag @e[tag=doudizhu,tag=Center] add Phase3 106 | execute if score js_temp var matches -1 run scoreboard players set @e[tag=doudizhu,tag=Pos_Player1] jiaofen 0 107 | execute if score js_temp var matches -1 run scoreboard players set @e[tag=doudizhu,tag=Pos_Player2] jiaofen 0 108 | execute if score js_temp var matches -1 run scoreboard players set @e[tag=doudizhu,tag=Pos_Player3] jiaofen 0 109 | execute if score js_temp var matches -1 run scoreboard players set jiaofen_times jiaofen 0 110 | 111 | 112 | #否则轮到下一个玩家打分 113 | execute if score js_temp var matches 0 run scoreboard players add round var 1 114 | #特判下一个玩家是不是本来就是-1,是的话就跳过他(最多跳过一次) 115 | execute if score js_temp var matches 0 if score round var matches 0 if score @e[tag=doudizhu,tag=Pos_Player1,limit=1] jiaofen matches -1 run scoreboard players add round var 1 116 | execute if score js_temp var matches 0 if score round var matches 1 if score @e[tag=doudizhu,tag=Pos_Player2,limit=1] jiaofen matches -1 run scoreboard players add round var 1 117 | execute if score js_temp var matches 0 if score round var matches 2 if score @e[tag=doudizhu,tag=Pos_Player3,limit=1] jiaofen matches -1 run scoreboard players add round var 1 118 | execute if score js_temp var matches 0 run scoreboard players operation round var %= 3 const 119 | execute if score js_temp var matches 0 if score round var matches 0 run tellraw @a ["",{"text":"轮到","color":"gold"},{"selector":"@p[tag=Player1]","bold":true,"color":"gold"},{"text":"叫分","color":"gold"}] 120 | execute if score js_temp var matches 0 if score round var matches 1 run tellraw @a ["",{"text":"轮到","color":"gold"},{"selector":"@p[tag=Player2]","bold":true,"color":"gold"},{"text":"叫分","color":"gold"}] 121 | execute if score js_temp var matches 0 if score round var matches 2 run tellraw @a ["",{"text":"轮到","color":"gold"},{"selector":"@p[tag=Player3]","bold":true,"color":"gold"},{"text":"叫分","color":"gold"}] 122 | -------------------------------------------------------------------------------- /doudizhu/data/doudizhu/functions/get_card_type/is_11.mcfunction: -------------------------------------------------------------------------------- 1 | #[CT] 飞机带双翼 2 | #input: scb -> outcards (1,2,...,15,sum) card_cnt 3 | #var: temp 4 | #return: card_type max_card 5 | 6 | scoreboard players set temp var 0 7 | 8 | #2 9 | execute if score card_cnt outcards matches 10 if score 3 outcards matches 3 if score 4 outcards matches 3 run scoreboard players set max_card outcards 4 10 | execute if score card_cnt outcards matches 10 if score 4 outcards matches 3 if score 5 outcards matches 3 run scoreboard players set max_card outcards 5 11 | execute if score card_cnt outcards matches 10 if score 5 outcards matches 3 if score 6 outcards matches 3 run scoreboard players set max_card outcards 6 12 | execute if score card_cnt outcards matches 10 if score 6 outcards matches 3 if score 7 outcards matches 3 run scoreboard players set max_card outcards 7 13 | execute if score card_cnt outcards matches 10 if score 7 outcards matches 3 if score 8 outcards matches 3 run scoreboard players set max_card outcards 8 14 | execute if score card_cnt outcards matches 10 if score 8 outcards matches 3 if score 9 outcards matches 3 run scoreboard players set max_card outcards 9 15 | execute if score card_cnt outcards matches 10 if score 9 outcards matches 3 if score 10 outcards matches 3 run scoreboard players set max_card outcards 10 16 | execute if score card_cnt outcards matches 10 if score 10 outcards matches 3 if score 11 outcards matches 3 run scoreboard players set max_card outcards 11 17 | execute if score card_cnt outcards matches 10 if score 11 outcards matches 3 if score 12 outcards matches 3 run scoreboard players set max_card outcards 12 18 | execute if score card_cnt outcards matches 10 if score 12 outcards matches 3 if score 13 outcards matches 3 run scoreboard players set max_card outcards 13 19 | execute if score card_cnt outcards matches 10 if score 13 outcards matches 3 if score 1 outcards matches 3 run scoreboard players set max_card outcards 1 20 | execute if score card_cnt outcards matches 10 if score max_card outcards matches 1.. if score 1 outcards matches 2 run scoreboard players add temp var 1 21 | execute if score card_cnt outcards matches 10 if score max_card outcards matches 1.. if score 2 outcards matches 2 run scoreboard players add temp var 1 22 | execute if score card_cnt outcards matches 10 if score max_card outcards matches 1.. if score 3 outcards matches 2 run scoreboard players add temp var 1 23 | execute if score card_cnt outcards matches 10 if score max_card outcards matches 1.. if score 4 outcards matches 2 run scoreboard players add temp var 1 24 | execute if score card_cnt outcards matches 10 if score max_card outcards matches 1.. if score 5 outcards matches 2 run scoreboard players add temp var 1 25 | execute if score card_cnt outcards matches 10 if score max_card outcards matches 1.. if score 6 outcards matches 2 run scoreboard players add temp var 1 26 | execute if score card_cnt outcards matches 10 if score max_card outcards matches 1.. if score 7 outcards matches 2 run scoreboard players add temp var 1 27 | execute if score card_cnt outcards matches 10 if score max_card outcards matches 1.. if score 8 outcards matches 2 run scoreboard players add temp var 1 28 | execute if score card_cnt outcards matches 10 if score max_card outcards matches 1.. if score 9 outcards matches 2 run scoreboard players add temp var 1 29 | execute if score card_cnt outcards matches 10 if score max_card outcards matches 1.. if score 10 outcards matches 2 run scoreboard players add temp var 1 30 | execute if score card_cnt outcards matches 10 if score max_card outcards matches 1.. if score 11 outcards matches 2 run scoreboard players add temp var 1 31 | execute if score card_cnt outcards matches 10 if score max_card outcards matches 1.. if score 12 outcards matches 2 run scoreboard players add temp var 1 32 | execute if score card_cnt outcards matches 10 if score max_card outcards matches 1.. if score 13 outcards matches 2 run scoreboard players add temp var 1 33 | execute if score card_cnt outcards matches 10 if score max_card outcards matches 1.. if score 14 outcards matches 2 run scoreboard players add temp var 1 34 | execute if score card_cnt outcards matches 10 if score max_card outcards matches 1.. if score 15 outcards matches 2 run scoreboard players add temp var 1 35 | execute if score card_cnt outcards matches 10 if score max_card outcards matches 1.. if score temp var matches 2 run scoreboard players set card_type outcards 11 36 | execute if score card_type outcards matches 0 run scoreboard players set max_card outcards 0 37 | 38 | 39 | #3 40 | execute if score card_cnt outcards matches 15 if score 3 outcards matches 3 if score 4 outcards matches 3 if score 5 outcards matches 3 run scoreboard players set max_card outcards 5 41 | execute if score card_cnt outcards matches 15 if score 4 outcards matches 3 if score 5 outcards matches 3 if score 6 outcards matches 3 run scoreboard players set max_card outcards 6 42 | execute if score card_cnt outcards matches 15 if score 5 outcards matches 3 if score 6 outcards matches 3 if score 7 outcards matches 3 run scoreboard players set max_card outcards 7 43 | execute if score card_cnt outcards matches 15 if score 6 outcards matches 3 if score 7 outcards matches 3 if score 8 outcards matches 3 run scoreboard players set max_card outcards 8 44 | execute if score card_cnt outcards matches 15 if score 7 outcards matches 3 if score 8 outcards matches 3 if score 9 outcards matches 3 run scoreboard players set max_card outcards 9 45 | execute if score card_cnt outcards matches 15 if score 8 outcards matches 3 if score 9 outcards matches 3 if score 10 outcards matches 3 run scoreboard players set max_card outcards 10 46 | execute if score card_cnt outcards matches 15 if score 9 outcards matches 3 if score 10 outcards matches 3 if score 11 outcards matches 3 run scoreboard players set max_card outcards 11 47 | execute if score card_cnt outcards matches 15 if score 10 outcards matches 3 if score 11 outcards matches 3 if score 12 outcards matches 3 run scoreboard players set max_card outcards 12 48 | execute if score card_cnt outcards matches 15 if score 11 outcards matches 3 if score 12 outcards matches 3 if score 13 outcards matches 3 run scoreboard players set max_card outcards 13 49 | execute if score card_cnt outcards matches 15 if score 12 outcards matches 3 if score 13 outcards matches 3 if score 1 outcards matches 3 run scoreboard players set max_card outcards 1 50 | execute if score card_cnt outcards matches 15 if score max_card outcards matches 1.. if score 1 outcards matches 2 run scoreboard players add temp var 1 51 | execute if score card_cnt outcards matches 15 if score max_card outcards matches 1.. if score 2 outcards matches 2 run scoreboard players add temp var 1 52 | execute if score card_cnt outcards matches 15 if score max_card outcards matches 1.. if score 3 outcards matches 2 run scoreboard players add temp var 1 53 | execute if score card_cnt outcards matches 15 if score max_card outcards matches 1.. if score 4 outcards matches 2 run scoreboard players add temp var 1 54 | execute if score card_cnt outcards matches 15 if score max_card outcards matches 1.. if score 5 outcards matches 2 run scoreboard players add temp var 1 55 | execute if score card_cnt outcards matches 15 if score max_card outcards matches 1.. if score 6 outcards matches 2 run scoreboard players add temp var 1 56 | execute if score card_cnt outcards matches 15 if score max_card outcards matches 1.. if score 7 outcards matches 2 run scoreboard players add temp var 1 57 | execute if score card_cnt outcards matches 15 if score max_card outcards matches 1.. if score 8 outcards matches 2 run scoreboard players add temp var 1 58 | execute if score card_cnt outcards matches 15 if score max_card outcards matches 1.. if score 9 outcards matches 2 run scoreboard players add temp var 1 59 | execute if score card_cnt outcards matches 15 if score max_card outcards matches 1.. if score 10 outcards matches 2 run scoreboard players add temp var 1 60 | execute if score card_cnt outcards matches 15 if score max_card outcards matches 1.. if score 11 outcards matches 2 run scoreboard players add temp var 1 61 | execute if score card_cnt outcards matches 15 if score max_card outcards matches 1.. if score 12 outcards matches 2 run scoreboard players add temp var 1 62 | execute if score card_cnt outcards matches 15 if score max_card outcards matches 1.. if score 13 outcards matches 2 run scoreboard players add temp var 1 63 | execute if score card_cnt outcards matches 15 if score max_card outcards matches 1.. if score 14 outcards matches 2 run scoreboard players add temp var 1 64 | execute if score card_cnt outcards matches 15 if score max_card outcards matches 1.. if score 15 outcards matches 2 run scoreboard players add temp var 1 65 | execute if score card_cnt outcards matches 15 if score max_card outcards matches 1.. if score temp var matches 3 run scoreboard players set card_type outcards 11 66 | execute if score card_type outcards matches 0 run scoreboard players set max_card outcards 0 67 | 68 | 69 | #4 70 | execute if score card_cnt outcards matches 20 if score 3 outcards matches 3 if score 4 outcards matches 3 if score 5 outcards matches 3 if score 6 outcards matches 3 run scoreboard players set max_card outcards 6 71 | execute if score card_cnt outcards matches 20 if score 4 outcards matches 3 if score 5 outcards matches 3 if score 6 outcards matches 3 if score 7 outcards matches 3 run scoreboard players set max_card outcards 7 72 | execute if score card_cnt outcards matches 20 if score 5 outcards matches 3 if score 6 outcards matches 3 if score 7 outcards matches 3 if score 8 outcards matches 3 run scoreboard players set max_card outcards 8 73 | execute if score card_cnt outcards matches 20 if score 6 outcards matches 3 if score 7 outcards matches 3 if score 8 outcards matches 3 if score 9 outcards matches 3 run scoreboard players set max_card outcards 9 74 | execute if score card_cnt outcards matches 20 if score 7 outcards matches 3 if score 8 outcards matches 3 if score 9 outcards matches 3 if score 10 outcards matches 3 run scoreboard players set max_card outcards 10 75 | execute if score card_cnt outcards matches 20 if score 8 outcards matches 3 if score 9 outcards matches 3 if score 10 outcards matches 3 if score 11 outcards matches 3 run scoreboard players set max_card outcards 11 76 | execute if score card_cnt outcards matches 20 if score 9 outcards matches 3 if score 10 outcards matches 3 if score 11 outcards matches 3 if score 12 outcards matches 3 run scoreboard players set max_card outcards 12 77 | execute if score card_cnt outcards matches 20 if score 10 outcards matches 3 if score 11 outcards matches 3 if score 12 outcards matches 3 if score 13 outcards matches 3 run scoreboard players set max_card outcards 13 78 | execute if score card_cnt outcards matches 20 if score 11 outcards matches 3 if score 12 outcards matches 3 if score 13 outcards matches 3 if score 1 outcards matches 3 run scoreboard players set max_card outcards 1 79 | execute if score card_cnt outcards matches 20 if score max_card outcards matches 1.. if score 1 outcards matches 2 run scoreboard players add temp var 1 80 | execute if score card_cnt outcards matches 20 if score max_card outcards matches 1.. if score 2 outcards matches 2 run scoreboard players add temp var 1 81 | execute if score card_cnt outcards matches 20 if score max_card outcards matches 1.. if score 3 outcards matches 2 run scoreboard players add temp var 1 82 | execute if score card_cnt outcards matches 20 if score max_card outcards matches 1.. if score 4 outcards matches 2 run scoreboard players add temp var 1 83 | execute if score card_cnt outcards matches 20 if score max_card outcards matches 1.. if score 5 outcards matches 2 run scoreboard players add temp var 1 84 | execute if score card_cnt outcards matches 20 if score max_card outcards matches 1.. if score 6 outcards matches 2 run scoreboard players add temp var 1 85 | execute if score card_cnt outcards matches 20 if score max_card outcards matches 1.. if score 7 outcards matches 2 run scoreboard players add temp var 1 86 | execute if score card_cnt outcards matches 20 if score max_card outcards matches 1.. if score 8 outcards matches 2 run scoreboard players add temp var 1 87 | execute if score card_cnt outcards matches 20 if score max_card outcards matches 1.. if score 9 outcards matches 2 run scoreboard players add temp var 1 88 | execute if score card_cnt outcards matches 20 if score max_card outcards matches 1.. if score 10 outcards matches 2 run scoreboard players add temp var 1 89 | execute if score card_cnt outcards matches 20 if score max_card outcards matches 1.. if score 11 outcards matches 2 run scoreboard players add temp var 1 90 | execute if score card_cnt outcards matches 20 if score max_card outcards matches 1.. if score 12 outcards matches 2 run scoreboard players add temp var 1 91 | execute if score card_cnt outcards matches 20 if score max_card outcards matches 1.. if score 13 outcards matches 2 run scoreboard players add temp var 1 92 | execute if score card_cnt outcards matches 20 if score max_card outcards matches 1.. if score 14 outcards matches 2 run scoreboard players add temp var 1 93 | execute if score card_cnt outcards matches 20 if score max_card outcards matches 1.. if score 15 outcards matches 2 run scoreboard players add temp var 1 94 | execute if score card_cnt outcards matches 20 if score max_card outcards matches 1.. if score temp var matches 4 run scoreboard players set card_type outcards 11 95 | execute if score card_type outcards matches 0 run scoreboard players set max_card outcards 0 96 | 97 | #execute if score max_card outcards matches 1.. run scoreboard players set card_type outcards 11 --------------------------------------------------------------------------------