Init
This commit is contained in:
10
data/herohost/functions/core/initialize.mcfunction
Normal file
10
data/herohost/functions/core/initialize.mcfunction
Normal file
@ -0,0 +1,10 @@
|
||||
# --- HeroGames - Copyright (c) HeroHost team (code provided by HeroChris). ---
|
||||
|
||||
tellraw @s [{"text":"» ","color":"gray"},{"text":"Welcome ","color":"white"},{"selector":"@s","color":"yellow"},{"text":", to the ","color":"white"},{"text":"H","color":"#fa6a52"},{"text":"e","color":"#fc7551"},{"text":"r","color":"#fd8051"},{"text":"o","color":"#fe8a52"},{"text":"H","color":"#ff9454"},{"text":"o","color":"#ff9e56"},{"text":"s","color":"#ffa85a"},{"text":"t","color":"#ffb15e"},{"text":" server!","color":"white"}]
|
||||
tellraw @a[tag=hc.initialized] [{"text":"» ","color":"gray"},{"text":"Everyone, give ","color":"white"},{"selector":"@s","color":"yellow"},{"text":" a warm welcome!","color":"white"}]
|
||||
execute at @s run playsound minecraft:entity.player.levelup master @s
|
||||
execute in herohost:world run tp @s 0 101 0 0 0
|
||||
gamemode adventure @s[tag=!hc.debug]
|
||||
|
||||
# initialize player
|
||||
tag @s add hc.initialized
|
10
data/herohost/functions/core/reconnect.mcfunction
Normal file
10
data/herohost/functions/core/reconnect.mcfunction
Normal file
@ -0,0 +1,10 @@
|
||||
# --- HeroGames - Copyright (c) HeroHost team (code provided by HeroChris). ---
|
||||
|
||||
tellraw @s [{"text":"» ","color":"gray"},{"text":"Welcome back ","color":"white"},{"selector":"@s","color":"yellow"},{"text":", to the ","color":"white"},{"text":"H","color":"#fa6a52"},{"text":"e","color":"#fc7551"},{"text":"r","color":"#fd8051"},{"text":"o","color":"#fe8a52"},{"text":"H","color":"#ff9454"},{"text":"o","color":"#ff9e56"},{"text":"s","color":"#ffa85a"},{"text":"t","color":"#ffb15e"},{"text":" server!","color":"white"}]
|
||||
tellraw @s[tag=hc.debug] [{"text":"» ","color":"red"},{"text":"You are still in debug mode, click ","color":"white"},{"text":"here","color":"red","clickEvent":{"action":"run_command","value":"/tag @s remove hc.debug"},"hoverEvent": {"action": "show_text","value": {"text": "You need to be an operator to use this.","color": "#fc2003"}}},{"text":" to disable it.","color":"white"}]
|
||||
execute at @s run playsound minecraft:entity.player.levelup master @s
|
||||
execute in herohost:world run tp @s 0 101 0 0 0
|
||||
gamemode adventure @s[tag=!hc.debug]
|
||||
|
||||
# reset player score
|
||||
scoreboard players reset @s +hc.disconnect
|
4
data/herohost/functions/init.mcfunction
Normal file
4
data/herohost/functions/init.mcfunction
Normal file
@ -0,0 +1,4 @@
|
||||
# --- HeroGames - Copyright (c) HeroHost team (code provided by HeroChris). ---
|
||||
|
||||
tellraw @a [{"text":"» ","color":"green"},{"text": "Datapack resources loaded successfully.","color": "#ffffff"}]
|
||||
tellraw @a[tag=hc.debug] [{"text":"» ","color":"gray"},{"text":"If any issue occurs, click ","color":"white"},{"text":"here","color":"red","clickEvent":{"action":"run_command","value":"/reload"},"hoverEvent": {"action": "show_text","value": {"text": "You need to be an operator to use this.","color": "#fc2003"}}},{"text":" to reload the server.","color":"white"}]
|
8
data/herohost/functions/main.mcfunction
Normal file
8
data/herohost/functions/main.mcfunction
Normal file
@ -0,0 +1,8 @@
|
||||
# --- HeroGames - Copyright (c) HeroHost team (code provided by HeroChris). ---
|
||||
|
||||
# core handling
|
||||
execute as @a[tag=!hc.initialized] run function herohost:core/initialize
|
||||
execute as @a[scores={+hc.disconnect=1..}] run function herohost:core/reconnect
|
||||
|
||||
# games
|
||||
execute in herohost:world if entity @p[x=-125,y=50,z=-376,dx=250,dy=100,dz=250] run function herohost:tnt/core
|
7
data/herohost/functions/tnt/core.mcfunction
Normal file
7
data/herohost/functions/tnt/core.mcfunction
Normal file
@ -0,0 +1,7 @@
|
||||
# --- HeroGames - Copyright (c) HeroHost team (code provided by HeroChris). ---
|
||||
|
||||
# give and remove tnt
|
||||
item replace entity @a[tag=hc.get_tnt] armor.head with tnt{HideFlags:1,Enchantments:[{id:"minecraft:binding_curse",lvl:1s}]} 1
|
||||
item replace entity @a[tag=hc.give_tnt] armor.head with air 1
|
||||
tag @a remove hc.get_tnt
|
||||
tag @a remove hc.give_tnt
|
4
data/herohost/functions/tnt/get_tnt.mcfunction
Normal file
4
data/herohost/functions/tnt/get_tnt.mcfunction
Normal file
@ -0,0 +1,4 @@
|
||||
# --- HeroGames - Copyright (c) HeroHost team (code provided by HeroChris). ---
|
||||
|
||||
advancement revoke @s only herohost:tnt/get_tnt
|
||||
tag @s add hc.get_tnt
|
4
data/herohost/functions/tnt/give_tnt.mcfunction
Normal file
4
data/herohost/functions/tnt/give_tnt.mcfunction
Normal file
@ -0,0 +1,4 @@
|
||||
# --- HeroGames - Copyright (c) HeroHost team (code provided by HeroChris). ---
|
||||
|
||||
advancement revoke @s only herohost:tnt/give_tnt
|
||||
tag @s add hc.give_tnt
|
Reference in New Issue
Block a user