From f8951522bb848185f0aa68a72b8cbe0440091ce5 Mon Sep 17 00:00:00 2001 From: HeroChris Date: Fri, 15 Sep 2023 19:52:54 +0200 Subject: [PATCH] Init --- data/herohost/advancements/tnt/get_tnt.json | 42 ++++++++++++++ data/herohost/advancements/tnt/give_tnt.json | 57 +++++++++++++++++++ data/herohost/dimension/world.json | 16 ++++++ data/herohost/dimension_type/world_type.json | 20 +++++++ .../functions/core/initialize.mcfunction | 10 ++++ .../functions/core/reconnect.mcfunction | 10 ++++ data/herohost/functions/init.mcfunction | 4 ++ data/herohost/functions/main.mcfunction | 8 +++ data/herohost/functions/tnt/core.mcfunction | 7 +++ .../herohost/functions/tnt/get_tnt.mcfunction | 4 ++ .../functions/tnt/give_tnt.mcfunction | 4 ++ .../tags/blocks/infiniburn_world.json | 5 ++ data/herohost/worldgen/biome/biome.json | 25 ++++++++ .../configured_feature/patch_grass.json | 43 ++++++++++++++ data/minecraft/tags/functions/load.json | 5 ++ data/minecraft/tags/functions/tick.json | 5 ++ pack.mcmeta | 6 ++ 17 files changed, 271 insertions(+) create mode 100644 data/herohost/advancements/tnt/get_tnt.json create mode 100644 data/herohost/advancements/tnt/give_tnt.json create mode 100644 data/herohost/dimension/world.json create mode 100644 data/herohost/dimension_type/world_type.json create mode 100644 data/herohost/functions/core/initialize.mcfunction create mode 100644 data/herohost/functions/core/reconnect.mcfunction create mode 100644 data/herohost/functions/init.mcfunction create mode 100644 data/herohost/functions/main.mcfunction create mode 100644 data/herohost/functions/tnt/core.mcfunction create mode 100644 data/herohost/functions/tnt/get_tnt.mcfunction create mode 100644 data/herohost/functions/tnt/give_tnt.mcfunction create mode 100644 data/herohost/tags/blocks/infiniburn_world.json create mode 100644 data/herohost/worldgen/biome/biome.json create mode 100644 data/herohost/worldgen/configured_feature/patch_grass.json create mode 100644 data/minecraft/tags/functions/load.json create mode 100644 data/minecraft/tags/functions/tick.json create mode 100644 pack.mcmeta diff --git a/data/herohost/advancements/tnt/get_tnt.json b/data/herohost/advancements/tnt/get_tnt.json new file mode 100644 index 0000000..88c8b44 --- /dev/null +++ b/data/herohost/advancements/tnt/get_tnt.json @@ -0,0 +1,42 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:entity_hurt_player", + "conditions": { + "player": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "items": [ + "minecraft:tnt" + ] + } + } + } + } + } + ], + "damage": { + "source_entity": { + "type": "minecraft:player", + "equipment": { + "head": { + "items": [ + "minecraft:tnt" + ] + } + } + } + } + } + } + }, + "rewards": { + "function": "herohost:tnt/get_tnt" + } +} diff --git a/data/herohost/advancements/tnt/give_tnt.json b/data/herohost/advancements/tnt/give_tnt.json new file mode 100644 index 0000000..d842787 --- /dev/null +++ b/data/herohost/advancements/tnt/give_tnt.json @@ -0,0 +1,57 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:player_hurt_entity", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "items": [ + "minecraft:tnt" + ] + } + } + } + } + ], + "entity": [ + { + "condition": "minecraft:all_of", + "terms": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "items": [ + "minecraft:tnt" + ] + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "minecraft:player" + } + } + ] + } + ] + } + } + }, + "rewards": { + "function": "herohost:tnt/give_tnt" + } +} diff --git a/data/herohost/dimension/world.json b/data/herohost/dimension/world.json new file mode 100644 index 0000000..6a4e32e --- /dev/null +++ b/data/herohost/dimension/world.json @@ -0,0 +1,16 @@ +{ + "type": "herohost:world_type", + "generator": { + "type": "minecraft:flat", + "settings": { + "biome": "herohost:biome", + "lakes": false, + "features": false, + "layers": [{ + "height": 1, + "block": "minecraft:air" + }], + "structure_overrides": [] + } + } +} \ No newline at end of file diff --git a/data/herohost/dimension_type/world_type.json b/data/herohost/dimension_type/world_type.json new file mode 100644 index 0000000..955f985 --- /dev/null +++ b/data/herohost/dimension_type/world_type.json @@ -0,0 +1,20 @@ +{ + "ultrawarm": false, + "natural": false, + "piglin_safe": false, + "respawn_anchor_works": true, + "bed_works": true, + "has_raids": false, + "has_skylight": true, + "has_ceiling": false, + "coordinate_scale": 1, + "ambient_light": 0.0, + "logical_height": 384, + "infiniburn": "#herohost:infiniburn_world", + "min_y": -64, + "height": 384, + "effects": "minecraft:overworld", + "sea_level": 0, + "monster_spawn_light_level": 0, + "monster_spawn_block_light_limit": 0 +} \ No newline at end of file diff --git a/data/herohost/functions/core/initialize.mcfunction b/data/herohost/functions/core/initialize.mcfunction new file mode 100644 index 0000000..b068e3b --- /dev/null +++ b/data/herohost/functions/core/initialize.mcfunction @@ -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 \ No newline at end of file diff --git a/data/herohost/functions/core/reconnect.mcfunction b/data/herohost/functions/core/reconnect.mcfunction new file mode 100644 index 0000000..506d783 --- /dev/null +++ b/data/herohost/functions/core/reconnect.mcfunction @@ -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 \ No newline at end of file diff --git a/data/herohost/functions/init.mcfunction b/data/herohost/functions/init.mcfunction new file mode 100644 index 0000000..ec87db9 --- /dev/null +++ b/data/herohost/functions/init.mcfunction @@ -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"}] \ No newline at end of file diff --git a/data/herohost/functions/main.mcfunction b/data/herohost/functions/main.mcfunction new file mode 100644 index 0000000..f7134db --- /dev/null +++ b/data/herohost/functions/main.mcfunction @@ -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 \ No newline at end of file diff --git a/data/herohost/functions/tnt/core.mcfunction b/data/herohost/functions/tnt/core.mcfunction new file mode 100644 index 0000000..2549088 --- /dev/null +++ b/data/herohost/functions/tnt/core.mcfunction @@ -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 \ No newline at end of file diff --git a/data/herohost/functions/tnt/get_tnt.mcfunction b/data/herohost/functions/tnt/get_tnt.mcfunction new file mode 100644 index 0000000..06fcb69 --- /dev/null +++ b/data/herohost/functions/tnt/get_tnt.mcfunction @@ -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 \ No newline at end of file diff --git a/data/herohost/functions/tnt/give_tnt.mcfunction b/data/herohost/functions/tnt/give_tnt.mcfunction new file mode 100644 index 0000000..8bf026a --- /dev/null +++ b/data/herohost/functions/tnt/give_tnt.mcfunction @@ -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 \ No newline at end of file diff --git a/data/herohost/tags/blocks/infiniburn_world.json b/data/herohost/tags/blocks/infiniburn_world.json new file mode 100644 index 0000000..568972a --- /dev/null +++ b/data/herohost/tags/blocks/infiniburn_world.json @@ -0,0 +1,5 @@ +{ + "values": [ + "#minecraft:infiniburn_overworld" + ] +} \ No newline at end of file diff --git a/data/herohost/worldgen/biome/biome.json b/data/herohost/worldgen/biome/biome.json new file mode 100644 index 0000000..c93238b --- /dev/null +++ b/data/herohost/worldgen/biome/biome.json @@ -0,0 +1,25 @@ +{ + "temperature": 0.8, + "downfall": 0, + "has_precipitation": true, + "category": "none", + "effects": { + "sky_color": 11652351, + "fog_color": 8432639, + "water_color": 1277345, + "water_fog_color": 1277345, + "foliage_color": 13065245, + "grass_color": 5072394, + "particle": { + "probability": 0.0005, + "options": { + "scale": 0.75, + "type": "minecraft:spore_blossom_air" + } + } + }, + "spawners": {}, + "spawn_costs": {}, + "carvers": {}, + "features": [] +} \ No newline at end of file diff --git a/data/herohost/worldgen/configured_feature/patch_grass.json b/data/herohost/worldgen/configured_feature/patch_grass.json new file mode 100644 index 0000000..d7dc29a --- /dev/null +++ b/data/herohost/worldgen/configured_feature/patch_grass.json @@ -0,0 +1,43 @@ +{ + "config": { + "tries": 48, + "xz_spread": 6, + "y_spread": 1, + "feature": { + "feature": { + "config": { + "to_place": { + "entries": [ + { + "data": { + "Name": "minecraft:grass" + }, + "weight": 3 + }, + { + "data": { + "Name": "minecraft:fern" + }, + "weight": 1 + } + ], + "type": "minecraft:weighted_state_provider" + } + }, + "type": "minecraft:simple_block" + }, + "placement": [ + { + "predicate": { + "blocks": [ + "minecraft:air" + ], + "type": "minecraft:matching_blocks" + }, + "type": "minecraft:block_predicate_filter" + } + ] + } + }, + "type": "minecraft:flower" + } \ No newline at end of file diff --git a/data/minecraft/tags/functions/load.json b/data/minecraft/tags/functions/load.json new file mode 100644 index 0000000..ec051ad --- /dev/null +++ b/data/minecraft/tags/functions/load.json @@ -0,0 +1,5 @@ +{ + "values": [ + "herohost:init" + ] + } \ No newline at end of file diff --git a/data/minecraft/tags/functions/tick.json b/data/minecraft/tags/functions/tick.json new file mode 100644 index 0000000..8789838 --- /dev/null +++ b/data/minecraft/tags/functions/tick.json @@ -0,0 +1,5 @@ +{ + "values": [ + "herohost:main" + ] + } \ No newline at end of file diff --git a/pack.mcmeta b/pack.mcmeta new file mode 100644 index 0000000..5db4e52 --- /dev/null +++ b/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "pack_format": 15, + "description": "HeroHost - HeroChris 2023" + } +} \ No newline at end of file