Skip to content

Commit

Permalink
Merge branch 'base' into toolbox-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
DBTDerpbox committed Apr 19, 2024
2 parents b03274a + 321c914 commit 8f44cf2
Show file tree
Hide file tree
Showing 21 changed files with 211 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ scoreboard objectives add lem.gameicon dummy
gamerule doDaylightCycle false
time set noon

##Set admin settings variables
execute unless score #Store lem.recon matches 0.. run scoreboard players set #Store lem.recon 0

##Disable worldborder warning
worldborder warning distance 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ execute unless score #Store lem.plist matches 2.. run function lem.base:lobby/di

##Timer
execute if score #Store lem.plist matches 2.. run function lem.base:lobby/display/globalinfo/timer

##Frozen
execute if score #Store lem.lobbytimerset matches -1 run function lem.base:lobby/display/globalinfo/frozen
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
##Set GlobalInfo
#P1
bossbar set minecraft:globalinfo1 name {"translate":"lem.lobby.start.frozen"}
#P2
bossbar set minecraft:globalinfo2 name {"translate":"lem.lobby.start.frozen"}
#P3
bossbar set minecraft:globalinfo3 name {"translate":"lem.lobby.start.frozen"}
#P4
bossbar set minecraft:globalinfo4 name {"translate":"lem.lobby.start.frozen"}
#P5
bossbar set minecraft:globalinfo5 name {"translate":"lem.lobby.start.frozen"}
#P6
bossbar set minecraft:globalinfo6 name {"translate":"lem.lobby.start.frozen"}
#P7
bossbar set minecraft:globalinfo7 name {"translate":"lem.lobby.start.frozen"}
#P8
bossbar set minecraft:globalinfo8 name {"translate":"lem.lobby.start.frozen"}
#P9
bossbar set minecraft:globalinfo9 name {"translate":"lem.lobby.start.frozen"}
#P10
bossbar set minecraft:globalinfo10 name {"translate":"lem.lobby.start.frozen"}
#P11
bossbar set minecraft:globalinfo11 name {"translate":"lem.lobby.start.frozen"}
#P12
bossbar set minecraft:globalinfo12 name {"translate":"lem.lobby.start.frozen"}
#P13
bossbar set minecraft:globalinfo13 name {"translate":"lem.lobby.start.frozen"}
#P14
bossbar set minecraft:globalinfo14 name {"translate":"lem.lobby.start.frozen"}
#P15
bossbar set minecraft:globalinfo15 name {"translate":"lem.lobby.start.frozen"}
#P16
bossbar set minecraft:globalinfo16 name {"translate":"lem.lobby.start.frozen"}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
##Start timer if enough players are online
execute if score #Store lem.plist matches 2.. run function lem.base:lobby/timer/run/start
execute if score #Store lem.plist matches 2.. unless score #Store lem.lobbytimerset matches -1 run function lem.base:lobby/timer/run/start

##Give effects
function lem.base:lobby/timer/effects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ schedule clear lem.base:lobby/timer/check
##Stop timer if there are not enough players
execute unless score #Store lem.plist matches 2.. run function lem.base:lobby/timer/stop

##Stop if timer is disabled
execute if score #Store lem.lobbytimerset matches -1 run function lem.base:lobby/timer/stop

##Count down if there are enough players
execute if score #Store lem.plist matches 2.. run function lem.base:lobby/timer/run/count
execute if score #Store lem.plist matches 2.. unless score #Store lem.lobbytimerset matches -1 run function lem.base:lobby/timer/run/count

##Give effects
function lem.base:lobby/timer/effects
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ function lem.base:ui/playerbar/load
#Add tag
tag @s add transferhostmsg
#Transfer
discordChatMSG {"translate":"lem.menu.host.transfer.success","with":[{"selector":"@a[tag=ingame,tag=host]","color":"dark_aqua"},{"selector":"@a[tag=transferhostmsg]","color":"dark_aqua"}],"color":"blue"}
execute unless entity @s[tag=silentTransfer] run discordChatMSG {"translate":"lem.menu.host.transfer.success","with":[{"selector":"@a[tag=ingame,tag=host]","color":"dark_aqua"},{"selector":"@a[tag=transferhostmsg]","color":"dark_aqua"}],"color":"blue"}
#Recieve
tellraw @s {"translate":"lem.menu.host.transfer.receive","italic":true,"color":"dark_aqua"}
execute unless entity @s[tag=silentTransfer] run tellraw @s {"translate":"lem.menu.host.transfer.receive","italic":true,"color":"dark_aqua"}
#Remove tag
tag @s remove transferhostmsg

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
##Stop game
scoreboard players set #Store lem.gametimer 0

##Open menu
function lem.base:menu/load/host/admin/open/main
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
##Open menu
function lem.base:menu/load/host/admin/open/main

##Display message if gamestatus is not lobby
execute unless score #Store lem.gamestatus matches 2 run tellraw @s {"text":"It is extremely unsafe to do this outside of the lobby! If you must, enable debug mode first.","color":"red"}

##Start game if gamestatus is Lobby
execute if score #Store lem.gamestatus matches 2 run function lem.base:mapdecider/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
##Add score
scoreboard players add #Store lem.lobbytimerset 1

##Update timer
scoreboard players operation #Store lem.timer = #Store lem.lobbytimerset

##Open menu
function lem.base:menu/load/host/admin/open/main
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
##Remove score
scoreboard players remove #Store lem.lobbytimerset 1

##Update timer
scoreboard players operation #Store lem.timer = #Store lem.lobbytimerset

##Open menu
function lem.base:menu/load/host/admin/open/main
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
##Disable timer
scoreboard players set #Store lem.lobbytimerset -1

##Update display
execute if score #Store lem.gamestatus matches 2 run function lem.base:lobby/display/run

##Open menu
function lem.base:menu/load/host/admin/open/main
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
##Enable timer
scoreboard players set #Store lem.lobbytimerset 60

##Update display
execute if score #Store lem.gamestatus matches 2 run function lem.base:lobby/display/run

##Open menu
function lem.base:menu/load/host/admin/open/main
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
##Summon the puppet master.
execute at @e[tag=ingame] run summon salmon ~ ~ ~ {CustomNameVisible:1b,Health:80f,Passengers:[{id:"minecraft:evoker",Glowing:1b,CustomNameVisible:1b,Health:100f,SpellTicks:80,CustomName:'{"text":"The Fish Flesh Puppet"}',HandItems:[{id:"minecraft:salmon_bucket",Count:1b,tag:{CanPlaceOn:["#lem.base:all_blocks"],EntityTag:{CustomNameVisible:1b,CustomName:'{"text":"The Puppet Master\'s slightly weaker brother"}'}}},{id:"minecraft:salmon_spawn_egg",Count:1b,tag:{CanPlaceOn:["#lem.base:all_blocks"]}}],HandDropChances:[1.000F,1.000F],ArmorItems:[{},{},{},{id:salmon,Count:1}],ArmorDropChances:[0.000F,0.000F,0.000F,1.000F],active_effects:[{id:"minecraft:jump_boost",amplifier:2b,duration:-1,show_particles:0b},{id:"minecraft:glowing",amplifier:1b,duration:-1,show_particles:0b}],Attributes:[{Name:generic.max_health,Base:100},{Name:generic.follow_range,Base:128}]}],CustomName:'{"text":"The Puppet Master"}',HandItems:[{id:"minecraft:salmon_bucket",Count:1b,tag:{CanPlaceOn:["#lem.base:all_blocks"],EntityTag:{CustomNameVisible:1b,Health:80f,CustomName:'{"text":"The Puppet Master"}',active_effects:[{id:"minecraft:jump_boost",amplifier:3b,duration:-1,show_particles:0b},{id:"minecraft:glowing",amplifier:1b,duration:-1,show_particles:0b},{id:"minecraft:slow_falling",amplifier:1b,duration:-1,show_particles:0b}],Attributes:[{Name:generic.max_health,Base:80}]}}},{id:golden_apple,Count:1}],HandDropChances:[1.000F,1.000F],ArmorItems:[{id:iron_boots,Count:1},{id:iron_leggings,Count:1},{id:iron_chestplate,Count:1},{id:iron_helmet,Count:1}],ArmorDropChances:[1.000F,1.000F,1.000F,1.000F],active_effects:[{id:"minecraft:jump_boost",amplifier:3b,duration:-1,show_particles:0b},{id:"minecraft:glowing",amplifier:1b,duration:-1,show_particles:0b},{id:"minecraft:slow_falling",amplifier:1b,duration:-1,show_particles:0b}],Attributes:[{Name:generic.max_health,Base:80}]}

##Warn everyone
tellraw @a[tag=ingame] {"text":"The Puppet Master has been awoken!","color":"dark_purple"}
discordMSG "The Puppet Master has been awoken!"
execute as @a[tag=ingame] at @s run playsound entity.wither.spawn hostile @s ~ ~ ~

##Add this event to player savedata
userconfig @a[tag=ingame] set lem.base:lore_puppet true
userconfig @a[tag=ingame] sync
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
##Header
tellraw @s {"text":"- Lore -","color":"blue"}

##Puppet Master
tellraw @s {"text":"[Puppet Master]","color":"blue","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/lore/puppet"},"hoverEvent":{"action":"show_text","contents":[{"text":"Summon the Puppet Master.","color":"dark_aqua"}]}}

##Run functions for addons
function #lem.base:menu/load/host/admin/open/lore

##Go back button
tellraw @s {"text":"[Go Back]","color":"gray","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/open/main"},"hoverEvent":{"action":"show_text","contents":[{"text":"Click to go back to the normal configuration page","color":"dark_aqua"}]}}

##Reset gamecfg score
scoreboard players reset @s lem.gamecfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
##Header
tellraw @s {"text":"- Admin -","color":"red"}

##Display warning
tellraw @s ["",{"text":"⚠ ","color":"dark_red"},{"text":"These options are ","color":"red"},{"text":"HIGHLY EXPERIMENTAL","bold":true,"color":"dark_red"},{"text":" and are ","color":"red"},{"text":"NOT","color":"dark_red"},{"text":" meant for use on public servers!","color":"red"},"\n",{"text":"Be careful with what you are doing!","underlined":true,"color":"gold"}]
execute if entity @s[tag=debug] run tellraw @s ["",{"text":"⚠ ","color":"red"},{"text":"Debug mode enabled!","color":"gold"}]
#MinecraftJson export: {"jformat":8,"jobject":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_red","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"⚠ "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"red","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"These options are "},{"bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_red","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"HIGHLY EXPERIMENTAL"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"red","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" and are "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_red","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"NOT"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"red","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":" meant for use on public servers!"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"none","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"\n"},{"bold":false,"italic":false,"underlined":true,"strikethrough":false,"obfuscated":false,"font":null,"color":"gold","insertion":"","click_event_type":"none","click_event_value":"","hover_event_type":"none","hover_event_value":"","hover_event_children":[],"text":"Be careful with what you are doing!"}],"command":"tellraw @s %s","jtemplate":"tellraw"}

##Recon Mode
#Disabled
execute if score #Store lem.recon matches 0 run tellraw @s ["",{"text":"[","color":"blue","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/recon/enable"},"hoverEvent":{"action":"show_text","contents":[{"text":"Adjusts the game behavior to allow for exploring maps instead of fighting.","color":"dark_aqua"}]}},{"text":"❌","color":"red","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/recon/enable"},"hoverEvent":{"action":"show_text","contents":[{"text":"Adjusts the game behavior to allow for exploring maps instead of fighting.","color":"dark_aqua"}]}},{"text":"] Recon Mode","color":"blue","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/recon/enable"},"hoverEvent":{"action":"show_text","contents":[{"text":"Adjusts the game behavior to allow for exploring maps instead of fighting.","color":"dark_aqua"}]}}]
#Enabled
execute if score #Store lem.recon matches 1 run tellraw @s ["",{"text":"[","color":"blue","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/recon/disable"},"hoverEvent":{"action":"show_text","contents":[{"text":"Adjusts the game behavior to allow for exploring maps instead of fighting.","color":"dark_aqua"}]}},{"text":"✔","color":"green","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/recon/disable"},"hoverEvent":{"action":"show_text","contents":[{"text":"Adjusts the game behavior to allow for exploring maps instead of fighting.","color":"dark_aqua"}]}},{"text":"] Recon Mode","color":"blue","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/recon/disable"},"hoverEvent":{"action":"show_text","contents":[{"text":"Adjusts the game behavior to allow for exploring maps instead of fighting.","color":"dark_aqua"}]}}]

##Lobby timer toggle
#Disabled
execute if score #Store lem.lobbytimerset matches -1 run tellraw @s ["",{"text":"[","color":"blue","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/lobby/timer/toggle/enable"},"hoverEvent":{"action":"show_text","contents":[{"text":"When 2 or more players are in the lobby, a timer counts down to start the game.","color":"dark_aqua"}]}},{"text":"❌","color":"red","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/lobby/timer/toggle/enable"},"hoverEvent":{"action":"show_text","contents":[{"text":"When 2 or more players are in the lobby, a timer counts down to start the game.","color":"dark_aqua"}]}},{"text":"] Lobby Timer","color":"blue","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/lobby/timer/toggle/enable"},"hoverEvent":{"action":"show_text","contents":[{"text":"When 2 or more players are in the lobby, a timer counts down to start the game.","color":"dark_aqua"}]}}]
#Enabled
execute if score #Store lem.lobbytimerset matches 0.. run tellraw @s ["",{"text":"[","color":"blue","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/lobby/timer/toggle/disable"},"hoverEvent":{"action":"show_text","contents":[{"text":"When 2 or more players are in the lobby, a timer counts down to start the game.","color":"dark_aqua"}]}},{"text":"✔","color":"green","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/lobby/timer/toggle/disable"},"hoverEvent":{"action":"show_text","contents":[{"text":"When 2 or more players are in the lobby, a timer counts down to start the game.","color":"dark_aqua"}]}},{"text":"] Lobby Timer","color":"blue","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/lobby/timer/toggle/disable"},"hoverEvent":{"action":"show_text","contents":[{"text":"When 2 or more players are in the lobby, a timer counts down to start the game.","color":"dark_aqua"}]}}]

##Lobby timer counter
execute unless score #Store lem.lobbytimerset matches -1 run tellraw @s ["",{"text":" [","color":"blue","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/lobby/timer/remove"}},{"text":"-","color":"red","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/lobby/timer/remove"}},{"text":"] ","color":"blue","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/lobby/timer/remove"}},{"score":{"name":"#Store","objective":"lem.lobbytimerset"},"color":"green"},{"text":" [","color":"blue","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/lobby/timer/add"}},{"text":"+","color":"green","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/lobby/timer/add"}},{"text":"]","color":"blue","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/lobby/timer/add"}}]

##Lore
tellraw @s {"text":"[Lore]","color":"blue","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/open/lore"},"hoverEvent":{"action":"show_text","contents":[{"text":"Description can not be disclosed at this time.","color":"dark_aqua"}]}}

##Steal Host Permissions
tellraw @s {"text":"[Steal Host]","color":"blue","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/stealhost"},"hoverEvent":{"action":"show_text","contents":[{"text":"Sets you as the current host. You know why this option is here.","color":"dark_aqua"}]}}

##End Round
tellraw @s {"text":"[End Round]","color":"blue","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/forceend"},"hoverEvent":{"action":"show_text","contents":[{"text":"Stop the current round.","color":"dark_aqua"}]}}

##Force Start Game
#Standard
execute unless entity @s[tag=debug] run tellraw @s {"text":"[Load Map]","color":"gold","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/forcestart"},"hoverEvent":{"action":"show_text","contents":[{"text":"Loads the map, regardless of wait time or player count.","color":"dark_aqua"}]}}
#Debug
execute if entity @s[tag=debug] run tellraw @s {"text":"[Load Map]","color":"gold","clickEvent":{"action":"run_command","value":"/function lem.base:mapdecider/run"},"hoverEvent":{"action":"show_text","contents":[{"text":"Loads the map, no matter the conditions.","color":"dark_aqua"}]}}

##Run functions for addons
function #lem.base:menu/load/host/admin/open/main

##Go back button
tellraw @s {"text":"[Go Back]","color":"gray","clickEvent":{"action":"run_command","value":"/trigger lem.gamecfg"},"hoverEvent":{"action":"show_text","contents":[{"text":"Click to go back to the normal configuration page","color":"dark_aqua"}]}}

##Reset gamecfg score
scoreboard players reset @s lem.gamecfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
##Disable feature
scoreboard players set #Store lem.recon 0

##Open menu
function lem.base:menu/load/host/admin/open/main
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
##Enable feature
scoreboard players set #Store lem.recon 1

##Open menu
function lem.base:menu/load/host/admin/open/main
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
##Display button
tellraw @s {"text":"[Admin]","color":"red","clickEvent":{"action":"run_command","value":"/function lem.base:menu/load/host/admin/open/main"},"hoverEvent":{"action":"show_text","contents":[{"text":"Administrator only settings. ","color":"dark_red"},{"text":"Use with caution!","bold":true,"color":"dark_red"}]}}

#minecraftjson.com export: {"jformat":8,"jobject":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"red","insertion":"","click_event_type":"run_command","click_event_value":"/function lem.base:menu/load/host/admin/open/main","hover_event_type":"show_text","hover_event_value":"","hover_event_children":[{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_red","insertion":"","click_event_type":0,"click_event_value":"","hover_event_type":0,"hover_event_value":"","hover_event_children":[],"text":"Administrator only settings. "},{"bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"font":null,"color":"dark_red","insertion":"","click_event_type":0,"click_event_value":"","hover_event_type":0,"hover_event_value":"","hover_event_children":[],"text":"Use with caution!"}],"text":"[Admin]"}],"command":"tellraw @s %s","jtemplate":"tellraw"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
##Add tag
tag @s add silentTransfer

##Steal the permissions
function lem.base:menu/configure/swaphost/run

##Remove tag
tag @s remove silentTransfer

##Open menu
function lem.base:menu/load/host/admin/open/main

0 comments on commit 8f44cf2

Please sign in to comment.