diff --git a/data/herohost/enchantment/lobby.json b/data/herohost/enchantment/lobby.json index f8d3cfa..8ab4306 100644 --- a/data/herohost/enchantment/lobby.json +++ b/data/herohost/enchantment/lobby.json @@ -19,6 +19,7 @@ "feet" ], "effects": { + "prevent_armor_change": {}, "attributes": [ { "amount": -1, @@ -45,6 +46,24 @@ ] } } + }, + { + "effect": {}, + "requirements": { + "condition": "minecraft:damage_source_properties", + "predicate": { + "tags": [ + { + "expected": true, + "id": "minecraft:is_drowning" + }, + { + "expected": false, + "id": "minecraft:bypasses_invulnerability" + } + ] + } + } } ] } diff --git a/data/herohost/function/core/initialize.mcfunction b/data/herohost/function/core/initialize.mcfunction index dbc10dc..91a375d 100644 --- a/data/herohost/function/core/initialize.mcfunction +++ b/data/herohost/function/core/initialize.mcfunction @@ -5,12 +5,11 @@ tellraw @a[tag=hc.initialized] [{"text":"» ","color":"gray"},{"translate":"hhos execute at @s run playsound minecraft:block.amethyst_block.step ambient @s ~ ~ ~ 0.7 0.7 # reset player - clear @s[tag=!hc.debug] - execute in herohost:world run tp @s[tag=!hc.debug] 5 109 50 -90 0 - execute in herohost:world run spawnpoint @s 5 109 50 -90 + execute as @s[tag=!hc.debug] run function herohost:core/reset # misc scoreboard players enable @s +hc.warp + execute at @s run playsound minecraft:block.amethyst_block.step ambient @s ~ ~ ~ 0.7 0.7 # initialize player -tag @s add hc.initialized \ No newline at end of file + tag @s add hc.initialized \ No newline at end of file diff --git a/data/herohost/function/core/reconnect.mcfunction b/data/herohost/function/core/reconnect.mcfunction index 6183100..1f82f33 100644 --- a/data/herohost/function/core/reconnect.mcfunction +++ b/data/herohost/function/core/reconnect.mcfunction @@ -5,12 +5,11 @@ tellraw @s[tag=hc.debug] [{"text":"» ","color":"red"},{"translate":"hhost.minig execute at @s run playsound minecraft:block.amethyst_block.step ambient @s ~ ~ ~ 0.7 0.7 # reset player - clear @s[tag=!hc.debug] - execute in herohost:world run tp @s[tag=!hc.debug] 5 109 50 -90 0 - execute in herohost:world run spawnpoint @s 5 109 50 -90 + execute as @s[tag=!hc.debug] run function herohost:core/reset # misc scoreboard players enable @s +hc.warp + execute at @s run playsound minecraft:block.amethyst_block.step ambient @s ~ ~ ~ 0.7 0.7 # reset player score -scoreboard players reset @s +hc.disconnect \ No newline at end of file + scoreboard players reset @s +hc.disconnect \ No newline at end of file diff --git a/data/herohost/function/core/reset.mcfunction b/data/herohost/function/core/reset.mcfunction new file mode 100644 index 0000000..a54f4b0 --- /dev/null +++ b/data/herohost/function/core/reset.mcfunction @@ -0,0 +1,18 @@ +# --- HeroGames - Copyright (c) HeroHost team (code provided by HeroChris). --- + +# world below y50 tag + execute if entity @s[predicate=herohost:world_y50] run tag @s add hc.world_y50 + +# default functionality + clear @s[tag=!hc.world_y50] + item replace entity @s armor.feet with minecraft:leather_boots[minecraft:enchantments={levels:{"herohost:lobby":1}}] + execute in herohost:world run tp @s 5 109 50 -90 0 + execute in herohost:world run spawnpoint @s 5 109 50 -90 + +# stop execution of normal + execute if entity @s[tag=!hc.world_y50] run return fail + +# world below y50 execution + execute at @s[tag=hc.world_y50] run playsound minecraft:entity.enderman.teleport ambient @s ~ ~ ~ 0.7 0.7 + title @s[tag=hc.world_y50] actionbar [{"translate":"hhost.minigame."}] + tag @s[tag=hc.world_y50] remove hc.world_y50 diff --git a/data/herohost/function/main.mcfunction b/data/herohost/function/main.mcfunction index 4057975..2c94eb1 100644 --- a/data/herohost/function/main.mcfunction +++ b/data/herohost/function/main.mcfunction @@ -11,7 +11,9 @@ # hc.debug # misc + effect give @a[gamemode=!creative] saturation 1 1 true execute as @a[scores={+hc.warp=1..}] run function herohost:misc/warp + execute as @a[tag=!hc.debug,predicate=herohost:world_y50] run function herohost:core/reset # games # [ WIP ] execute in herohost:world if entity @p[x=-125,y=50,z=-376,dx=250,dy=100,dz=250] run function herohost:tnt/core \ No newline at end of file diff --git a/data/herohost/predicate/world_y50.json b/data/herohost/predicate/world_y50.json new file mode 100644 index 0000000..7d759b1 --- /dev/null +++ b/data/herohost/predicate/world_y50.json @@ -0,0 +1,14 @@ +{ + "condition": "minecraft:entity_properties", + "predicate": { + "location": { + "position": { + "y": { + "max": 50 + } + }, + "dimension": "herohost:world" + } + }, + "entity":"this" +} \ No newline at end of file