From d20f38c7a635c8a88b04fd15dfa4d1089bd927fa Mon Sep 17 00:00:00 2001 From: MrBurdy <78470748+MrBurdy@users.noreply.github.com> Date: Sat, 13 Jan 2024 19:17:53 +0100 Subject: [PATCH] Added DeathMessage Added a Carved Pumpkin (for red screens) Added a death message --- .../functions/player/death/drown_in_lava/animation.mcfunction | 3 +++ .../functions/player/death/drown_in_lava/start.mcfunction | 2 ++ .../player/death/killed_by_player/animation.mcfunction | 3 +++ .../functions/player/death/killed_by_player/start.mcfunction | 3 +++ .../functions/player/death/respawn/start.mcfunction | 1 + 5 files changed, 12 insertions(+) diff --git a/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/drown_in_lava/animation.mcfunction b/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/drown_in_lava/animation.mcfunction index e49da446..5f824a20 100644 --- a/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/drown_in_lava/animation.mcfunction +++ b/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/drown_in_lava/animation.mcfunction @@ -1,6 +1,9 @@ # Execute as & at the player # Called by function scaffolding_rush:player/death/trigger +# Show a dead message +title @s actionbar {"translate":"deathScreen.title"} + # Force ride and sink into lava ride @s mount @e[tag=player.death.drown_in_lava.animation,limit=1,sort=nearest] execute as @e[tag=player.death.drown_in_lava.animation,limit=1,sort=nearest] at @s run tp @s ~ ~-0.025 ~ diff --git a/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/drown_in_lava/start.mcfunction b/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/drown_in_lava/start.mcfunction index 0b12ace1..ecc7940b 100644 --- a/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/drown_in_lava/start.mcfunction +++ b/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/drown_in_lava/start.mcfunction @@ -5,6 +5,8 @@ function scaffolding_rush:player/death/just_died tellraw @a ["",{"text":"[BS] ","color":"gold"},{"selector":"@s"},{"translate":"blazing_scaffolding.fell_into_the_lava","color":"gray"}] +# Replace with a pumpkin head to have the color death message +item replace entity @s armor.head with carved_pumpkin{display:{Name:'{"text":""}'},HideFlags:1,CustomModelData:127,Enchantments:[{id:"minecraft:binding_curse",lvl:1s}]} 1 effect give @s resistance 3 127 true effect give @s fire_resistance 3 127 true diff --git a/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/killed_by_player/animation.mcfunction b/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/killed_by_player/animation.mcfunction index 2b67c18b..7dcd7226 100644 --- a/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/killed_by_player/animation.mcfunction +++ b/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/killed_by_player/animation.mcfunction @@ -1,6 +1,9 @@ # Execute as & at the player # Called by function scaffolding_rush:player/death/trigger +# Show a dead message +title @s actionbar {"translate":"deathScreen.title"} + # Force spectate camera spectate @e[tag=player.death.killed_by_player.animation,limit=1,sort=nearest] @s[scores={player.death.animation=1..39}] execute as @e[tag=player.death.killed_by_player.animation,limit=1,sort=nearest] at @s run tp @s ^ ^ ^-0.1 ~ ~1 diff --git a/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/killed_by_player/start.mcfunction b/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/killed_by_player/start.mcfunction index bcbd40ca..dcc75ee4 100644 --- a/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/killed_by_player/start.mcfunction +++ b/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/killed_by_player/start.mcfunction @@ -5,6 +5,9 @@ function scaffolding_rush:player/death/just_died tellraw @a ["",{"text":"[BS] ","color":"gold"},{"selector":"@s"},{"translate":"blazing_scaffolding.was_killed","color":"gray"}] +# Replace with a pumpkin head to have the color death message +item replace entity @s armor.head with carved_pumpkin{display:{Name:'{"text":""}'},HideFlags:1,CustomModelData:127,Enchantments:[{id:"minecraft:binding_curse",lvl:1s}]} 1 + summon armor_stand ~ ~ ~ {Tags:["player.death.killed_by_player.animation","player.death.killed_by_player.animation.new"],NoGravity:1,Small:1,Marker:1,Invisible:1} execute at @s anchored eyes positioned ^ ^ ^ run tp @e[tag=player.death.killed_by_player.animation.new,limit=1,sort=nearest] ~ ~ ~ ~ 0 diff --git a/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/respawn/start.mcfunction b/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/respawn/start.mcfunction index 45f8d6ae..c39abd0d 100644 --- a/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/respawn/start.mcfunction +++ b/datapacks/Scaffolding Rush/data/scaffolding_rush/functions/player/death/respawn/start.mcfunction @@ -5,6 +5,7 @@ scoreboard players operation @s respawn.timer = #respawn.delay.tick options scoreboard players operation @s respawn.timer > 1 const gamemode spectator @s +item replace entity @s armor.head with air tag @s remove player.death.drown_in_lava tag @s remove player.death.killed_by_player tag @s add player.item.can_have_items \ No newline at end of file