Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions data/lavarising/functions/main.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ execute if score period internal matches 2 as @e[tag=riser,limit=1] at @s run fu
# time loop
function lavarising:time

# count players
execute if score period internal matches 2 if score eliminate_on_disconnect global matches 1.. run function lavarising:system/main/count

# death checks
## solos
execute if score period internal matches 2 unless score teams global matches 1.. as @a at @s if score @s player.death matches 1.. run function lavarising:system/death/solos/go
Expand All @@ -58,8 +61,7 @@ execute if score period internal matches 2 if score teams global matches 1.. if
execute if score period internal matches 2 if score teams global matches 1.. if score teams_count global matches 3.. run function lavarising:system/win/teams-3/check

# disconnect checks
## disabled for now
execute if score eliminate_on_disconnect global matches 1.. run tellraw @a ["",{"text":"[","color":"dark_gray"},{"text":"X","color":"red","bold":true},{"text":"] ","color":"dark_gray"},{"text":"This feature is disabled for now and not available.","color":"red"}]
execute if score eliminate_on_disconnect global matches 1.. run scoreboard players set eliminate_on_disconnect global 0
## refer to 'eliminate_on_disconnect' in defaults
execute if score period internal matches 2 if score eliminate_on_disconnect global matches 1.. if entity @a[scores={player.leave=1..}] run function lavarising:system/death/disconnect
execute if score period internal matches 2 if score eliminate_on_disconnect global matches 1.. as @a if score @s player.leave matches 1.. run function lavarising:system/death/disconnect
## reset (for people currently on the server)
scoreboard players reset @a player.leave
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
scoreboard players set eliminate_on_disconnect global 0
function lavarising:setup/sfx/off
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
scoreboard players set eliminate_on_disconnect global 1
function lavarising:setup/sfx/on
6 changes: 6 additions & 0 deletions data/lavarising/functions/setup/go.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ execute if score teams global matches 1.. run tellraw @s ["",{"text":"Teams \u00
## disabled
execute unless score teams global matches 1.. run tellraw @s ["",{"text":"Teams \u0020 \u0020","hoverEvent":{"action":"show_text","contents":[{"text":"Fight to the death together! Requires adding players to red/blue (or green if 3 teams)."}]}},{"text":" ","color":"dark_gray"},{"text":"✔","color":"green","bold":true,"clickEvent":{"action":"run_command","value":"/function lavarising:setup/teams/on"}},{"text":" ","color":"dark_gray"},{"text":" [","color":"white"},{"text":"X","color":"red","bold":true},{"text":"]","color":"white"}]

# eliminate on disconnect
## enabled
execute if score eliminate_on_disconnect global matches 1.. run tellraw @s ["",{"text":"Eliminate on disconnect \u0020 \u0020","hoverEvent":{"action":"show_text","contents":[{"text":"If a player leaves the server, upon rejoin they will be eliminated."}]}},{"text":"[","color":"white"},{"text":"✔","color":"green","bold":true},{"text":"]","color":"white"},{"text":" ","color":"dark_gray"},{"text":"X","color":"red","bold":true,"clickEvent":{"action":"run_command","value":"/function lavarising:setup/eliminate_on_disconnect/off"}},{"text":" ","color":"dark_gray"}]
## disabled
execute unless score eliminate_on_disconnect global matches 1.. run tellraw @s ["",{"text":"Eliminate on disconnect \u0020 \u0020","hoverEvent":{"action":"show_text","contents":[{"text":"If a player leaves the server, upon rejoin they will be eliminated."}]}},{"text":" ","color":"dark_gray"},{"text":"✔","color":"green","bold":true,"clickEvent":{"action":"run_command","value":"/function lavarising:setup/eliminate_on_disconnect/on"}},{"text":" ","color":"dark_gray"},{"text":" [","color":"white"},{"text":"X","color":"red","bold":true},{"text":"]","color":"white"}]

# rise height limit
tellraw @s ["",{"text":"Rise height limit \u0020 \u0020","hoverEvent":{"action":"show_text","contents":[{"text":"The maximum height limit the lava can reach."}]}},{"text":" ","color":"white"},{"text":"-","color":"red","bold":true,"clickEvent":{"action":"run_command","value":"/function lavarising:setup/rise_height_limit/down"}},{"text":" ","color":"white"},{"score":{"name":"rise_height_limit","objective":"global"}},{"text":" ","color":"dark_gray"},{"text":"+","color":"green","bold":true,"clickEvent":{"action":"run_command","value":"/function lavarising:setup/rise_height_limit/up"}},{"text":" ","color":"dark_gray"}]

Expand Down
3 changes: 1 addition & 2 deletions data/lavarising/functions/system/death/disconnect.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

# swap gamemode
gamemode spectator @s
scoreboard players remove alive internal 1

# announce
tellraw @a ["",{"text":"[","color":"dark_gray"},{"text":"☠","color":"red"},{"text":"] ","color":"dark_gray"},{"selector":"@s","color":"red","bold":true},{"text":" has been eliminated!","color":"dark_red"}]
tellraw @a ["",{"text":"[","color":"dark_gray"},{"text":"☠","color":"red"},{"text":"] ","color":"dark_gray"},{"selector":"@s","color":"red","bold":true},{"text":" has been eliminated! (left during game)","color":"dark_red"}]
# sfx
execute as @a at @s run playsound minecraft:entity.lightning_bolt.thunder player @s

Expand Down
2 changes: 1 addition & 1 deletion data/lavarising/functions/system/death/solos/go.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# swap gamemode
gamemode spectator @s
scoreboard players remove alive internal 1
execute unless score eliminate_on_disconnect global matches 1.. run scoreboard players remove alive internal 1

# announce
tellraw @a ["",{"text":"[","color":"dark_gray"},{"text":"☠","color":"red"},{"text":"] ","color":"dark_gray"},{"selector":"@s","color":"red","bold":true},{"text":" has been eliminated!","color":"dark_red"}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

# swap gamemode
gamemode spectator @s
scoreboard players remove alive internal 1
scoreboard players remove alive_blue internal 1
execute unless score eliminate_on_disconnect global matches 1.. run scoreboard players remove alive internal 1
execute unless score eliminate_on_disconnect global matches 1.. run scoreboard players remove alive_blue internal 1

# announce
tellraw @a ["",{"text":"[","color":"dark_gray"},{"text":"☠","color":"red"},{"text":"] ","color":"dark_gray"},{"selector":"@s","color":"blue","bold":true},{"text":" has been eliminated!","color":"dark_red"}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

# swap gamemode
gamemode spectator @s
scoreboard players remove alive internal 1
scoreboard players remove alive_green internal 1
execute unless score eliminate_on_disconnect global matches 1.. run scoreboard players remove alive internal 1
execute unless score eliminate_on_disconnect global matches 1.. run scoreboard players remove alive_green internal 1

# announce
tellraw @a ["",{"text":"[","color":"dark_gray"},{"text":"☠","color":"red"},{"text":"] ","color":"dark_gray"},{"selector":"@s","color":"green","bold":true},{"text":" has been eliminated!","color":"dark_red"}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

# swap gamemode
gamemode spectator @s
scoreboard players remove alive internal 1
scoreboard players remove alive_red internal 1
execute unless score eliminate_on_disconnect global matches 1.. run scoreboard players remove alive internal 1
execute unless score eliminate_on_disconnect global matches 1.. run scoreboard players remove alive_red internal 1

# announce
tellraw @a ["",{"text":"[","color":"dark_gray"},{"text":"☠","color":"red"},{"text":"] ","color":"dark_gray"},{"selector":"@s","color":"red","bold":true},{"text":" has been eliminated!","color":"dark_red"}]
Expand Down
16 changes: 16 additions & 0 deletions data/lavarising/functions/system/main/count.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# LAVARISING player count


## solos
scoreboard players set alive internal 0
execute as @a[gamemode=survival] run scoreboard players add alive internal 1
## teams
scoreboard players set alive_red internal 0
scoreboard players set alive_blue internal 0
scoreboard players set alive_green internal 0
execute as @a[gamemode=survival,team=red] run scoreboard players add alive_red internal 1
execute as @a[gamemode=survival,team=blue] run scoreboard players add alive_blue internal 1
execute as @a[gamemode=survival,team=green] run scoreboard players add alive_green internal 1
## debug!
execute if score debug internal matches 77 run scoreboard players operation alive internal += 1 internal
execute if score debug internal matches 77 run scoreboard players operation alive_blue internal += 1 internal
14 changes: 1 addition & 13 deletions data/lavarising/functions/system/period/main.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,7 @@ execute if score legacy global matches 1.. run tp @e[tag=riser,limit=1] 0 0 0
execute unless score legacy global matches 1.. run tp @e[tag=riser,limit=1] 0 -64 0

# count players
## solos
scoreboard players set alive internal 0
execute as @a[gamemode=survival] run scoreboard players add alive internal 1
## teams
scoreboard players set alive_red internal 0
scoreboard players set alive_blue internal 0
scoreboard players set alive_green internal 0
execute as @a[gamemode=survival,team=red] run scoreboard players add alive_red internal 1
execute as @a[gamemode=survival,team=blue] run scoreboard players add alive_blue internal 1
execute as @a[gamemode=survival,team=green] run scoreboard players add alive_green internal 1
## debug!
execute if score debug internal matches 77 run scoreboard players operation alive internal += 1 internal
execute if score debug internal matches 77 run scoreboard players operation alive_blue internal += 1 internal
function lavarising:system/main/count

# announce
title @a title ["",{"text":"LAVA RISING","color":"red","bold":true}]
Expand Down
2 changes: 1 addition & 1 deletion pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"pack": {
"description": "Lava Rising for 1.19\n\u00A762022.1202 \u00A7r• \u00A7bplexion.dev",
"description": "Lava Rising for 1.19\n\u00A762022.1210 \u00A7r• \u00A7bplexion.dev",
"pack_format": 10
}
}