first commit
This commit is contained in:
1
data/noemie_mc_gm/function/give_sign.mcfunction
Normal file
1
data/noemie_mc_gm/function/give_sign.mcfunction
Normal file
@@ -0,0 +1 @@
|
||||
give @s minecraft:oak_sign[minecraft:block_entity_data={id:"sign",front_text:{messages:[{"text":"[NoemieMC]","color":"dark_blue","click_event":{"action":"run_command","command":"function noemie_mc_gm:switch_gm"}},"Changer mode","survie <-> créa",{"text":"(clic droit)","color":"dark_gray"}]},is_waxed:1b}] 1
|
||||
1
data/noemie_mc_gm/function/init.mcfunction
Normal file
1
data/noemie_mc_gm/function/init.mcfunction
Normal file
@@ -0,0 +1 @@
|
||||
scoreboard objectives add noemie_mc_gm dummy
|
||||
10
data/noemie_mc_gm/function/switch_gm.mcfunction
Normal file
10
data/noemie_mc_gm/function/switch_gm.mcfunction
Normal file
@@ -0,0 +1,10 @@
|
||||
execute unless entity @s[type=minecraft:player] run return 0
|
||||
|
||||
scoreboard players set #gm noemie_mc_gm 0
|
||||
execute if entity @s[gamemode=survival] run scoreboard players set #gm noemie_mc_gm 1
|
||||
execute if entity @s[gamemode=creative] run scoreboard players set #gm noemie_mc_gm 2
|
||||
|
||||
execute if score #gm noemie_mc_gm matches 1 run function noemie_mc_gm:switch_gm/creative
|
||||
execute if score #gm noemie_mc_gm matches 2 run function noemie_mc_gm:switch_gm/survival
|
||||
|
||||
scoreboard players reset #gm noemie_mc_gm
|
||||
2
data/noemie_mc_gm/function/switch_gm/creative.mcfunction
Normal file
2
data/noemie_mc_gm/function/switch_gm/creative.mcfunction
Normal file
@@ -0,0 +1,2 @@
|
||||
gamemode creative @s
|
||||
title @s actionbar {"translate":"gameMode.changed",with:[{translate:"gameMode.creative"}]}
|
||||
2
data/noemie_mc_gm/function/switch_gm/survival.mcfunction
Normal file
2
data/noemie_mc_gm/function/switch_gm/survival.mcfunction
Normal file
@@ -0,0 +1,2 @@
|
||||
gamemode survival @s
|
||||
title @s actionbar {"translate":"gameMode.changed",with:[{translate:"gameMode.survival"}]}
|
||||
Reference in New Issue
Block a user