diff --git a/gm4/modeldata_registry.json b/gm4/modeldata_registry.json index dbea26187b..7a026abd6e 100644 --- a/gm4/modeldata_registry.json +++ b/gm4/modeldata_registry.json @@ -50,6 +50,9 @@ "axolotl_bucket": { "gm4_metallurgy:shamir/infinitas": 100 }, + "azalea_leaves": { + "gm4_monsters_unbound:item/spore/default": 1 + }, "bamboo_hanging_sign": { "gm4_trapped_signs:item/secret_trapped_bamboo_hanging_sign": 1, "gm4_trapped_signs:item/trapped_bamboo_hanging_sign": 2 @@ -170,6 +173,7 @@ "gm4_animi_shamir:shamir/animi": 124 }, "chainmail_chestplate": { + "gm4_monsters_unbound:guidebook_icon/monsters_unbound": 1, "gm4_weighted_armour:shamir/helious": 103, "gm4_metallurgy:shamir/defuse": 106, "gm4_iacio_shamir:shamir/iacio": 122, @@ -189,6 +193,9 @@ "gm4_trapped_signs:item/secret_trapped_cherry_hanging_sign": 1, "gm4_trapped_signs:item/trapped_cherry_hanging_sign": 2 }, + "cherry_leaves": { + "gm4_monsters_unbound:item/spore/cherry": 1 + }, "cherry_sign": { "gm4_trapped_signs:item/trapped_cherry_sign": 1, "gm4_trapped_signs:item/secret_trapped_cherry_sign": 2 @@ -579,6 +586,9 @@ "gm4_animi_shamir:shamir/animi": 124, "gm4_orb_of_ankou:guidebook_icon/orb_of_ankou": 200 }, + "flowering_azalea_leaves": { + "gm4_monsters_unbound:item/spore/flowering": 1 + }, "furnace": { "gm4_smelteries:gui/advancement/smelteries": 1, "gm4_forming_press:guidebook_icon/forming_press": 2, @@ -962,6 +972,7 @@ }, "leather_chestplate": { "gm4_combat_expanded:gui/advancement/combat_expanded_identify": 1, + "gm4_survival_refightalized:guidebook_icon/survival_refightalized": 4, "gm4_weighted_armour:shamir/helious": 103, "gm4_metallurgy:shamir/defuse": 106, "gm4_iacio_shamir:shamir/iacio": 122, @@ -995,6 +1006,9 @@ "lime_concrete_powder": { "gm4_zauber_cauldrons:block/liquid_magicol/lime": 300 }, + "lime_glazed_terracotta": { + "gm4_monsters_unbound:item/elite_headwear/mending": 1 + }, "lingering_potion": { "gm4_midnight_menaces:guidebook_icon/illusioner_nights": 1, "gm4_lightning_in_a_bottle:item/lingering_lightning_in_a_bottle": 4, @@ -1170,6 +1184,7 @@ }, "netherite_sword": { "gm4_combat_expanded:guidebook_icon/combat_expanded": 1, + "gm4_survival_refightalized:guidebook_icon/survival_refightalized": 4, "gm4_end_fishing:item/end_city_swords_1": 10, "gm4_end_fishing:item/end_city_swords_2": 11, "gm4_end_fishing:item/end_city_swords_3": 12, @@ -1229,10 +1244,16 @@ "oxidized_cut_copper": { "gm4_tinkering_compressors:block/tinkering_compressor_plate": 1 }, + "packed_ice": { + "gm4_monsters_unbound:item/elite_headwear/glacial": 1 + }, "paper": { "gm4_book_binders:item/enchanted_page": 1, "gm4_book_binders:gui/advancement/book_binders_debind": 2 }, + "pearlescent_froglight": { + "gm4_monsters_unbound:item/elite_headwear/pearlescent": 1 + }, "phantom_membrane": { "gm4_midnight_menaces:guidebook_icon/enlarging_phantoms": 1 }, diff --git a/gm4/skin_cache.json b/gm4/skin_cache.json index 505748697a..dd915c0844 100644 --- a/gm4/skin_cache.json +++ b/gm4/skin_cache.json @@ -964,6 +964,15 @@ ], "gm4_auto_crafting": [ "gm4_custom_crafters:custom_crafter" + ], + "gm4_zauber_liquids": [ + "gm4_potion_liquids:liquids/harming", + "gm4_potion_liquids:liquids/healing", + "gm4_potion_liquids:liquids/leaping", + "gm4_potion_liquids:liquids/poison", + "gm4_potion_liquids:liquids/regeneration", + "gm4_potion_liquids:liquids/strength", + "gm4_potion_liquids:liquids/swiftness" ] } } diff --git a/gm4_augmented_armor/README.md b/gm4_augmented_armor/README.md new file mode 100644 index 0000000000..f3bdd30f2e --- /dev/null +++ b/gm4_augmented_armor/README.md @@ -0,0 +1,11 @@ +# Augmented Armor + +Use special armor augments to defend against mobs that grow ever stronger! + +Spore Zombies in Lush Caves + +### Features: +- Mobs will drop new Modified armor and weapons. These come with special attributes that allow you to customize your gear! +- Augments range from a ramping speed boost to a loyal immortal dog to fight by your side. Or a piece of armour that teleports you randomly, if that's what you like. + +A full list of all augments to can be found at the [Wiki](https://wiki.gm4.co/Augmented_Armor). diff --git a/gm4_augmented_armor/assets/gm4_augmented_armor/textures/entity/wolf/gm4_aa_canine.png b/gm4_augmented_armor/assets/gm4_augmented_armor/textures/entity/wolf/gm4_aa_canine.png new file mode 100644 index 0000000000..1cfbfe01b2 Binary files /dev/null and b/gm4_augmented_armor/assets/gm4_augmented_armor/textures/entity/wolf/gm4_aa_canine.png differ diff --git a/gm4_augmented_armor/assets/gm4_augmented_armor/textures/entity/wolf/gm4_aa_canine_alt.png b/gm4_augmented_armor/assets/gm4_augmented_armor/textures/entity/wolf/gm4_aa_canine_alt.png new file mode 100644 index 0000000000..2741657863 Binary files /dev/null and b/gm4_augmented_armor/assets/gm4_augmented_armor/textures/entity/wolf/gm4_aa_canine_alt.png differ diff --git a/gm4_augmented_armor/assets/gm4_augmented_armor/textures/entity/wolf/gm4_aa_canine_alt_angry.png b/gm4_augmented_armor/assets/gm4_augmented_armor/textures/entity/wolf/gm4_aa_canine_alt_angry.png new file mode 100644 index 0000000000..2384baef8f Binary files /dev/null and b/gm4_augmented_armor/assets/gm4_augmented_armor/textures/entity/wolf/gm4_aa_canine_alt_angry.png differ diff --git a/gm4_augmented_armor/assets/gm4_augmented_armor/textures/entity/wolf/gm4_aa_canine_alt_tame.png b/gm4_augmented_armor/assets/gm4_augmented_armor/textures/entity/wolf/gm4_aa_canine_alt_tame.png new file mode 100644 index 0000000000..3a26f14972 Binary files /dev/null and b/gm4_augmented_armor/assets/gm4_augmented_armor/textures/entity/wolf/gm4_aa_canine_alt_tame.png differ diff --git a/gm4_augmented_armor/assets/gm4_augmented_armor/textures/entity/wolf/gm4_aa_canine_angry.png b/gm4_augmented_armor/assets/gm4_augmented_armor/textures/entity/wolf/gm4_aa_canine_angry.png new file mode 100644 index 0000000000..db168847bb Binary files /dev/null and b/gm4_augmented_armor/assets/gm4_augmented_armor/textures/entity/wolf/gm4_aa_canine_angry.png differ diff --git a/gm4_augmented_armor/assets/gm4_augmented_armor/textures/entity/wolf/gm4_aa_canine_tame.png b/gm4_augmented_armor/assets/gm4_augmented_armor/textures/entity/wolf/gm4_aa_canine_tame.png new file mode 100644 index 0000000000..1cfbfe01b2 Binary files /dev/null and b/gm4_augmented_armor/assets/gm4_augmented_armor/textures/entity/wolf/gm4_aa_canine_tame.png differ diff --git a/gm4_augmented_armor/beet.yaml b/gm4_augmented_armor/beet.yaml new file mode 100644 index 0000000000..ad823af12b --- /dev/null +++ b/gm4_augmented_armor/beet.yaml @@ -0,0 +1,36 @@ +id: gm4_augmented_armor +name: Augmented Armor +version: 1.0.X + +data_pack: + load: . + +resource_pack: + load: . + +pipeline: + - gm4.plugins.extend.module + - gm4.plugins.include.lib_forceload + - gm4.plugins.include.lib_lore + +meta: + gm4: + versioning: + required: + lib_forceload: 1.3.0 + lib_lore: 1.1.0 + gm4_survival_refightalized: 1.0.0 + schedule_loops: + - slow_clock + website: + description: Use special armor augments to defend against mobs that grow ever stronger. + recommended: + - gm4_monsters_unbound + - gm4_metallurgy + video: null + wiki: https://wiki.gm4.co/wiki/Augmented_Armor + credits: + Creator: + - Thanathor + Icon Design: + - Hozz diff --git a/gm4_augmented_armor/data/gm4/advancement/augmented_armor_identify.json b/gm4_augmented_armor/data/gm4/advancement/augmented_armor_identify.json new file mode 100644 index 0000000000..39f7e07cdf --- /dev/null +++ b/gm4_augmented_armor/data/gm4/advancement/augmented_armor_identify.json @@ -0,0 +1,32 @@ +{ + "display": { + "icon": { + "id": "minecraft:iron_chestplate" + }, + "title": { + "translate": "advancement.gm4.augmented_armor.identify.title", + "fallback": "Hidden Power" + }, + "description": { + "translate": "advancement.gm4.augmented_armor.identify.description", + "fallback": "Obtain an Augmented piece of armor from a monster", + "color": "gray" + }, + "frame": "task" + }, + "parent": "gm4:survival_refightalized_armor_damage", + "criteria": { + "full_set": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{}}" + } + } + ] + } + } + } +} diff --git a/gm4_augmented_armor/data/gm4/advancement/augmented_armor_vorpal.json b/gm4_augmented_armor/data/gm4/advancement/augmented_armor_vorpal.json new file mode 100644 index 0000000000..b3a9f65f7f --- /dev/null +++ b/gm4_augmented_armor/data/gm4/advancement/augmented_armor_vorpal.json @@ -0,0 +1,23 @@ +{ + "display": { + "icon": { + "id": "minecraft:chorus_fruit" + }, + "title": { + "translate": "advancement.gm4.augmented_armor.vorpal.title", + "fallback": "Vwoops!" + }, + "description": { + "translate": "advancement.gm4.augmented_armor.vorpal.description", + "fallback": "Who thought this was a good idea?" + }, + "frame": "challenge", + "hidden": true + }, + "parent": "gm4:augmented_armor_identify", + "criteria": { + "guardian": { + "trigger": "minecraft:impossible" + } + } +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/advancement/augment/canine_interact.json b/gm4_augmented_armor/data/gm4_augmented_armor/advancement/augment/canine_interact.json new file mode 100644 index 0000000000..1e7000c1ff --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/advancement/augment/canine_interact.json @@ -0,0 +1,16 @@ +{ + "criteria": { + "feed": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "entity": { + "type": "wolf", + "nbt": "{Tags:[\"gm4_aa_wolf\"]}" + } + } + } + }, + "rewards": { + "function": "gm4_augmented_armor:armor/augment/type/canine/wolf_interact_check" + } +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/advancement/augment/hearty_wear.json b/gm4_augmented_armor/data/gm4_augmented_armor/advancement/augment/hearty_wear.json new file mode 100644 index 0000000000..5843c697a6 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/advancement/augment/hearty_wear.json @@ -0,0 +1,26 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "player": [ + { + "condition": "minecraft:reference", + "name": "gm4_augmented_armor:modified_armor/augment/hearty" + } + ], + "items": [ + { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{name:hearty}}}" + } + } + ] + } + } + }, + "rewards": { + "function": "gm4_augmented_armor:armor/augment/type/hearty/update" + } +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/advancement/damage_dealt.json b/gm4_augmented_armor/data/gm4_augmented_armor/advancement/damage_dealt.json new file mode 100644 index 0000000000..f4b3e9cf44 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/advancement/damage_dealt.json @@ -0,0 +1,32 @@ +{ + "criteria": { + "damage_dealt": { + "trigger": "minecraft:player_hurt_entity", + "conditions": { + "player": [ + { + "condition": "minecraft:reference", + "name": "gm4_augmented_armor:modified_armor/generic_damage_dealt" + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_aa_augment_damager\"]}" + } + } + } + ], + "damage": { + "blocked": false, + "type": {} + } + } + } + }, + "rewards": { + "function": "gm4_augmented_armor:armor/trigger/damage_dealt" + } +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/advancement/effect_immunity.json b/gm4_augmented_armor/data/gm4_augmented_armor/advancement/effect_immunity.json new file mode 100644 index 0000000000..b1b0792e1d --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/advancement/effect_immunity.json @@ -0,0 +1,191 @@ +{ + "criteria": { + "mining_fatigue": { + "trigger": "minecraft:effects_changed", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_aa_effect_immunity.mining_fatigue\"]}" + } + } + ], + "effects": { + "minecraft:mining_fatigue": {} + } + } + }, + "wither": { + "trigger": "minecraft:effects_changed", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_aa_effect_immunity.wither\"]}" + } + } + ], + "effects": { + "minecraft:wither": {} + } + } + }, + "poison": { + "trigger": "minecraft:effects_changed", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_aa_effect_immunity.poison\"]}" + } + } + ], + "effects": { + "minecraft:poison": {} + } + } + }, + "hunger": { + "trigger": "minecraft:effects_changed", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_aa_effect_immunity.hunger\"]}" + } + } + ], + "effects": { + "minecraft:hunger": {} + } + } + }, + "blindness": { + "trigger": "minecraft:effects_changed", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_aa_effect_immunity.blind\"]}" + } + } + ], + "effects": { + "minecraft:blindness": {} + } + } + }, + "nausea": { + "trigger": "minecraft:effects_changed", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_aa_effect_immunity.nausea\"]}" + } + } + ], + "effects": { + "minecraft:nausea": {} + } + } + }, + "weakness": { + "trigger": "minecraft:effects_changed", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_aa_effect_immunity.weakness\"]}" + } + } + ], + "effects": { + "minecraft:weakness": {} + } + } + }, + "levitation": { + "trigger": "minecraft:effects_changed", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_aa_effect_immunity.levitation\"]}" + } + } + ], + "effects": { + "minecraft:levitation": {} + } + } + }, + "slow_falling": { + "trigger": "minecraft:effects_changed", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_aa_effect_immunity.slow_falling\"]}" + } + } + ], + "effects": { + "minecraft:slow_falling": {} + } + } + }, + "slowness": { + "trigger": "minecraft:effects_changed", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_aa_effect_immunity.slowness\"]}" + } + } + ], + "effects": { + "minecraft:slowness": {} + } + } + } + }, + "requirements": [ + [ + "mining_fatigue", + "wither", + "poison", + "hunger", + "blindness", + "nausea", + "weakness", + "levitation", + "slow_falling", + "slowness" + ] + ], + "rewards": { + "function": "gm4_augmented_armor:player/effect_immunity" + } +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/advancement/give_id.json b/gm4_augmented_armor/data/gm4_augmented_armor/advancement/give_id.json new file mode 100644 index 0000000000..c92b91a58a --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/advancement/give_id.json @@ -0,0 +1,10 @@ +{ + "criteria": { + "join": { + "trigger": "minecraft:tick" + } + }, + "rewards": { + "function": "gm4_augmented_armor:player/give_id" + } +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/advancement/in_pvp.json b/gm4_augmented_armor/data/gm4_augmented_armor/advancement/in_pvp.json new file mode 100644 index 0000000000..fef81385fc --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/advancement/in_pvp.json @@ -0,0 +1,87 @@ +{ + "criteria": { + "damage_pvp_player": { + "trigger": "minecraft:player_hurt_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:all_of", + "terms": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": "this", + "score": "gm4_aa_in_pvp" + }, + "range": { + "min": 1 + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "minecraft:player" + } + } + ] + } + ] + } + }, + "damage_player": { + "trigger": "minecraft:player_hurt_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:all_of", + "terms": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": "this", + "score": "gm4_aa_in_pvp" + }, + "range": { + "min": 1 + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "minecraft:player" + } + } + ] + } + ] + } + }, + "damaged_by_player": { + "trigger": "minecraft:entity_hurt_player", + "conditions": { + "damage": { + "source_entity": { + "type": "minecraft:player" + } + } + } + } + }, + "requirements": [ + [ + "damage_pvp_player", + "damage_player", + "damaged_by_player" + ] + ], + "rewards": { + "function": "gm4_augmented_armor:player/in_pvp" + } +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/clocked.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/clocked.mcfunction new file mode 100644 index 0000000000..60706cc406 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/clocked.mcfunction @@ -0,0 +1,23 @@ +# check the augment on the armor piece +# @s = player wearing modified armor +# at @s +# run from functions in armor/slot/ + +# store active information +execute store result score $active gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.active +execute store result score $augment gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.id + +# run based on augment id +execute if score $augment gm4_aa_data matches 1 on vehicle run function gm4_augmented_armor:armor/augment/type/equine/mount +execute if score $augment gm4_aa_data matches 2 unless score @s gm4_aa_augment.dashing.timer matches ..-1 run function gm4_augmented_armor:armor/augment/type/dashing/apply +execute if score $augment gm4_aa_data matches 3 run function gm4_augmented_armor:armor/augment/type/flighty/check +execute if score $augment gm4_aa_data matches 4 run function gm4_augmented_armor:armor/augment/type/acrobatic/check +execute if score $augment gm4_aa_data matches 5 run function gm4_augmented_armor:armor/augment/type/vigorous/get_immunities +execute if score $augment gm4_aa_data matches 6 if score @s gm4_aa_stat.kills matches 1.. run function gm4_augmented_armor:armor/augment/type/totemic/activate +execute if score $augment gm4_aa_data matches 14 run function gm4_augmented_armor:armor/augment/type/berserkers/check +execute if score $augment gm4_aa_data matches 15 run function gm4_augmented_armor:armor/augment/type/gutsy/check +execute if score $augment gm4_aa_data matches 17 run function gm4_augmented_armor:armor/augment/type/canine/check +execute if score $augment gm4_aa_data matches 24 run function gm4_augmented_armor:armor/augment/type/linked/check +execute if score $augment gm4_aa_data matches 25 run function gm4_augmented_armor:armor/augment/type/sustaining/check +execute if score $augment gm4_aa_data matches 26 if score @s gm4_aa_stat.kills matches 1.. run function gm4_augmented_armor:armor/augment/type/vampiric/activate +execute if score $augment gm4_aa_data matches 27 run function gm4_augmented_armor:armor/augment/type/steelheart/check diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/damage_dealt.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/damage_dealt.mcfunction new file mode 100644 index 0000000000..b8ad5d13e1 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/damage_dealt.mcfunction @@ -0,0 +1,13 @@ +# check the augment on the armor piece +# @s = player wearing modified armor +# at @s +# run from functions in armor/slot/ + +# store active information +execute store result score $active gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.active +execute store result score $augment gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.id + +# run based on augment id +execute if score $augment gm4_aa_data matches 2 if score @s gm4_aa_augment.dashing.timer matches 1.. run function gm4_augmented_armor:armor/augment/type/dashing/remove +execute if score $augment gm4_aa_data matches 3 run function gm4_augmented_armor:armor/augment/type/flighty/add +execute if score $augment gm4_aa_data matches 8 run function gm4_augmented_armor:armor/augment/type/sparking/damage_dealt diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/damage_taken.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/damage_taken.mcfunction new file mode 100644 index 0000000000..7eb61567bb --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/damage_taken.mcfunction @@ -0,0 +1,19 @@ +# check the augment on the armor piece +# @s = player wearing modified armor +# at @s +# run from functions in armor/slot/ + +# store active information +execute store result score $active gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.active +execute store result score $augment gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.id + +# run based on augment id +execute if score $augment gm4_aa_data matches 2 if score @s gm4_aa_augment.dashing.timer matches 1.. run function gm4_augmented_armor:armor/augment/type/dashing/remove +execute if score $augment gm4_aa_data matches 3 run function gm4_augmented_armor:armor/augment/type/flighty/add +execute if score $augment gm4_aa_data matches 4 if score $active gm4_aa_data matches 1 if entity @s[advancements={gm4_survival_refightalized:damaged={combat_damage=true}}] run function gm4_augmented_armor:armor/augment/type/acrobatic/deactivate +execute if score $augment gm4_aa_data matches 8 run function gm4_augmented_armor:armor/augment/type/sparking/damage_taken +execute if score $augment gm4_aa_data matches 12 if score @s gm4_sr_stat.armor matches 1.. run function gm4_augmented_armor:armor/augment/type/plated/reduce_damage +execute if score $augment gm4_aa_data matches 13 if score @s gm4_sr_stat.armor matches 1.. run function gm4_augmented_armor:armor/augment/type/sturdy/reduce_damage +execute if score $augment gm4_aa_data matches 19 run function gm4_augmented_armor:armor/augment/type/rejuvenating/activate +execute if score $augment gm4_aa_data matches 22 run function gm4_augmented_armor:armor/augment/type/wild_magic/activate +execute if score $augment gm4_aa_data matches 23 run function gm4_augmented_armor:armor/augment/type/vorpal/schedule diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/acrobatic/activate.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/acrobatic/activate.mcfunction new file mode 100644 index 0000000000..180021e8e0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/acrobatic/activate.mcfunction @@ -0,0 +1,15 @@ +# activate the augments on the armor piece +# @s = player wearing the armor +# at unspecified +# run from functions in armor/augment/type/acrobatic/check + +# set fall damage reduction +# mark for change and set to active +scoreboard players set $change gm4_aa_data 1 +data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.active set value 1 + +# modify attribute +execute if score $slot gm4_aa_data matches 0 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic"}].amount float -0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[1] +execute if score $slot gm4_aa_data matches 1 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic"}].amount float -0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[1] +execute if score $slot gm4_aa_data matches 2 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic"}].amount float -0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[1] +execute if score $slot gm4_aa_data matches 3 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic"}].amount float -0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[1] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/acrobatic/check.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/acrobatic/check.mcfunction new file mode 100644 index 0000000000..ebc9142175 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/acrobatic/check.mcfunction @@ -0,0 +1,24 @@ +# check if armor should activate +# @s = player being checked +# at unspecified +# run from armor/augment/clocked + +# activate inactive armor if player is out of combat +execute unless score @s gm4_aa_in_combat matches 1.. if score $active gm4_aa_data matches 0 run function gm4_augmented_armor:armor/augment/type/acrobatic/activate + +# get immunities +# get levels +execute store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] + +# get effects to become immune to +execute if score $level gm4_aa_data matches 1 run tag @s add gm4_aa_effect_immunity.levitation +execute if score $level gm4_aa_data matches 2 run tag @s add gm4_aa_effect_immunity.slow_falling +execute if score $level gm4_aa_data matches 3 run tag @s add gm4_aa_effect_immunity.slowness + +# remove effects if they were present +execute if score $level gm4_aa_data matches 1 run effect clear @s levitation +execute if score $level gm4_aa_data matches 2 run effect clear @s slow_falling +execute if score $level gm4_aa_data matches 3 run effect clear @s slowness + +# tag for effect removal +tag @s add gm4_aa_effect_immunity.active diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/acrobatic/deactivate.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/acrobatic/deactivate.mcfunction new file mode 100644 index 0000000000..52d8cd73eb --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/acrobatic/deactivate.mcfunction @@ -0,0 +1,14 @@ +# deactivate the augments on the armor piece +# @s = player wearing the armor +# at unspecified +# run from functions in armor/augment/damage_taken + +# mark for change and set to inactive +scoreboard players set $change gm4_aa_data 1 +data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.active set value 0 + +# disable attribute +execute if score $slot gm4_aa_data matches 0 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic"}].amount set value 0 +execute if score $slot gm4_aa_data matches 1 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic"}].amount set value 0 +execute if score $slot gm4_aa_data matches 2 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic"}].amount set value 0 +execute if score $slot gm4_aa_data matches 3 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic"}].amount set value 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/archery/apply.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/archery/apply.mcfunction new file mode 100644 index 0000000000..277365471c --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/archery/apply.mcfunction @@ -0,0 +1,15 @@ +# activate armor effects +# @s = arrow shot by player wearing armor +# at @s +# run from armor/augment/type/archery/find_arrow + +tag @s add gm4_aa_archery_arrow + +data modify storage gm4_augmented_armor:temp archery_arrow set from entity @s {} + +# multishot support (spawns half as many arrows) +execute store result score $pickup gm4_aa_data run data get storage gm4_augmented_armor:temp archery_arrow.pickup +execute unless score $pickup gm4_aa_data matches 1..2 run scoreboard players operation $archery_arrow_target gm4_aa_data /= #2 gm4_aa_data + +function gm4_augmented_armor:armor/augment/type/archery/spawn_arrows +data remove storage gm4_augmented_armor:temp archery_arrow diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/archery/find_arrow.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/archery/find_arrow.mcfunction new file mode 100644 index 0000000000..65e059fe00 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/archery/find_arrow.mcfunction @@ -0,0 +1,39 @@ +# check the amount of arrows to spawn +# @s = player wearing archer armor shooting a (cross)bow +# at unspecified +# run from clocks/temp/archer + +# store armor for checking +item replace block 29999998 1 7134 container.0 from entity @s armor.head +item replace block 29999998 1 7134 container.1 from entity @s armor.chest +item replace block 29999998 1 7134 container.2 from entity @s armor.legs +item replace block 29999998 1 7134 container.3 from entity @s armor.feet +data modify storage gm4_augmented_armor:temp Items set from block 29999998 1 7134 Items +data remove block 29999998 1 7134 Items + +# check amount of archer pieces +# original target is set to -1 as the first arrow does not need to be counted +scoreboard players set $archery_arrow_target gm4_aa_data -1 + +scoreboard players set $add_archery_arrows gm4_aa_data 0 +execute if data storage gm4_augmented_armor:temp Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:archery}} store result score $add_archery_arrows gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor.levels[1] +scoreboard players operation $archery_arrow_target gm4_aa_data += $add_archery_arrows gm4_aa_data + +scoreboard players set $add_archery_arrows gm4_aa_data 0 +execute if data storage gm4_augmented_armor:temp Items[{Slot:1b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:archery}} store result score $add_archery_arrows gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:1b}].components."minecraft:custom_data".gm4_augmented_armor.levels[1] +scoreboard players operation $archery_arrow_target gm4_aa_data += $add_archery_arrows gm4_aa_data + +scoreboard players set $add_archery_arrows gm4_aa_data 0 +execute if data storage gm4_augmented_armor:temp Items[{Slot:2b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:archery}} store result score $add_archery_arrows gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:2b}].components."minecraft:custom_data".gm4_augmented_armor.levels[1] +scoreboard players operation $archery_arrow_target gm4_aa_data += $add_archery_arrows gm4_aa_data + +scoreboard players set $add_archery_arrows gm4_aa_data 0 +execute if data storage gm4_augmented_armor:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:archery}} store result score $add_archery_arrows gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor.levels[1] +scoreboard players operation $archery_arrow_target gm4_aa_data += $add_archery_arrows gm4_aa_data + +# spawn arrows +scoreboard players set $archery_arrow_fired gm4_aa_data 0 +execute as @n[type=#gm4_survival_refightalized:arrow,tag=gm4_sr_current_arrow] at @s run function gm4_augmented_armor:armor/augment/type/archery/apply + +# cleanup +data remove storage gm4_augmented_armor:temp Items diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/archery/init_arrow.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/archery/init_arrow.mcfunction new file mode 100644 index 0000000000..0394b2b4e9 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/archery/init_arrow.mcfunction @@ -0,0 +1,33 @@ +# set storm arrow data +# @s = storm arrow +# at unspecified +# run from armor/augment/type/archery/spawn_arrows + +# slightly adjust arrow motion +data modify storage gm4_augmented_armor:temp archery_arrow.Motion_adj set value [0.0d,0.0d,0.0d] + +execute store result score $mot_adjust gm4_aa_data run random value -48..48 +execute store result score $mot gm4_aa_data run data get storage gm4_augmented_armor:temp archery_arrow.Motion[0] 100 +execute store result storage gm4_augmented_armor:temp archery_arrow.Motion_adj[0] double 0.01 run scoreboard players operation $mot gm4_aa_data += $mot_adjust gm4_aa_data + +execute store result score $mot_adjust gm4_aa_data run random value -18..18 +execute store result score $mot gm4_aa_data run data get storage gm4_augmented_armor:temp archery_arrow.Motion[1] 100 +execute store result storage gm4_augmented_armor:temp archery_arrow.Motion_adj[1] double 0.01 run scoreboard players operation $mot gm4_aa_data += $mot_adjust gm4_aa_data + +execute store result score $mot_adjust gm4_aa_data run random value -48..48 +execute store result score $mot gm4_aa_data run data get storage gm4_augmented_armor:temp archery_arrow.Motion[2] 100 +execute store result storage gm4_augmented_armor:temp archery_arrow.Motion_adj[2] double 0.01 run scoreboard players operation $mot gm4_aa_data += $mot_adjust gm4_aa_data + +# use reduced damage +execute store result entity @s damage double 0.1 run scoreboard players get $arrow_damage gm4_sr_data + +# set arrow data +data modify entity @s Motion set from storage gm4_augmented_armor:temp archery_arrow.Motion_adj +data modify entity @s Rotation set from storage gm4_augmented_armor:temp archery_arrow.Rotation +data modify entity @s crit set from storage gm4_augmented_armor:temp archery_arrow.crit +data modify entity @s Fire set from storage gm4_augmented_armor:temp archery_arrow.Fire +data modify entity @s Owner set from storage gm4_augmented_armor:temp archery_arrow.Owner +data modify entity @s item.components set from storage gm4_augmented_armor:temp archery_arrow.item.components + +tag @s add gm4_aa_archery_arrow +tag @s add gm4_sr_arrow_checked diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/archery/spawn_arrows.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/archery/spawn_arrows.mcfunction new file mode 100644 index 0000000000..4ea74eab73 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/archery/spawn_arrows.mcfunction @@ -0,0 +1,12 @@ +# spawn the amount of arrows specified +# @s = arrow shot by player wearing armor +# at @s +# run from armor/augment/type/archery/apply +# run from here + +execute if entity @s[type=arrow] positioned ^ ^ ^ summon arrow run function gm4_augmented_armor:armor/augment/type/archery/init_arrow +execute if entity @s[type=spectral_arrow] positioned ^ ^ ^ summon spectral_arrow run function gm4_augmented_armor:armor/augment/type/archery/init_arrow + +scoreboard players add $archery_arrows_spawned gm4_aa_data 1 +execute if score $archery_arrows_spawned gm4_aa_data >= $archery_arrow_target gm4_aa_data run scoreboard players set $archery_arrows_spawned gm4_aa_data 0 +execute if score $archery_arrows_spawned gm4_aa_data matches 1.. run function gm4_augmented_armor:armor/augment/type/archery/spawn_arrows diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/berserkers/activate.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/berserkers/activate.mcfunction new file mode 100644 index 0000000000..64bcfcba0d --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/berserkers/activate.mcfunction @@ -0,0 +1,19 @@ +# activate the augments on the armor piece +# @s = player wearing the armor +# at unspecified +# run from armor/augment/type/berserk/check + +# mark for change and set to active +scoreboard players set $change gm4_aa_data 1 +data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.active set value 1 + +# modify attributes +execute if score $slot gm4_aa_data matches 0 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic"}].amount float 0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] +execute if score $slot gm4_aa_data matches 1 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic"}].amount float 0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] +execute if score $slot gm4_aa_data matches 2 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic"}].amount float 0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] +execute if score $slot gm4_aa_data matches 3 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic"}].amount float 0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] + +execute if score $slot gm4_aa_data matches 0 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic_2"}].amount float 0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[1] +execute if score $slot gm4_aa_data matches 1 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic_2"}].amount float 0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[1] +execute if score $slot gm4_aa_data matches 2 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic_2"}].amount float 0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[1] +execute if score $slot gm4_aa_data matches 3 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic_2"}].amount float 0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[1] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/berserkers/armor_break.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/berserkers/armor_break.mcfunction new file mode 100644 index 0000000000..0f507215d1 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/berserkers/armor_break.mcfunction @@ -0,0 +1,3 @@ + +# set timer so next clock cycle bonus will be doubled +scoreboard players set @s gm4_aa_augment.berserkers.timer 5 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/berserkers/check.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/berserkers/check.mcfunction new file mode 100644 index 0000000000..9b67c11db3 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/berserkers/check.mcfunction @@ -0,0 +1,12 @@ +# check if heal pulse is off cooldown +# @s = player wearing the armor +# at @s +# run from armor/check_augment/hp_check + +# if armor broke within last 4 seconds double stats and don't disable them +execute unless score $active gm4_aa_data matches 2 if score @s gm4_aa_augment.berserkers.timer matches 1.. run function gm4_augmented_armor:armor/augment/type/berserkers/double +execute if score @s gm4_aa_augment.berserkers.timer matches 1.. run return 0 + +# check player armor and (de)activate armor if needed +execute unless score $active gm4_aa_data matches 0 if score @s gm4_sr_stat.armor matches 1.. run function gm4_augmented_armor:armor/augment/type/berserkers/deactivate +execute unless score $active gm4_aa_data matches 1 unless score @s gm4_sr_stat.armor matches 1.. run function gm4_augmented_armor:armor/augment/type/berserkers/activate diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/berserkers/deactivate.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/berserkers/deactivate.mcfunction new file mode 100644 index 0000000000..b0c6419bea --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/berserkers/deactivate.mcfunction @@ -0,0 +1,19 @@ +# deactivate the augments on the armor piece +# @s = player wearing the armor +# at unspecified +# run from armor/augment/type/berserk/check + +# mark for change and set to inactive +scoreboard players set $change gm4_aa_data 1 +data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.active set value 0 + +# disable attributes +execute if score $slot gm4_aa_data matches 0 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic"}].amount set value 0 +execute if score $slot gm4_aa_data matches 1 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic"}].amount set value 0 +execute if score $slot gm4_aa_data matches 2 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic"}].amount set value 0 +execute if score $slot gm4_aa_data matches 3 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic"}].amount set value 0 + +execute if score $slot gm4_aa_data matches 0 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic_2"}].amount set value 0 +execute if score $slot gm4_aa_data matches 1 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic_2"}].amount set value 0 +execute if score $slot gm4_aa_data matches 2 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic_2"}].amount set value 0 +execute if score $slot gm4_aa_data matches 3 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic_2"}].amount set value 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/berserkers/double.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/berserkers/double.mcfunction new file mode 100644 index 0000000000..8ebba10434 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/berserkers/double.mcfunction @@ -0,0 +1,15 @@ + +# mark for change and set to active +scoreboard players set $change gm4_aa_data 1 +data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.active set value 2 + +# modify attributes +execute if score $slot gm4_aa_data matches 0 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic"}].amount float 0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] 2 +execute if score $slot gm4_aa_data matches 1 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic"}].amount float 0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] 2 +execute if score $slot gm4_aa_data matches 2 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic"}].amount float 0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] 2 +execute if score $slot gm4_aa_data matches 3 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic"}].amount float 0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] 2 + +execute if score $slot gm4_aa_data matches 0 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic_2"}].amount float 0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[1] 2 +execute if score $slot gm4_aa_data matches 1 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic_2"}].amount float 0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[1] 2 +execute if score $slot gm4_aa_data matches 2 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic_2"}].amount float 0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[1] 2 +execute if score $slot gm4_aa_data matches 3 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic_2"}].amount float 0.01 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[1] 2 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/bursting/add_levels.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/bursting/add_levels.mcfunction new file mode 100644 index 0000000000..1d335d32b0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/bursting/add_levels.mcfunction @@ -0,0 +1,43 @@ +# add absorption to player that got hit (red health hits only) +# @s = player wearing armor +# at @s +# run from armor/augment/damage_taken + +# store armor items to storage +item replace block 29999998 1 7134 container.0 from entity @s armor.head +item replace block 29999998 1 7134 container.1 from entity @s armor.chest +item replace block 29999998 1 7134 container.2 from entity @s armor.legs +item replace block 29999998 1 7134 container.3 from entity @s armor.feet +data modify storage gm4_augmented_armor:temp Items set from block 29999998 1 7134 Items +data remove block 29999998 1 7134 Items + +# playsound + +# add levels together +scoreboard players set $total_level gm4_aa_data 0 + +scoreboard players set $level gm4_aa_data 0 +execute if data storage gm4_augmented_armor:temp Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:bursting}} store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor.levels[0] +scoreboard players operation $total_level gm4_aa_data += $level gm4_aa_data + +scoreboard players set $level gm4_aa_data 0 +execute if data storage gm4_augmented_armor:temp Items[{Slot:1b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:bursting}} store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:1b}].components."minecraft:custom_data".gm4_augmented_armor.levels[0] +scoreboard players operation $total_level gm4_aa_data += $level gm4_aa_data + +scoreboard players set $level gm4_aa_data 0 +execute if data storage gm4_augmented_armor:temp Items[{Slot:2b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:bursting}} store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:2b}].components."minecraft:custom_data".gm4_augmented_armor.levels[0] +scoreboard players operation $total_level gm4_aa_data += $level gm4_aa_data + +scoreboard players set $level gm4_aa_data 0 +execute if data storage gm4_augmented_armor:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:bursting}} store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor.levels[0] +scoreboard players operation $total_level gm4_aa_data += $level gm4_aa_data + +# activate on all entities in range +tag @s add gm4_aa_augment_damager +execute store result storage gm4_augmented_armor:temp effect.range float 0.1 run attribute @s minecraft:entity_interaction_range get 10 +function gm4_augmented_armor:armor/augment/type/bursting/eval_explosion with storage gm4_augmented_armor:temp effect +data remove storage gm4_augmented_armor:temp effect +tag @s remove gm4_aa_augment_damager + +# cleanup +data remove storage gm4_augmented_armor:temp Items diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/bursting/apply.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/bursting/apply.mcfunction new file mode 100644 index 0000000000..557af6ff68 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/bursting/apply.mcfunction @@ -0,0 +1,3 @@ + +scoreboard players operation $freeze_seconds gm4_mu_data = $total_level gm4_aa_data +function gm4_monsters_unbound:effect/freeze/apply diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/bursting/eval_explosion.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/bursting/eval_explosion.mcfunction new file mode 100644 index 0000000000..5d77269643 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/bursting/eval_explosion.mcfunction @@ -0,0 +1,2 @@ + +$execute as @e[predicate=gm4_augmented_armor:technical/pvp_able,distance=..$(range),tag=!gm4_aa_augment_damager] run function gm4_augmented_armor:armor/augment/type/bursting/apply diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/check.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/check.mcfunction new file mode 100644 index 0000000000..b5f06bdc68 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/check.mcfunction @@ -0,0 +1,15 @@ +# check if the current canine armor piece has an existing matching wolf +# @s = player that has canine armor +# at unspecified +# run from armor/check_augment/equip + +# get armor slot and player id +execute store result score $slot gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.slot +scoreboard players operation $curr_id gm4_aa_id = @s gm4_aa_id + +# mark 1 matching wolf as checked +scoreboard players set $wolf gm4_aa_data 0 +execute as @e[type=wolf,tag=gm4_aa_wolf] if score @s gm4_aa_id = $curr_id gm4_aa_id if score @s gm4_aa_augment.canine.slot = $slot gm4_aa_data run function gm4_augmented_armor:armor/augment/type/canine/wolf_checked + +# summon new wolf if there is none +execute if score $wolf gm4_aa_data matches 0 at @s run function gm4_augmented_armor:armor/augment/type/canine/wolf_spawn diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/cooldown_tick.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/cooldown_tick.mcfunction new file mode 100644 index 0000000000..6043a4f229 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/cooldown_tick.mcfunction @@ -0,0 +1,3 @@ + +execute store result storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.cooldown int 1 run scoreboard players remove $cooldown gm4_aa_data 1 +scoreboard players set $change gm4_aa_data 1 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/set_cooldown.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/set_cooldown.mcfunction new file mode 100644 index 0000000000..c471a0cb25 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/set_cooldown.mcfunction @@ -0,0 +1,20 @@ + +# store correct armor item in storage +execute if score $slot gm4_aa_data matches 0 run item replace block 29999998 1 7134 container.0 from entity @s armor.head +execute if score $slot gm4_aa_data matches 1 run item replace block 29999998 1 7134 container.0 from entity @s armor.chest +execute if score $slot gm4_aa_data matches 2 run item replace block 29999998 1 7134 container.0 from entity @s armor.legs +execute if score $slot gm4_aa_data matches 3 run item replace block 29999998 1 7134 container.0 from entity @s armor.feet +data modify storage gm4_augmented_armor:temp components set from block 29999998 1 7134 Items[{Slot:0b}].components +data remove block 29999998 1 7134 Items + +# set cooldown of ~30 sec +data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.cooldown set value 38 + +# apply change +execute if score $slot gm4_aa_data matches 0 run function gm4_augmented_armor:item_modify_eval/head_update with storage gm4_augmented_armor:temp +execute if score $slot gm4_aa_data matches 1 run function gm4_augmented_armor:item_modify_eval/chest_update with storage gm4_augmented_armor:temp +execute if score $slot gm4_aa_data matches 2 run function gm4_augmented_armor:item_modify_eval/legs_update with storage gm4_augmented_armor:temp +execute if score $slot gm4_aa_data matches 3 run function gm4_augmented_armor:item_modify_eval/feet_update with storage gm4_augmented_armor:temp + +# cleanup +data remove storage gm4_augmented_armor:temp components diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/spawn_nametag.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/spawn_nametag.mcfunction new file mode 100644 index 0000000000..77d55f3de2 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/spawn_nametag.mcfunction @@ -0,0 +1,8 @@ +# remove armor from wolf +# @s = wolf that is waering armor +# at @s +# run from armor/type/canine/wolf_interact_check + +# spawn item with the data +summon item ~ ~ ~ {Tags:["gm4_aa_dropped_wolf_nametag"],Item:{id:"name_tag",count:1b}} +data modify entity @n[type=item,tag=gm4_aa_dropped_wolf_nametag,distance=..0.1] Item.components."minecraft:custom_name" set from storage gm4_augmented_armor:temp wolf.curr_name diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_checked.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_checked.mcfunction new file mode 100644 index 0000000000..ea453cadd1 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_checked.mcfunction @@ -0,0 +1,7 @@ +# mark wolf as having been checked, wolf will not despawn until next check +# @s = wolf that belonged to the armor piece +# at unspecified +# run from armor/type/canine/check + +execute if score $wolf gm4_aa_data matches 0 run scoreboard players set @s gm4_aa_augment.canine.timer 1 +scoreboard players set $wolf gm4_aa_data 1 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_died.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_died.mcfunction new file mode 100644 index 0000000000..bc00394545 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_died.mcfunction @@ -0,0 +1,23 @@ +# despawn wolves without matching armor pieces, if the matching player is online +# @s = wolf without corresponding armor piece +# at @s +# run from armor/type/canine/process + +# find matching armor and set a timer on it +scoreboard players operation $curr_id gm4_aa_id = @s gm4_aa_id +scoreboard players operation $slot gm4_aa_data = @s gm4_aa_augment.canine.slot + +execute as @a if score @s gm4_aa_id = $curr_id gm4_aa_id run function gm4_augmented_armor:armor/augment/type/canine/set_cooldown + +# set owner UUID to Notch to not display death message +data modify entity @s Owner set value [I;110787060,1156138790,-1514210135,238594805] + +# check if nametag should spawn +data modify storage gm4_augmented_armor:temp wolf.spawn_name set from entity @s ArmorItems[3].components."minecraft:custom_name" +data modify storage gm4_augmented_armor:temp wolf.curr_name set from entity @s CustomName +execute store success score $name_changed gm4_aa_data run data modify storage gm4_augmented_armor:temp wolf.spawn_name set from storage gm4_augmented_armor:temp wolf.curr_name +execute if score $name_changed gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/type/canine/spawn_nametag +data remove storage gm4_augmented_armor:temp wolf + +# remove wolf +kill @s diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_fed_power.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_fed_power.mcfunction new file mode 100644 index 0000000000..80cb8e50c2 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_fed_power.mcfunction @@ -0,0 +1,7 @@ +# give fed wolf +4 attack for 60 seconds +# @s = wolf that was fed +# at unspecified +# run from armor/type/canine/wolf_interact_check + +effect give @s strength 60 0 +data remove entity @s InLove diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_initiate.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_initiate.mcfunction new file mode 100644 index 0000000000..0569ec6ff0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_initiate.mcfunction @@ -0,0 +1,17 @@ +# match wolf to armor slot and player id +# @s = new wolf +# at unspecified +# run from armor/type/canine/wolf_spawn + +data merge entity @s {ArmorItems:[{},{},{},{id:"minecraft:stone",count:1}],Health:1000,CollarColor:0b,variant:"gm4_augmented_armor:gm4_aa_canine",Tags:["gm4_aa_wolf"],attributes:[{id:"minecraft:attack_damage",base:4},{id:"minecraft:scale",base:1.15},{id:"minecraft:max_health",base:1000}],ArmorDropChances:[0.085F,0.085F,0.085F,-327.670F]} + +scoreboard players operation @s gm4_aa_id = $curr_id gm4_aa_id +scoreboard players operation @s gm4_aa_augment.canine.slot = $slot gm4_aa_data +data modify entity @s Owner set from storage gm4_augmented_armor:temp uuid + +# if named Pistachio use the alt dog version, don't display name +execute if data storage gm4_augmented_armor:temp components{"minecraft:custom_name":'"Pistachio"'} run return run data merge entity @s {variant:"gm4_augmented_armor:gm4_aa_canine_alt",CollarColor:5b} + +# store name of armor in wolf name and on hidden stone block for later checks +data modify entity @s CustomName set from storage gm4_augmented_armor:temp components."minecraft:custom_name" +data modify entity @s ArmorItems[3].components."minecraft:custom_name" set from storage gm4_augmented_armor:temp components."minecraft:custom_name" diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_interact_check.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_interact_check.mcfunction new file mode 100644 index 0000000000..bc3a3e0ae1 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_interact_check.mcfunction @@ -0,0 +1,13 @@ +# check for interactions with canine wolves +# @s = player that interacted with a canine wolf +# at @s +advancement revoke @s only gm4_augmented_armor:augment/canine_interact + +# give power to wolves that were fed +execute as @e[type=wolf,tag=gm4_aa_wolf,nbt={InLove:600}] run function gm4_augmented_armor:armor/augment/type/canine/wolf_fed_power + +# check if wolves are wearing armor +execute as @e[type=wolf,tag=gm4_aa_wolf,nbt={body_armor_item:{}}] at @s run function gm4_augmented_armor:armor/augment/type/canine/wolf_remove_armor + +# check if wolves are sitting +execute as @e[type=wolf,tag=gm4_aa_wolf,nbt={Sitting:1b}] run function gm4_augmented_armor:armor/augment/type/canine/wolf_stand_up diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_kill.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_kill.mcfunction new file mode 100644 index 0000000000..25388899ad --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_kill.mcfunction @@ -0,0 +1,19 @@ +# despawn wolves without matching armor pieces, if the matching player is online +# @s = wolf without corresponding armor piece +# at @s +# run from armor/type/canine/process + +# set owner UUID to Notch to not display death message +data modify entity @s Owner set value [I;110787060,1156138790,-1514210135,238594805] + +# check if nametag should spawn +data modify storage gm4_augmented_armor:temp wolf.spawn_name set from entity @s ArmorItems[3].components."minecraft:custom_name" +data modify storage gm4_augmented_armor:temp wolf.curr_name set from entity @s CustomName +execute store success score $name_changed gm4_aa_data run data modify storage gm4_augmented_armor:temp wolf.spawn_name set from storage gm4_augmented_armor:temp wolf.curr_name +execute if score $name_changed gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/type/canine/spawn_nametag +data remove storage gm4_augmented_armor:temp wolf + +# remove wolf +particle minecraft:poof ~ ~0.25 ~ 0.2 0.2 0.2 0.1 4 +tp @s ~ -2050 ~ +kill @s diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_process.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_process.mcfunction new file mode 100644 index 0000000000..4c15232907 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_process.mcfunction @@ -0,0 +1,12 @@ +# check if wolf has matching armor equipped by player +# @s = wolf from canine armor +# at unspecified +# run from main + +# despawn wolf if it was not matched to armor this check +execute if score @s gm4_aa_augment.canine.timer matches 0 at @s run return run function gm4_augmented_armor:armor/augment/type/canine/wolf_kill +scoreboard players set @s gm4_aa_augment.canine.timer 0 + +# process health +execute store result score $health gm4_aa_data run data get entity @s Health +execute if score $health gm4_aa_data matches ..960 at @s run function gm4_augmented_armor:armor/augment/type/canine/wolf_died diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_remove_armor.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_remove_armor.mcfunction new file mode 100644 index 0000000000..c3235ec7af --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_remove_armor.mcfunction @@ -0,0 +1,11 @@ +# remove armor from wolf +# @s = wolf that is waering armor +# at @s +# run from armor/type/canine/wolf_interact_check + +# spawn item with the data +summon item ~ ~ ~ {Tags:["gm4_aa_dropped_wolf_armor"],Item:{id:"wolf_armor",count:1b}} +item replace entity @n[type=item,tag=gm4_aa_dropped_wolf_armor,distance=..1] contents from entity @s armor.body + +# remove armor from wolf +data remove entity @s body_armor_item diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_spawn.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_spawn.mcfunction new file mode 100644 index 0000000000..e88aede37e --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_spawn.mcfunction @@ -0,0 +1,23 @@ +# spawn wolf if there is none matching equipped armor +# @s = player to spawn the wolf +# at @s +# run from armor/type/canine/check + +# first check cooldown and just tick down if it is not done +execute store result score $cooldown gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.cooldown +execute if score $cooldown gm4_aa_data matches 1.. run return run function gm4_augmented_armor:armor/augment/type/canine/cooldown_tick + +# obtain player UUID +data modify storage gm4_augmented_armor:temp uuid set from entity @s UUID + +# BPR told me to add this ¯\_(ツ)_/¯ "stupid chunk loading stuff" +kill @e[type=wolf,tag=gm4_aa_new_wolf] +# spawn wolf +execute summon wolf run function gm4_augmented_armor:armor/augment/type/canine/wolf_initiate + +# playsound with cooldown +execute unless score @s gm4_aa_augment.canine.timer matches 1.. run playsound minecraft:entity.wolf.whine neutral @s ~ ~ ~ 0.6 0.8 +scoreboard players set @s gm4_aa_augment.canine.timer 1 + +# cleanup +data remove storage gm4_augmented_armor:temp uuid diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_stand_up.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_stand_up.mcfunction new file mode 100644 index 0000000000..9d58608d99 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/canine/wolf_stand_up.mcfunction @@ -0,0 +1,8 @@ +# let sitting canine wolves lose anger, then stand up +# @s = wolf that is sitting +# at unspecified +# run from armor/type/canine/wolf_interact_check + +data remove entity @s AngryAt +data modify entity @s AngerTime set value 0 +data modify entity @s Sitting set value 0b diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/dashing/apply.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/dashing/apply.mcfunction new file mode 100644 index 0000000000..82e0ab62d9 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/dashing/apply.mcfunction @@ -0,0 +1,39 @@ +# grant ramping move speed and hunger to sprinting player +# @s = player wearing dashing armour above 50% health and sprinting +# at unspecified +# run from armor/augment/clocked + +# advance sprinting timer (can advance by 1 for every dashing armor piece) if player is sprinting +scoreboard players add @s[scores={gm4_aa_stat.sprint_one_cm=1..}] gm4_aa_augment.dashing.timer 1 + +# mark this as a worn piece +scoreboard players add @s gm4_aa_augment.dashing.pieces_equipped 1 + +# give effect +execute if score @s gm4_aa_augment.dashing.timer matches 1..4 run effect give @s speed 2 0 +execute if score @s gm4_aa_augment.dashing.timer matches 1..4 run effect give @s[tag=!gm4_aa_effect_immunity.hunger] hunger 2 0 true + +execute if score @s gm4_aa_augment.dashing.timer matches 5..9 run effect give @s speed 2 1 +execute if score @s gm4_aa_augment.dashing.timer matches 5..9 run effect give @s[tag=!gm4_aa_effect_immunity.hunger] hunger 2 1 true + +execute if score @s gm4_aa_augment.dashing.timer matches 10..14 run effect give @s speed 2 2 +execute if score @s gm4_aa_augment.dashing.timer matches 10..14 run effect give @s[tag=!gm4_aa_effect_immunity.hunger] hunger 2 2 true + +execute if score @s gm4_aa_augment.dashing.timer matches 15..19 run effect give @s speed 2 3 +execute if score @s gm4_aa_augment.dashing.timer matches 15..19 run effect give @s[tag=!gm4_aa_effect_immunity.hunger] hunger 2 3 true + +execute if score @s gm4_aa_augment.dashing.timer matches 20.. run effect give @s speed 2 4 +execute if score @s gm4_aa_augment.dashing.timer matches 20.. run effect give @s[tag=!gm4_aa_effect_immunity.hunger] hunger 2 4 true + +execute if score @s[scores={gm4_aa_augment.dashing.pieces_equipped=2..}] gm4_aa_augment.dashing.timer matches 25.. run effect give @s speed 2 5 +execute if score @s[scores={gm4_aa_augment.dashing.pieces_equipped=2..}] gm4_aa_augment.dashing.timer matches 25.. run effect give @s[tag=!gm4_aa_effect_immunity.hunger] hunger 2 5 true + +execute if score @s[scores={gm4_aa_augment.dashing.pieces_equipped=3..}] gm4_aa_augment.dashing.timer matches 30.. run effect give @s speed 2 6 +execute if score @s[scores={gm4_aa_augment.dashing.pieces_equipped=3..}] gm4_aa_augment.dashing.timer matches 30.. run effect give @s[tag=!gm4_aa_effect_immunity.hunger] hunger 2 6 true + +execute if score @s[scores={gm4_aa_augment.dashing.pieces_equipped=4..}] gm4_aa_augment.dashing.timer matches 35.. run effect give @s speed 2 7 +execute if score @s[scores={gm4_aa_augment.dashing.pieces_equipped=4..}] gm4_aa_augment.dashing.timer matches 35.. run effect give @s[tag=!gm4_aa_effect_immunity.hunger] hunger 2 7 true + +# keep effect for a bit after you stop sprinting, refresh this timer when you sprint or swim +scoreboard players reset @s[scores={gm4_aa_stat.sprint_one_cm=1..}] gm4_aa_augment.dashing.timeout +scoreboard players reset @s[scores={gm4_aa_stat.swim_one_cm=1..}] gm4_aa_augment.dashing.timeout diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/dashing/remove.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/dashing/remove.mcfunction new file mode 100644 index 0000000000..34ef3e9667 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/dashing/remove.mcfunction @@ -0,0 +1,20 @@ + +# get speed effect data +data modify storage gm4_augmented_armor:temp active_effects set from entity @s active_effects +execute store result score $timer gm4_aa_data run data get storage gm4_augmented_armor:temp active_effect[{id:"minecraft:speed"}].duration +execute store result score $amplifier gm4_aa_data run data get storage gm4_augmented_armor:temp active_effect[{id:"minecraft:speed"}].amplifier +# only remove the speed effect if it should be removed +execute if score @s gm4_aa_augment.dashing.timer matches 1..4 unless score $amplifier gm4_aa_data matches 0 if score $timer gm4_aa_data matches ..40 run effect clear @s speed +execute if score @s gm4_aa_augment.dashing.timer matches 5..9 unless score $amplifier gm4_aa_data matches 1 if score $timer gm4_aa_data matches ..40 run effect clear @s speed +execute if score @s gm4_aa_augment.dashing.timer matches 10..14 unless score $amplifier gm4_aa_data matches 2 if score $timer gm4_aa_data matches ..40 run effect clear @s speed +execute if score @s gm4_aa_augment.dashing.timer matches 15..19 unless score $amplifier gm4_aa_data matches 3 if score $timer gm4_aa_data matches ..40 run effect clear @s speed +execute if score @s gm4_aa_augment.dashing.timer matches 20.. unless score $amplifier gm4_aa_data matches 4 if score $timer gm4_aa_data matches ..40 run effect clear @s speed +execute if score @s gm4_aa_augment.dashing.timer matches 25.. unless score $amplifier gm4_aa_data matches 5 if score $timer gm4_aa_data matches ..40 run effect clear @s speed +execute if score @s gm4_aa_augment.dashing.timer matches 30.. unless score $amplifier gm4_aa_data matches 6 if score $timer gm4_aa_data matches ..40 run effect clear @s speed +execute if score @s gm4_aa_augment.dashing.timer matches 35.. unless score $amplifier gm4_aa_data matches 7 if score $timer gm4_aa_data matches ..40 run effect clear @s speed + +# we let the hunger effect linger as it is less important + +# reset player scores, add a small delay before speed can be applied again +scoreboard players set @s gm4_aa_augment.dashing.timer -4 +scoreboard players reset @s gm4_aa_augment.dashing.pieces_equipped diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/equine/apply_effect.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/equine/apply_effect.mcfunction new file mode 100644 index 0000000000..15687cf513 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/equine/apply_effect.mcfunction @@ -0,0 +1,15 @@ +# give mount speed +# @s = vehicle that had speed stored +# at unspecified +# run from clocks/player_submain + +# give effect +effect give @s[scores={gm4_aa_augment.equine.speed_level=1}] speed 3 0 true +effect give @s[scores={gm4_aa_augment.equine.speed_level=2..3}] speed 3 1 true +effect give @s[scores={gm4_aa_augment.equine.speed_level=4..7}] speed 3 2 true +effect give @s[scores={gm4_aa_augment.equine.speed_level=8..15}] speed 3 3 true +effect give @s[scores={gm4_aa_augment.equine.speed_level=16..31}] speed 3 4 true +# in case of additional player a higher level can be reached +effect give @s[scores={gm4_aa_augment.equine.speed_level=32..}] speed 3 5 true + +scoreboard players reset @s gm4_aa_augment.equine.speed_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/equine/mount.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/equine/mount.mcfunction new file mode 100644 index 0000000000..5125c47919 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/equine/mount.mcfunction @@ -0,0 +1,16 @@ +# give mount speed and secondary effects +# @s = vehicle of player with armor +# at @s +# run from armor/check_augment/equip + +# store speed level, will be applied at the end +execute store result score $level_1 gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] +execute if score $level_1 gm4_aa_data matches 3 run scoreboard players set $level_1 gm4_aa_data 4 +scoreboard players operation @s gm4_aa_augment.equine.speed_level += $level_1 gm4_aa_data + +# apply secondary effects +execute store result score $level_2 gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[1] +execute if score $level_2 gm4_aa_data matches 1 run effect give @s resistance 3 1 true +execute if score $level_2 gm4_aa_data matches 2 run effect give @s jump_boost 3 1 true +execute if score $level_2 gm4_aa_data matches 3 run effect give @s fire_resistance 3 0 true +execute if score $level_2 gm4_aa_data matches 4 run effect give @s regeneration 3 0 true diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/flighty/add.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/flighty/add.mcfunction new file mode 100644 index 0000000000..59a8cfb9db --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/flighty/add.mcfunction @@ -0,0 +1,38 @@ + +scoreboard players set $change gm4_aa_data 1 + +# add 1 to stacks unless it is already 10 +execute store result score $stacks gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.stacks +execute unless score $stacks gm4_aa_data matches 10.. run scoreboard players add $stacks gm4_aa_data 1 +execute store result storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.stacks int 1 run scoreboard players get $stacks gm4_aa_data + +# set timer to 12 seconds in the future +execute store result score $timer gm4_aa_data run time query gametime +execute store result storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.timer int 1 run scoreboard players add $timer gm4_aa_data 240 + +# multiply level by amount of stacks +execute store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] +scoreboard players operation $level gm4_aa_data *= $stacks gm4_aa_data + +# modify attribute +execute if score $slot gm4_aa_data matches 0 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic"}].amount float 0.0001 run scoreboard players get $level gm4_aa_data +execute if score $slot gm4_aa_data matches 1 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic"}].amount float 0.0001 run scoreboard players get $level gm4_aa_data +execute if score $slot gm4_aa_data matches 2 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic"}].amount float 0.0001 run scoreboard players get $level gm4_aa_data +execute if score $slot gm4_aa_data matches 3 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic"}].amount float 0.0001 run scoreboard players get $level gm4_aa_data + +# use lib_lore to remove the old current bonus text +data modify storage gm4_lore:temp Source set from storage gm4_augmented_armor:temp components."minecraft:lore" +data modify storage gm4_lore:temp Target set value '{"color":"gray","fallback":"%s Augment:","italic":false,"translate":"item.gm4.augmented_armor.lore.augment","with":[{"fallback":"Flighty","translate":"item.gm4.augmented_armor.augment.flighty"}]}' +scoreboard players set $start gm4_lore 3 +function #gm4_lore:remove + +# use lib_lore to update the current bonus text +data modify storage gm4_lore:temp Target set value '{"color":"gray","fallback":"%s Augment:","italic":false,"translate":"item.gm4.augmented_armor.lore.augment","with":[{"fallback":"Flighty","translate":"item.gm4.augmented_armor.augment.flighty"}]}' +execute store result storage gm4_augmented_armor:temp stat.amount float 0.01 run scoreboard players get $level gm4_aa_data +function gm4_augmented_armor:armor/augment/type/flighty/eval_lore with storage gm4_augmented_armor:temp stat +data remove storage gm4_augmented_armor:temp stat.amount +scoreboard players set $start gm4_lore 3 +function #gm4_lore:insert + +# update +data modify storage gm4_augmented_armor:temp components."minecraft:lore" set from storage gm4_lore:temp Source diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/flighty/check.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/flighty/check.mcfunction new file mode 100644 index 0000000000..ed4ea901d0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/flighty/check.mcfunction @@ -0,0 +1,5 @@ + +execute store result score $timer gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.timer +execute if score $timer gm4_aa_data matches -1 run return 0 +execute store result score $gametime gm4_aa_data run time query gametime +execute if score $timer gm4_aa_data <= $gametime gm4_aa_data run function gm4_augmented_armor:armor/augment/type/flighty/remove diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/flighty/eval_lore.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/flighty/eval_lore.mcfunction new file mode 100644 index 0000000000..5b91771e8a --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/flighty/eval_lore.mcfunction @@ -0,0 +1,2 @@ + +$data modify storage gm4_lore:temp Input set value ['{"color":"dark_gray","fallback":"Currently %s","italic":true,"translate":"item.gm4.augmented_armor.lore.flighty_3","with":[{"color":"blue","italic":true,"translate":"attribute.modifier.equals.1","with":["$(amount)",{"translate":"attribute.name.movement_speed"}]}]}'] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/flighty/remove.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/flighty/remove.mcfunction new file mode 100644 index 0000000000..c7647e0c64 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/flighty/remove.mcfunction @@ -0,0 +1,29 @@ + +scoreboard players set $change gm4_aa_data 1 + +# modify attribute +execute if score $slot gm4_aa_data matches 0 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic"}].amount set value 0 +execute if score $slot gm4_aa_data matches 1 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic"}].amount set value 0 +execute if score $slot gm4_aa_data matches 2 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic"}].amount set value 0 +execute if score $slot gm4_aa_data matches 3 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic"}].amount set value 0 + +# set stacks to 0 +data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.stacks set value 0 + +# set timer so this is not checked again +data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.timer set value -1 + +# use lib_lore to remove the old current bonus text +data modify storage gm4_lore:temp Source set from storage gm4_augmented_armor:temp components."minecraft:lore" +data modify storage gm4_lore:temp Target set value '{"color":"gray","fallback":"%s Augment:","italic":false,"translate":"item.gm4.augmented_armor.lore.augment","with":[{"fallback":"Flighty","translate":"item.gm4.augmented_armor.augment.flighty"}]}' +scoreboard players set $start gm4_lore 3 +function #gm4_lore:remove + +# use lib_lore to update the current bonus text +data modify storage gm4_lore:temp Target set value '{"color":"gray","fallback":"%s Augment:","italic":false,"translate":"item.gm4.augmented_armor.lore.augment","with":[{"fallback":"Flighty","translate":"item.gm4.augmented_armor.augment.flighty"}]}' +data modify storage gm4_lore:temp Input set value ['{"color":"dark_gray","fallback":"Currently %s","italic":true,"translate":"item.gm4.augmented_armor.lore.flighty_3","with":[{"color":"blue","italic":true,"translate":"attribute.modifier.equals.1","with":["0",{"translate":"attribute.name.movement_speed"}]}]}'] +scoreboard players set $start gm4_lore 3 +function #gm4_lore:insert + +# update +data modify storage gm4_augmented_armor:temp components."minecraft:lore" set from storage gm4_lore:temp Source diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/gutsy/activate.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/gutsy/activate.mcfunction new file mode 100644 index 0000000000..9468c961db --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/gutsy/activate.mcfunction @@ -0,0 +1,17 @@ +# activate the augments on the armor piece +# @s = player wearing the armor +# at unspecified +# run from armor/augment/type/berserk/check + +# mark for change and set to active +scoreboard players set $change gm4_aa_data 1 +data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.active set value 1 + +# modify attributes +execute if score $slot gm4_aa_data matches 0 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic"}].amount float 0.1 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] 5 +execute if score $slot gm4_aa_data matches 1 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic"}].amount float 0.1 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] 5 +execute if score $slot gm4_aa_data matches 2 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic"}].amount float 0.1 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] 5 +execute if score $slot gm4_aa_data matches 3 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic"}].amount float 0.1 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] 5 + +# modify custom attribute +execute store result storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_damage.value int 1 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[1] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/gutsy/check.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/gutsy/check.mcfunction new file mode 100644 index 0000000000..0a8f072153 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/gutsy/check.mcfunction @@ -0,0 +1,8 @@ +# check if heal pulse is off cooldown +# @s = player wearing the armor +# at @s +# run from armor/check_augment/hp_check + +# check player armor and (de)activate armor if needed +execute if score $active gm4_aa_data matches 0 if predicate gm4_augmented_armor:technical/under_negative_effect run function gm4_augmented_armor:armor/augment/type/gutsy/activate +execute if score $active gm4_aa_data matches 1 unless predicate gm4_augmented_armor:technical/under_negative_effect run function gm4_augmented_armor:armor/augment/type/gutsy/deactivate diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/gutsy/deactivate.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/gutsy/deactivate.mcfunction new file mode 100644 index 0000000000..a29566efe1 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/gutsy/deactivate.mcfunction @@ -0,0 +1,17 @@ +# deactivate the augments on the armor piece +# @s = player wearing the armor +# at unspecified +# run from armor/augment/type/berserk/check + +# mark for change and set to inactive +scoreboard players set $change gm4_aa_data 1 +data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.active set value 0 + +# disable attributes +execute if score $slot gm4_aa_data matches 0 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic"}].amount set value 0 +execute if score $slot gm4_aa_data matches 1 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic"}].amount set value 0 +execute if score $slot gm4_aa_data matches 2 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic"}].amount set value 0 +execute if score $slot gm4_aa_data matches 3 run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic"}].amount set value 0 + +# modify custom attribute +data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_damage.value set value 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/hearty/calc_conversion.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/hearty/calc_conversion.mcfunction new file mode 100644 index 0000000000..864f9b3a01 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/hearty/calc_conversion.mcfunction @@ -0,0 +1,31 @@ +# calculate how much armor this piece gives +# @s = player wearing hearty armor +# at @s +# run from armor/augment/type/hearty/update + +# calc total armor this piece is giving +scoreboard players set $armor_total gm4_aa_data 0 +data modify storage gm4_augmented_armor:temp attribute_modifiers set from storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers +function gm4_augmented_armor:armor/augment/type/hearty/loop_attribute_modifiers +data remove storage gm4_augmented_armor:temp check_modifier + +# if value is 0 no need to change it +execute if score $armor_total gm4_aa_data matches 0 run return 0 + +# get current armor negation +execute if score $slot gm4_aa_data matches 0 store result score $armor_negation gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic_2"}].amount -1 +execute if score $slot gm4_aa_data matches 1 store result score $armor_negation gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic_2"}].amount -1 +execute if score $slot gm4_aa_data matches 2 store result score $armor_negation gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic_2"}].amount -1 +execute if score $slot gm4_aa_data matches 3 store result score $armor_negation gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic_2"}].amount -1 + +# modify to give 0 armor and convert it to health +scoreboard players set $change gm4_aa_data 1 +scoreboard players operation $armor_negation gm4_aa_data += $armor_total gm4_aa_data +execute if score $slot gm4_aa_data matches 0 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic_2"}].amount int -1 run scoreboard players get $armor_negation gm4_aa_data +execute if score $slot gm4_aa_data matches 1 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic_2"}].amount int -1 run scoreboard players get $armor_negation gm4_aa_data +execute if score $slot gm4_aa_data matches 2 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic_2"}].amount int -1 run scoreboard players get $armor_negation gm4_aa_data +execute if score $slot gm4_aa_data matches 3 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic_2"}].amount int -1 run scoreboard players get $armor_negation gm4_aa_data +execute if score $slot gm4_aa_data matches 0 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic"}].amount int 1 run scoreboard players get $armor_negation gm4_aa_data +execute if score $slot gm4_aa_data matches 1 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic"}].amount int 1 run scoreboard players get $armor_negation gm4_aa_data +execute if score $slot gm4_aa_data matches 2 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic"}].amount int 1 run scoreboard players get $armor_negation gm4_aa_data +execute if score $slot gm4_aa_data matches 3 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic"}].amount int 1 run scoreboard players get $armor_negation gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/hearty/loop_attribute_modifiers.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/hearty/loop_attribute_modifiers.mcfunction new file mode 100644 index 0000000000..f76b8788f0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/hearty/loop_attribute_modifiers.mcfunction @@ -0,0 +1,14 @@ +# loop over armor modifiers to add together armor values +# @s = player wearing hearty armor +# at @s +# run from armor/augment/type/hearty/calc_conversion +# run from here + +# check augment to see armor it grants +data modify storage gm4_augmented_armor:temp check_modifier set from storage gm4_augmented_armor:temp attribute_modifiers[0] +execute store result score $armor_add gm4_aa_data run data get storage gm4_augmented_armor:temp check_modifier{type:"minecraft:armor"}.amount +scoreboard players operation $armor_total gm4_aa_data += $armor_add gm4_aa_data + +# loop over all modifiers +data remove storage gm4_augmented_armor:temp attribute_modifiers[0] +execute if data storage gm4_augmented_armor:temp attribute_modifiers[0] run function gm4_augmented_armor:armor/augment/type/hearty/loop_attribute_modifiers diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/hearty/update.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/hearty/update.mcfunction new file mode 100644 index 0000000000..04f33f22ad --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/hearty/update.mcfunction @@ -0,0 +1,50 @@ +# update hearty armor +# @s = player wearing hearty armor +# at @s +# run from advancement augment/wear_hearty + +# store armor for checking +item replace block 29999998 1 7134 container.0 from entity @s armor.head +item replace block 29999998 1 7134 container.1 from entity @s armor.chest +item replace block 29999998 1 7134 container.2 from entity @s armor.legs +item replace block 29999998 1 7134 container.3 from entity @s armor.feet +data modify storage gm4_augmented_armor:temp Items set from block 29999998 1 7134 Items +data remove block 29999998 1 7134 Items + +# head +scoreboard players set $change gm4_aa_data 0 +data modify storage gm4_augmented_armor:temp components set from storage gm4_augmented_armor:temp Items[{Slot:0b}].components +scoreboard players set $slot gm4_aa_data 0 +execute if data storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor{augment:{name:hearty}} run function gm4_augmented_armor:armor/augment/type/hearty/calc_conversion +execute if score $change gm4_aa_data matches 1 run function gm4_augmented_armor:item_modify_eval/head_update with storage gm4_augmented_armor:temp +data remove storage gm4_augmented_armor:temp components + +# chest +scoreboard players set $change gm4_aa_data 0 +data modify storage gm4_augmented_armor:temp components set from storage gm4_augmented_armor:temp Items[{Slot:1b}].components +scoreboard players set $slot gm4_aa_data 1 +execute if data storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor{augment:{name:hearty}} run function gm4_augmented_armor:armor/augment/type/hearty/calc_conversion +execute if score $change gm4_aa_data matches 1 run function gm4_augmented_armor:item_modify_eval/chest_update with storage gm4_augmented_armor:temp +data remove storage gm4_augmented_armor:temp components + +# legs +scoreboard players set $change gm4_aa_data 0 +data modify storage gm4_augmented_armor:temp components set from storage gm4_augmented_armor:temp Items[{Slot:2b}].components +scoreboard players set $slot gm4_aa_data 2 +execute if data storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor{augment:{name:hearty}} run function gm4_augmented_armor:armor/augment/type/hearty/calc_conversion +execute if score $change gm4_aa_data matches 1 run function gm4_augmented_armor:item_modify_eval/legs_update with storage gm4_augmented_armor:temp +data remove storage gm4_augmented_armor:temp components + +# feet +scoreboard players set $change gm4_aa_data 0 +data modify storage gm4_augmented_armor:temp components set from storage gm4_augmented_armor:temp Items[{Slot:3b}].components +scoreboard players set $slot gm4_aa_data 3 +execute if data storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor{augment:{name:hearty}} run function gm4_augmented_armor:armor/augment/type/hearty/calc_conversion +execute if score $change gm4_aa_data matches 1 run function gm4_augmented_armor:item_modify_eval/feet_update with storage gm4_augmented_armor:temp +data remove storage gm4_augmented_armor:temp components + +# revoke advancement at the end to not trigger from changes made +advancement revoke @s only gm4_augmented_armor:augment/hearty_wear + +# cleanup +data remove storage gm4_augmented_armor:temp Items diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/check.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/check.mcfunction new file mode 100644 index 0000000000..191f174139 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/check.mcfunction @@ -0,0 +1,52 @@ +# activate link for this player +# @s = player wearing link armor +# at @s +# run from armor/augment/clocked + +# first ensure this player is actually alive, otherwise do not allow them into the link +function gm4_survival_refightalized:player/health/calculate_hp +execute unless score @s gm4_sr_stat.current_health matches 1.. run return 0 + +# check if armor has been given a new custom name +data modify storage gm4_augmented_armor:temp check_rename set from storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.stored_name +execute store success score $renamed gm4_aa_data run data modify storage gm4_augmented_armor:temp check_rename set from storage gm4_augmented_armor:temp components."minecraft:custom_name" +# if it has format it +execute if score $renamed gm4_aa_data matches 1 run data modify storage gm4_augmented_armor:temp format_name_args.name set from storage gm4_augmented_armor:temp components."minecraft:custom_name" +execute if score $renamed gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/type/linked/format_name with storage gm4_augmented_armor:temp format_name_args + +# if player is already in a link from a previous link piece skip this +execute if score @s gm4_aa_augment.link.id matches 1.. if score $slot gm4_aa_data matches 0 store success score $change gm4_aa_data run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic"}].amount set value 0 +execute if score @s gm4_aa_augment.link.id matches 1.. if score $slot gm4_aa_data matches 1 store success score $change gm4_aa_data run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic"}].amount set value 0 +execute if score @s gm4_aa_augment.link.id matches 1.. if score $slot gm4_aa_data matches 2 store success score $change gm4_aa_data run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic"}].amount set value 0 +execute if score @s gm4_aa_augment.link.id matches 1.. if score $slot gm4_aa_data matches 3 store success score $change gm4_aa_data run data modify storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic"}].amount set value 0 +execute if score @s gm4_aa_augment.link.id matches 1.. run return 0 + +# loop through links to find the one this player belongs to +scoreboard players set @s gm4_aa_augment.link.id 0 +scoreboard players set $wrong_link gm4_aa_data 1 +data modify storage gm4_augmented_armor:temp search_links.list set from storage gm4_augmented_armor:data active_links +data modify storage gm4_augmented_armor:temp search_links.find_name set from storage gm4_augmented_armor:temp components."minecraft:custom_name" +function gm4_augmented_armor:armor/augment/type/linked/search_links +execute if score $wrong_link gm4_aa_data matches 0 store result score @s gm4_aa_augment.link.id run data get storage gm4_augmented_armor:temp search_links.list[0].id +data remove storage gm4_augmented_armor:temp search_links + +# if an id was found no need to put a new entry in storage +execute if score @s gm4_aa_augment.link.id matches 0 run function gm4_augmented_armor:armor/augment/type/linked/create_link + +# tag player as wearing this armor +tag @s[gamemode=!creative] add gm4_aa_linked + +# get max health of this player -max health change from linked piece +function gm4_survival_refightalized:player/health/calculate_hp +execute if score $slot gm4_aa_data matches 0 store result score @s gm4_aa_augment.link.max_health run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic"}].amount -1 +execute if score $slot gm4_aa_data matches 1 store result score @s gm4_aa_augment.link.max_health run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic"}].amount -1 +execute if score $slot gm4_aa_data matches 2 store result score @s gm4_aa_augment.link.max_health run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic"}].amount -1 +execute if score $slot gm4_aa_data matches 3 store result score @s gm4_aa_augment.link.max_health run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic"}].amount -1 +scoreboard players operation @s gm4_aa_augment.link.max_health += @s gm4_sr_stat.max_health + +# store slot this players linked armor is in +execute store result score $slot gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.slot +scoreboard players operation @s gm4_aa_augment.link.slot = $slot gm4_aa_data + +# start clock +execute unless score $keep_tick.link gm4_aa_keep_tick matches 1 run schedule function gm4_augmented_armor:clocks/temp/linked 1t diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/create_link.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/create_link.mcfunction new file mode 100644 index 0000000000..75a0f358a1 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/create_link.mcfunction @@ -0,0 +1,15 @@ +# find link this armor belongs to or make a new one +# @s = player wearing link armor +# at @s +# run from armor/augment/type/link/check + +# put the new link into storage +data modify storage gm4_augmented_armor:temp new_link set value {id:0,health:1,max_health:20,name:null} +data modify storage gm4_augmented_armor:temp new_link.name set from storage gm4_augmented_armor:temp components."minecraft:custom_name" +execute store result storage gm4_augmented_armor:temp new_link.id int 1 run scoreboard players add $latest_id gm4_aa_augment.link.id 1 +execute store result storage gm4_augmented_armor:temp new_link.health int 1 run scoreboard players get @s gm4_sr_stat.current_health +data modify storage gm4_augmented_armor:data active_links append from storage gm4_augmented_armor:temp new_link +data remove storage gm4_augmented_armor:temp new_link + +# set player link id to this link +scoreboard players operation @s gm4_aa_augment.link.id = $latest_id gm4_aa_augment.link.id diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/format_name.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/format_name.mcfunction new file mode 100644 index 0000000000..71e0b1b1c3 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/format_name.mcfunction @@ -0,0 +1,28 @@ +# format the link name to be purple and non-italic +# @s = player wearing link armor +# at @s +# run from armor/augment/type/linked/check + +scoreboard players set $change gm4_aa_data 1 + +# replace the name with a formatted version +$data modify storage gm4_augmented_armor:temp components."minecraft:custom_name" set value '{"color":"light_purple","italic":false,"text":$(name)}' +data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.stored_name set from storage gm4_augmented_armor:temp components."minecraft:custom_name" + +# use lib_lore to remove the linked text +data modify storage gm4_lore:temp Source set from storage gm4_augmented_armor:temp components."minecraft:lore" +data modify storage gm4_lore:temp Target set value '{"color":"gray","fallback":"%s Augment:","italic":false,"translate":"item.gm4.augmented_armor.lore.augment","with":[{"fallback":"Linked","translate":"item.gm4.augmented_armor.augment.linked"}]}' +scoreboard players set $start gm4_lore 3 +function #gm4_lore:remove + +# use lib_lore to update the linked text +data modify storage gm4_lore:temp Target set value '{"color":"gray","fallback":"%s Augment:","italic":false,"translate":"item.gm4.augmented_armor.lore.augment","with":[{"fallback":"Linked","translate":"item.gm4.augmented_armor.augment.linked"}]}' +$data modify storage gm4_lore:temp Input set value ['{"color":"dark_gray","fallback":"Link: %s","italic":true,"translate":"item.gm4.augmented_armor.lore.linked_3","with":[{"color":"blue","italic":true,"text":$(name)}]}'] +scoreboard players set $start gm4_lore 3 +function #gm4_lore:insert + +# update +data modify storage gm4_augmented_armor:temp components."minecraft:lore" set from storage gm4_lore:temp Source + +# cleanup +data remove storage gm4_augmented_armor:temp format_name_args diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/calc_health_change.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/calc_health_change.mcfunction new file mode 100644 index 0000000000..428031806b --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/calc_health_change.mcfunction @@ -0,0 +1,9 @@ +# calculate link health change from this player +# @s = player in this link +# at unspecified +# run from armor/augment/type/linked/process/process_link + +# assume health last tick was link health, see how it changed and apply to link_health +scoreboard players operation $damage_health gm4_aa_data = @s gm4_sr_stat.current_health +scoreboard players operation $damage_health gm4_aa_data -= $link_health_start gm4_aa_data +scoreboard players operation $link_health gm4_aa_data += $damage_health gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/calc_max_health.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/calc_max_health.mcfunction new file mode 100644 index 0000000000..296ecd4b4f --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/calc_max_health.mcfunction @@ -0,0 +1,8 @@ + +# calculate average max health between all players in this link +scoreboard players set $link_max_health gm4_aa_data 0 +execute as @a[tag=gm4_aa_link.process] run scoreboard players operation $link_max_health gm4_aa_data += @s gm4_aa_augment.link.max_health +execute store result storage gm4_augmented_armor:temp run_links[0].max_health int 1 run scoreboard players operation $link_max_health gm4_aa_data /= $link_players gm4_aa_data + +# translate this health to players +execute as @a[tag=gm4_aa_link.process] run function gm4_augmented_armor:armor/augment/type/linked/process/calc_max_health_change diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/calc_max_health_change.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/calc_max_health_change.mcfunction new file mode 100644 index 0000000000..7952e2b859 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/calc_max_health_change.mcfunction @@ -0,0 +1,5 @@ + +# set health on linked piece to get player max health to average in link +scoreboard players operation $set_max_health gm4_aa_data = $link_max_health gm4_aa_data +scoreboard players operation $set_max_health gm4_aa_data -= @s gm4_aa_augment.link.max_health +function gm4_augmented_armor:armor/augment/type/linked/process/set_max_health diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/death.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/death.mcfunction new file mode 100644 index 0000000000..d89a20e192 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/death.mcfunction @@ -0,0 +1,16 @@ +# process a link that has run out of health +# @s = unspecified +# at unspecified +# run from armor/augment/type/linked/process/process_link + +# check which players were killed and which followed them to their death +execute store result score $killed_player_count gm4_aa_data run tag @a[tag=gm4_aa_link.process,scores={gm4_sr_stat.current_health=..0}] add gm4_aa_link.killed +execute if score $killed_player_count gm4_aa_data matches 2.. run tag @r[tag=gm4_aa_link.killed] add gm4_aa_link.killed_2 + +execute as @a[tag=gm4_aa_link.process,tag=!gm4_aa_link.killed] run function gm4_augmented_armor:armor/augment/type/linked/process/death_message + +# remove tags as processing is done +tag @a[tag=gm4_aa_link.process] remove gm4_aa_linked +tag @a remove gm4_aa_link.process +tag @a remove gm4_aa_link.killed +tag @a remove gm4_aa_link.killed_2 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/death_message.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/death_message.mcfunction new file mode 100644 index 0000000000..fcdb4f2b29 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/death_message.mcfunction @@ -0,0 +1,15 @@ +# kill player in dead link +# @s = player in link to kill +# at unspecified +# run from armor/augment/type/linked/process/death + + +# display custom death message if death messages are on +execute store result score $death_messages gm4_aa_data run gamerule showDeathMessages +gamerule showDeathMessages false +execute if score $death_messages gm4_aa_data matches 1 if score $killed_player_count gm4_aa_data matches 0 at @s run tellraw @a {"translate":"death.gm4.augmented_armor.link_0","fallback":"%s followed eachother to their death","with":[{"selector":"@a[tag=gm4_aa_link.process]"}]} +execute if score $death_messages gm4_aa_data matches 1 if score $killed_player_count gm4_aa_data matches 1 at @s run tellraw @a {"translate":"death.gm4.augmented_armor.link_1","fallback":"%s followed %s to their death","with":[{"selector":"@s"},{"selector":"@p[tag=gm4_aa_link.killed]"}]} +execute if score $death_messages gm4_aa_data matches 1 if score $killed_player_count gm4_aa_data matches 2.. at @s run tellraw @a {"translate":"death.gm4.augmented_armor.link_2+","fallback":"%s followed %s and %s to their deaths","with":[{"selector":"@s"},{"selector":"@a[tag=gm4_aa_link.killed,tag=!gm4_aa_link.killed_2]"},{"selector":"@a[tag=gm4_aa_link.killed_2]"}]} +execute if score $killed_player_count gm4_aa_data matches 0 run scoreboard players set $killed_player_count gm4_aa_data -1 +kill @s +execute if score $death_messages gm4_aa_data matches 1 run gamerule showDeathMessages true diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/loop_links.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/loop_links.mcfunction new file mode 100644 index 0000000000..3fa94d675c --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/loop_links.mcfunction @@ -0,0 +1,17 @@ +# loop through links +# @s = unspecified +# at unspecified +# run from clocks/temp/linked + +# grab id of this link +execute store result score $link_id gm4_aa_augment.link.id run data get storage gm4_augmented_armor:temp run_links[0].id + +# look for players in this link +execute as @a[tag=gm4_aa_linked,gamemode=!spectator,gamemode=!creative] if score @s gm4_aa_augment.link.id = $link_id gm4_aa_augment.link.id run tag @s add gm4_aa_link.process +execute store result score $link_players gm4_aa_data if entity @a[tag=gm4_aa_link.process] +execute if score $link_players gm4_aa_data matches 1 as @p[tag=gm4_aa_link.process] run function gm4_augmented_armor:armor/augment/type/linked/process/one_player_link +execute if score $link_players gm4_aa_data matches 2.. run function gm4_augmented_armor:armor/augment/type/linked/process/process_link + +# check for more links +data remove storage gm4_augmented_armor:temp run_links[0] +execute if data storage gm4_augmented_armor:temp run_links[0] run function gm4_augmented_armor:armor/augment/type/linked/process/loop_links diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/one_player_link.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/one_player_link.mcfunction new file mode 100644 index 0000000000..493005fcab --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/one_player_link.mcfunction @@ -0,0 +1,18 @@ +# process a link with 1 player +# @s = unspecified +# at unspecified +# run from armor/augment/type/linked/process/loop_links + +scoreboard players set $keep_tick.link gm4_aa_keep_tick 1 + +# set link health to this player health +execute store result storage gm4_augmented_armor:temp run_links[0].health int 1 run scoreboard players get @s gm4_sr_stat.current_health + +scoreboard players set $set_max_health gm4_aa_data 0 +execute if score $link.calc_max_health gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/type/linked/process/set_max_health + +# remove tag +tag @s remove gm4_aa_link.process + +# add this link back to storage to keep it for next tick +data modify storage gm4_augmented_armor:temp rebuild_links append from storage gm4_augmented_armor:temp run_links[0] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/process_link.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/process_link.mcfunction new file mode 100644 index 0000000000..82e4197424 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/process_link.mcfunction @@ -0,0 +1,34 @@ +# process a link with 2+ players +# @s = unspecified +# at unspecified +# run from armor/augment/type/linked/process/loop_links + +scoreboard players set $keep_tick.link gm4_aa_keep_tick 1 + +# grab link health from last tick +execute store result score $link_health gm4_aa_data run data get storage gm4_augmented_armor:temp run_links[0].health + +# get average max health of all players in this link once per 16t +execute if score $link.calc_max_health gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/type/linked/process/calc_max_health +execute if score $link.calc_max_health gm4_aa_data matches 0 store result score $link_max_health gm4_aa_data run data get storage gm4_augmented_armor:temp run_links[0].max_health + +# all player already in this link modify link health by their health change since last tick +scoreboard players operation $link_health_start gm4_aa_data = $link_health gm4_aa_data +execute as @a[tag=gm4_aa_link.process,tag=gm4_aa_was_linked] run function gm4_augmented_armor:armor/augment/type/linked/process/calc_health_change + +# make sure link health does not exceed any link max health +scoreboard players operation $link_health gm4_aa_data < $link_max_health gm4_aa_data + +# any new player will keep the link health below theirs so link never heals a player +execute as @a[tag=gm4_aa_link.process,tag=!gm4_aa_was_linked] run scoreboard players operation $link_health gm4_aa_data < @s gm4_sr_stat.current_health +tag @a[tag=gm4_aa_link.process,tag=!gm4_aa_was_linked] add gm4_aa_was_linked + +# process health set or death +execute if score $link_health gm4_aa_data matches 1.. as @a[tag=gm4_aa_link.process] run function gm4_augmented_armor:armor/augment/type/linked/process/set_health +execute unless score $link_health gm4_aa_data matches 1.. run function gm4_augmented_armor:armor/augment/type/linked/process/death + +# store the new health total in storage, make sure there is at least some health in case new players join +execute store result storage gm4_augmented_armor:temp run_links[0].health int 1 run scoreboard players operation $link_health gm4_aa_data > #1 gm4_aa_data + +# add this link back to storage to keep it for next tick +data modify storage gm4_augmented_armor:temp rebuild_links append from storage gm4_augmented_armor:temp run_links[0] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/set_health.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/set_health.mcfunction new file mode 100644 index 0000000000..9d6f5787de --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/set_health.mcfunction @@ -0,0 +1,22 @@ +# set player to link health +# @s = player in this link +# at unspecified +# run from armor/augment/type/linked/process/process_link + +# remove tag as processing is done +tag @s remove gm4_aa_link.process + +# calculate how health needs to change for this link +scoreboard players operation $damage_health gm4_aa_data = @s gm4_sr_stat.current_health +scoreboard players operation $damage_health gm4_aa_data -= $link_health gm4_aa_data +scoreboard players operation @s gm4_sr_health.restoration -= $damage_health gm4_aa_data + +# pause regen next tick if damaged +tag @s[scores={gm4_sr_health.restoration=..-1}] add gm4_aa_pause_nat_regen + +# change player health +execute if score @s gm4_sr_health.restoration matches 1.. run function gm4_augmented_armor:player/heal/heal_calc +execute if score @s gm4_sr_health.restoration matches ..-1 run function gm4_augmented_armor:player/damage/activate + +# cleanup +scoreboard players reset @s gm4_sr_health.restoration diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/set_max_health.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/set_max_health.mcfunction new file mode 100644 index 0000000000..d206b2ed33 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/process/set_max_health.mcfunction @@ -0,0 +1,28 @@ +# process a link with 1 player +# @s = unspecified +# at unspecified +# run from armor/augment/type/linked/process/one_player_link + +# grab item data from linked armor piece +execute if score @s gm4_aa_augment.link.slot matches 0 run item replace block 29999998 1 7134 container.0 from entity @s armor.head +execute if score @s gm4_aa_augment.link.slot matches 1 run item replace block 29999998 1 7134 container.0 from entity @s armor.chest +execute if score @s gm4_aa_augment.link.slot matches 2 run item replace block 29999998 1 7134 container.0 from entity @s armor.legs +execute if score @s gm4_aa_augment.link.slot matches 3 run item replace block 29999998 1 7134 container.0 from entity @s armor.feet +data modify storage gm4_augmented_armor:temp components set from block 29999998 1 7134 Items[{Slot:0b}].components +data remove block 29999998 1 7134 Items + +# set max health to calculated value +execute if score @s gm4_aa_augment.link.slot matches 0 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:head.dynamic"}].amount int 1 run scoreboard players get $set_max_health gm4_aa_data +execute if score @s gm4_aa_augment.link.slot matches 1 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:chest.dynamic"}].amount int 1 run scoreboard players get $set_max_health gm4_aa_data +execute if score @s gm4_aa_augment.link.slot matches 2 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:legs.dynamic"}].amount int 1 run scoreboard players get $set_max_health gm4_aa_data +execute if score @s gm4_aa_augment.link.slot matches 3 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:feet.dynamic"}].amount int 1 run scoreboard players get $set_max_health gm4_aa_data + +# update linked armor piece +execute if score @s gm4_aa_augment.link.slot matches 0 run function gm4_augmented_armor:item_modify_eval/head_update with storage gm4_augmented_armor:temp +execute if score @s gm4_aa_augment.link.slot matches 1 run function gm4_augmented_armor:item_modify_eval/chest_update with storage gm4_augmented_armor:temp +execute if score @s gm4_aa_augment.link.slot matches 2 run function gm4_augmented_armor:item_modify_eval/legs_update with storage gm4_augmented_armor:temp +execute if score @s gm4_aa_augment.link.slot matches 3 run function gm4_augmented_armor:item_modify_eval/feet_update with storage gm4_augmented_armor:temp +function gm4_augmented_armor:armor/silence_equip_sound + +# cleanup +data remove storage gm4_augmented_armor:temp components diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/search_links.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/search_links.mcfunction new file mode 100644 index 0000000000..0e3bc29edc --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/linked/search_links.mcfunction @@ -0,0 +1,16 @@ +# search links for the one this player belongs to +# @s = player wearing link armor +# at @s +# run from armor/augment/type/linked/check +# run from here + +# check first link in list to see if name matches +data modify storage gm4_augmented_armor:temp search_links.check_name set from storage gm4_augmented_armor:temp search_links.list[0].name +execute store success score $wrong_link gm4_aa_data run data modify storage gm4_augmented_armor:temp search_links.check_name set from storage gm4_augmented_armor:temp search_links.find_name + +# if link was found return +execute if score $wrong_link gm4_aa_data matches 0 run return 1 + +# if link was not found check next link in list +data remove storage gm4_augmented_armor:temp search_links.list[0] +execute if data storage gm4_augmented_armor:temp search_links.list[0] run function gm4_augmented_armor:armor/augment/type/linked/search_links diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/plated/reduce_damage.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/plated/reduce_damage.mcfunction new file mode 100644 index 0000000000..11f14fa281 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/plated/reduce_damage.mcfunction @@ -0,0 +1,14 @@ +# add absorption to player that got hit (red health hits only) +# @s = player wearing armor +# at @s +# run from armor/augment/damage_taken + +# get level x5 for reduction +execute store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] 5 + +# reduce damage down to a min of 1 (x10) +scoreboard players operation $damage_total gm4_sr_data -= $level gm4_aa_data +scoreboard players operation $damage_total gm4_sr_data > #10 gm4_aa_data + +# dev damage log +tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":"Plated Augment: ","color":"gray"},{"text":"-","color":"white"},{"score":{"name":"$level","objective":"gm4_aa_data"},"color":"white"},{"text":" = "},{"score":{"name":"$damage_total","objective":"gm4_sr_data"},"color":"white"}] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/change_material.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/change_material.mcfunction new file mode 100644 index 0000000000..36dbde918f --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/change_material.mcfunction @@ -0,0 +1,14 @@ +# swap sword material if player armor has changed +# @s = player wearing armor +# at unspecified +# run from armor/augment/type/psychic/find_sword + +execute unless score $sword_material gm4_aa_data matches 2.. run data modify entity @s item.id set value "wooden_sword" +execute if score $sword_material gm4_aa_data matches 2 run data modify entity @s item.id set value "stone_sword" +execute if score $sword_material gm4_aa_data matches 3 run data modify entity @s item.id set value "iron_sword" +execute if score $sword_material gm4_aa_data matches 4 run data modify entity @s item.id set value "golden_sword" +execute if score $sword_material gm4_aa_data matches 5 run data modify entity @s item.id set value "diamond_sword" +execute if score $sword_material gm4_aa_data matches 6 run data modify entity @s item.id set value "netherite_sword" + +# store material for damage calculation +scoreboard players operation @s gm4_aa_data = $sword_material gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/damage_dealt/apply_durability.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/damage_dealt/apply_durability.mcfunction new file mode 100644 index 0000000000..64cd155109 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/damage_dealt/apply_durability.mcfunction @@ -0,0 +1,18 @@ +# damage armor durability +# @s = sword item_display +# at player rotated ~x ~ +# run from armor/augment/type/psychic/damage_dealt/durability + +# add incoming damage to the current damage +scoreboard players operation $sword_damage gm4_aa_data += $incoming_damage gm4_aa_data +execute store result storage gm4_augmented_armor:temp damage int 1 run scoreboard players operation $sword_damage gm4_aa_data < $sword_durability gm4_aa_data + +# apply to correct piece of armor +scoreboard players operation $slot gm4_aa_data = $sword_id gm4_aa_data +execute as @p[tag=gm4_aa_target] run function gm4_augmented_armor:item_modify_eval/set_damage with storage gm4_augmented_armor:temp + +# effect in case sword broke +execute if score $sword_damage gm4_aa_data = $sword_durability gm4_aa_data run playsound entity.item.break player @p[tag=gm4_aa_target] ~ ~ ~ 1 1 + +# cleanup +data remove storage gm4_augmented_armor:temp damage diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/damage_dealt/durability.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/damage_dealt/durability.mcfunction new file mode 100644 index 0000000000..b01951d5aa --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/damage_dealt/durability.mcfunction @@ -0,0 +1,18 @@ +# damage armor durability +# @s = sword item_display +# at player rotated ~x ~ +# run from armor/augment/type/psychic/damage_dealt/run + +# calculate incoming damage based on unbreaking +execute store result score $unbreaking_level gm4_aa_data run data get storage gm4_augmented_armor:temp psychic.data[0].components."minecraft:enchantments".levels."minecraft:unbreaking" +scoreboard players add $unbreaking_level gm4_aa_data 1 +scoreboard players set $damage_chance gm4_aa_data 100 +scoreboard players operation $damage_chance gm4_aa_data /= $unbreaking_level gm4_aa_data +scoreboard players set $damage_opportunities gm4_aa_data 1 +execute store result score $incoming_damage gm4_aa_data run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/roll_damage + +# if damage should be dealt apply it +execute if score $incoming_damage gm4_aa_data matches 1.. run function gm4_augmented_armor:armor/augment/type/psychic/damage_dealt/apply_durability + +# TODO: remove (spigot bug) +execute positioned 29999998 1 7133 run kill @e[type=item,distance=..2] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/damage_dealt/run.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/damage_dealt/run.mcfunction new file mode 100644 index 0000000000..03996113a0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/damage_dealt/run.mcfunction @@ -0,0 +1,11 @@ +# run if sword damaged an entity +# @s = sword item_display +# at player rotated ~x ~ +# run from armor/augment/type/psychic/move_sword + +# vfx +playsound minecraft:entity.player.attack.sweep player @a ~ ~ ~ 0.75 1.4 +particle sweep_attack ~ ~ ~ 0.05 0.15 0.05 0.01 1 + +# check if damage should be done to the armor +execute if score $player_creative gm4_aa_data matches 0 run function gm4_augmented_armor:armor/augment/type/psychic/damage_dealt/durability diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/eval_deg.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/eval_deg.mcfunction new file mode 100644 index 0000000000..cf094763f8 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/eval_deg.mcfunction @@ -0,0 +1,6 @@ +# get degrees offset from 0 0 for first sword +# @s = player wearing armor +# at unspecified +# run from armor/augment/type/psychic/prep + +$execute positioned ~ ~$(height) ~ rotated 0 0 rotated ~$(deg) ~ run function gm4_augmented_armor:armor/augment/type/psychic/find_sword with storage gm4_augmented_armor:temp psychic diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/find_sword.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/find_sword.mcfunction new file mode 100644 index 0000000000..bd74eebcfc --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/find_sword.mcfunction @@ -0,0 +1,27 @@ +# find this players sword and move it +# @s = player wearing armor +# at @s rotated ~x ~ +# run from armor/augment/type/psychic/eval_deg +# run from here + +# find sword that should be moved +execute store result score $sword_id gm4_aa_data run data get storage gm4_augmented_armor:temp psychic.data[0].components."minecraft:custom_data".gm4_augmented_armor.slot +execute as @e[type=item_display,tag=gm4_aa_psychic.check_sword,distance=..12] if score @s gm4_aa_augment.psychic.id = $sword_id gm4_aa_data run tag @s add gm4_aa_psychic.current_sword + +# check durability left on this armor +execute store result score $sword_damage gm4_aa_data run data get storage gm4_augmented_armor:temp psychic.data[0].components."minecraft:damage" +execute store result score $sword_durability gm4_aa_data run data get storage gm4_augmented_armor:temp psychic.data[0].components."minecraft:custom_data".gm4_augmented_armor.durability + +# if no sword exists yet spawn a new one +execute if score $sword_damage gm4_aa_data < $sword_durability gm4_aa_data unless entity @e[type=item_display,tag=gm4_aa_psychic.current_sword,distance=..12] summon item_display run function gm4_augmented_armor:armor/augment/type/psychic/init_sword + +# move the sword to the correct position +tag @s add gm4_aa_self +$execute if score $sword_damage gm4_aa_data < $sword_durability gm4_aa_data as @e[type=item_display,tag=gm4_aa_psychic.current_sword,distance=..12,limit=1] positioned ^ ^ ^$(offset) run function gm4_augmented_armor:armor/augment/type/psychic/move_sword +tag @s remove gm4_aa_self + +# if more swords should exist run this again for those rotated around the player +data remove storage gm4_augmented_armor:temp psychic.data[0] +execute if score $psychic.count gm4_aa_data matches 2 if data storage gm4_augmented_armor:temp psychic.data[0] rotated ~180 ~ run function gm4_augmented_armor:armor/augment/type/psychic/find_sword with storage gm4_augmented_armor:temp psychic +execute if score $psychic.count gm4_aa_data matches 3 if data storage gm4_augmented_armor:temp psychic.data[0] rotated ~120 ~ run function gm4_augmented_armor:armor/augment/type/psychic/find_sword with storage gm4_augmented_armor:temp psychic +execute if score $psychic.count gm4_aa_data matches 4 if data storage gm4_augmented_armor:temp psychic.data[0] rotated ~90 ~ run function gm4_augmented_armor:armor/augment/type/psychic/find_sword with storage gm4_augmented_armor:temp psychic diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/get_relevant_data.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/get_relevant_data.mcfunction new file mode 100644 index 0000000000..f75c958317 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/get_relevant_data.mcfunction @@ -0,0 +1,9 @@ +# keep only data from psychic_armor +# @s = player wearing armor +# at unspecified +# run from armor/augment/type/psychic/prep +# run from here + +execute if data storage gm4_augmented_armor:temp Items[0].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:psychic}} run data modify storage gm4_augmented_armor:temp psychic.data append from storage gm4_augmented_armor:temp Items[0] +data remove storage gm4_augmented_armor:temp Items[0] +execute if data storage gm4_augmented_armor:temp Items[0] run function gm4_augmented_armor:armor/augment/type/psychic/get_relevant_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/init_sword.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/init_sword.mcfunction new file mode 100644 index 0000000000..8e54ce0ca5 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/init_sword.mcfunction @@ -0,0 +1,26 @@ +# spawn sword if it doesn't exist +# @s = new sword item_display +# at @s +# run from armor/augment/type/psychic/find_sword + +data merge entity @s {teleport_duration:2,Tags:["gm4_aa_psychic.current_sword","gm4_aa_psychic.sword"],transformation:{left_rotation:[0f,0.425f,0f,1f],right_rotation:[1f,0f,0f,1f],translation:[0f,0f,0f],scale:[1f,1f,1f]},item:{id:"minecraft:wooden_sword",count:1}} + +# set the scales +execute store result entity @s transformation.scale[0] float 0.0075 run data get storage gm4_augmented_armor:temp psychic.scale 100 +execute store result entity @s transformation.scale[1] float 0.0075 run data get storage gm4_augmented_armor:temp psychic.scale 100 +execute store result entity @s transformation.scale[2] float 0.0075 run data get storage gm4_augmented_armor:temp psychic.scale 100 + +# set scores +scoreboard players operation @s gm4_aa_augment.psychic.id = $sword_id gm4_aa_data +scoreboard players operation @s gm4_aa_id = $player_id gm4_aa_id + +# set material +execute store result score $sword_material gm4_aa_data run data get storage gm4_augmented_armor:temp psychic.data[0].components."minecraft:custom_data".gm4_augmented_armor.material +execute if score $sword_material gm4_aa_data matches 2 run data modify entity @s item.id set value "stone_sword" +execute if score $sword_material gm4_aa_data matches 3 run data modify entity @s item.id set value "iron_sword" +execute if score $sword_material gm4_aa_data matches 4 run data modify entity @s item.id set value "golden_sword" +execute if score $sword_material gm4_aa_data matches 5 run data modify entity @s item.id set value "diamond_sword" +execute if score $sword_material gm4_aa_data matches 6 run data modify entity @s item.id set value "netherite_sword" + +# store material for damage calculation +scoreboard players operation @s gm4_aa_data = $sword_material gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/move_sword.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/move_sword.mcfunction new file mode 100644 index 0000000000..a73c263710 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/move_sword.mcfunction @@ -0,0 +1,31 @@ +# move sword to correct location +# @s = sword item_display +# at player rotated ~x ~ +# run from armor/augment/type/psychic/find_sword + +# move sword to correct position +tp @s ~ ~ ~ facing ^-1 ^ ^ + +# check if material still matches +execute store result score $sword_material gm4_aa_data run data get storage gm4_augmented_armor:temp psychic.data[0].components."minecraft:custom_data".gm4_augmented_armor.material +execute unless score @s gm4_aa_data = $sword_material gm4_aa_data run function gm4_augmented_armor:armor/augment/type/psychic/change_material + +# reset the scales +execute store result entity @s transformation.scale[0] float 0.0075 run data get storage gm4_augmented_armor:temp psychic.scale 100 +execute store result entity @s transformation.scale[1] float 0.0075 run data get storage gm4_augmented_armor:temp psychic.scale 100 +execute store result entity @s transformation.scale[2] float 0.0075 run data get storage gm4_augmented_armor:temp psychic.scale 100 + +# remove tags so this sword is not processed anymore this tick +tag @s remove gm4_aa_psychic.current_sword +tag @s remove gm4_aa_psychic.check_sword + +# keep this sword around until next tick +scoreboard players operation @s gm4_aa_keep_tick = $check.psychic gm4_aa_keep_tick + +# damage entities the sword contacts +scoreboard players set $damage_dealt gm4_aa_data 0 +execute if score $sword_material gm4_aa_data matches 1 at @s positioned ~-.15 ~-.15 ~-.15 as @e[tag=!gm4_aa_self,dx=0,dy=0,dz=0,predicate=gm4_augmented_armor:technical/pvp_able,tag=!smithed.strict] positioned ~-.7 ~-.7 ~-.7 if entity @s[dx=0,dy=0,dz=0] store success score $damage_dealt gm4_aa_data run damage @s 2 player_attack by @p[tag=gm4_aa_self] +execute if score $sword_material gm4_aa_data matches 2 at @s positioned ~-.15 ~-.15 ~-.15 as @e[tag=!gm4_aa_self,dx=0,dy=0,dz=0,predicate=gm4_augmented_armor:technical/pvp_able,tag=!smithed.strict] positioned ~-.7 ~-.7 ~-.7 if entity @s[dx=0,dy=0,dz=0] store success score $damage_dealt gm4_aa_data run damage @s 3 player_attack by @p[tag=gm4_aa_self] +execute if score $sword_material gm4_aa_data matches 3..4 at @s positioned ~-.15 ~-.15 ~-.15 as @e[tag=!gm4_aa_self,dx=0,dy=0,dz=0,predicate=gm4_augmented_armor:technical/pvp_able,tag=!smithed.strict] positioned ~-.7 ~-.7 ~-.7 if entity @s[dx=0,dy=0,dz=0] store success score $damage_dealt gm4_aa_data run damage @s 4 player_attack by @p[tag=gm4_aa_self] +execute if score $sword_material gm4_aa_data matches 5..6 at @s positioned ~-.15 ~-.15 ~-.15 as @e[tag=!gm4_aa_self,dx=0,dy=0,dz=0,predicate=gm4_augmented_armor:technical/pvp_able,tag=!smithed.strict] positioned ~-.7 ~-.7 ~-.7 if entity @s[dx=0,dy=0,dz=0] store success score $damage_dealt gm4_aa_data run damage @s 5 player_attack by @p[tag=gm4_aa_self] +execute if score $damage_dealt gm4_aa_data matches 1 at @s run function gm4_augmented_armor:armor/augment/type/psychic/damage_dealt/run diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/prep.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/prep.mcfunction new file mode 100644 index 0000000000..3fd4939d84 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/prep.mcfunction @@ -0,0 +1,42 @@ +# prepare everything needed to process psychic armor +# @s = player wearing armor +# at @s +# run from clocks/temp/psychic + +scoreboard players set $keep_tick.psychic gm4_aa_keep_tick 1 + +tag @s add gm4_aa_target +execute store result score $player_creative gm4_aa_data if entity @s[gamemode=creative] + +# grab armor data +item replace block 29999998 1 7134 container.0 from entity @s armor.head +item replace block 29999998 1 7134 container.1 from entity @s armor.chest +item replace block 29999998 1 7134 container.2 from entity @s armor.legs +item replace block 29999998 1 7134 container.3 from entity @s armor.feet +data modify storage gm4_augmented_armor:temp Items set from block 29999998 1 7134 Items +data remove block 29999998 1 7134 Items + +function gm4_augmented_armor:armor/augment/type/psychic/get_relevant_data +execute store result score $psychic.count gm4_aa_data run data get storage gm4_augmented_armor:temp psychic.data + +# check for crouching +scoreboard players set $stats_set gm4_aa_data 0 +execute if predicate gm4_augmented_armor:technical/crouching run function gm4_augmented_armor:armor/augment/type/psychic/set_stats_crouching +execute if score $stats_set gm4_aa_data matches 0 run function gm4_augmented_armor:armor/augment/type/psychic/set_stats + +# rotate the spawn location +scoreboard players add @s gm4_aa_augment.psychic.degree 5 +scoreboard players remove @s[scores={gm4_aa_augment.psychic.degree=360..}] gm4_aa_augment.psychic.degree 360 +execute store result storage gm4_augmented_armor:temp psychic.deg int 1 run scoreboard players get @s gm4_aa_augment.psychic.degree + +# get all swords that match this players id +scoreboard players operation $player_id gm4_aa_id = @s gm4_aa_id +execute as @e[type=item_display,tag=gm4_aa_psychic.sword,distance=..12] if score @s gm4_aa_id = $player_id gm4_aa_id run tag @s add gm4_aa_psychic.check_sword + +# find location for the first sword +function gm4_augmented_armor:armor/augment/type/psychic/eval_deg with storage gm4_augmented_armor:temp psychic + +# cleanup +tag @s remove gm4_aa_target +data remove storage gm4_augmented_armor:temp psychic +data remove storage gm4_augmented_armor:temp Items diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/set_stats.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/set_stats.mcfunction new file mode 100644 index 0000000000..31a689f423 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/set_stats.mcfunction @@ -0,0 +1,8 @@ +# set sword stats when player is not sneaking +# @s = player wearing armor +# at unspecified +# run from armor/augment/type/psychic/prep + +execute store result storage gm4_augmented_armor:temp psychic.scale float 0.1 run attribute @s minecraft:scale get 10 +execute store result storage gm4_augmented_armor:temp psychic.height float 0.11 run data get storage gm4_augmented_armor:temp psychic.scale 10 +execute store result storage gm4_augmented_armor:temp psychic.offset float 0.1 run attribute @s minecraft:entity_interaction_range get 10 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/set_stats_crouching.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/set_stats_crouching.mcfunction new file mode 100644 index 0000000000..9324e3388b --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/psychic/set_stats_crouching.mcfunction @@ -0,0 +1,11 @@ +# set sword stats when player is sneaking +# @s = player wearing armor +# at unspecified +# run from armor/augment/type/psychic/prep + +execute store result storage gm4_augmented_armor:temp psychic.scale float 0.1 run attribute @s minecraft:scale get 10 +execute store result storage gm4_augmented_armor:temp psychic.height float 0.065 run data get storage gm4_augmented_armor:temp psychic.scale 10 +execute store result storage gm4_augmented_armor:temp psychic.offset float 0.075 run attribute @s minecraft:entity_interaction_range get 10 + +scoreboard players set $stats_set gm4_aa_data 1 +scoreboard players add @s gm4_aa_augment.psychic.degree 4 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/reactive/add_absorption.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/reactive/add_absorption.mcfunction new file mode 100644 index 0000000000..2d24edb780 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/reactive/add_absorption.mcfunction @@ -0,0 +1,33 @@ + +tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":" - Reactive Absorption: +","color":"gray"},{"score":{"name":"$reactive.add_absorption","objective":"gm4_aa_data"},"color":"white"}] + +# playsound + + +# get player absorption amount and add the added absorption +scoreboard players operation $target_absorption_hearts gm4_aa_data = @s gm4_sr_stat.current_absorption +scoreboard players operation $target_absorption_hearts gm4_aa_data += $reactive.add_absorption gm4_aa_data + +# check what level of absorption would do this and apply it +scoreboard players operation $apply_absorption_level gm4_aa_data = $target_absorption_hearts gm4_aa_data +scoreboard players add $apply_absorption_level gm4_aa_data 3 +scoreboard players operation $apply_absorption_level gm4_aa_data /= #4 gm4_aa_data + +# check how many extra hearts this gives the player, add to absorption damage taken +scoreboard players operation $actual_absorption_hearts gm4_aa_data = $apply_absorption_level gm4_aa_data +scoreboard players operation $actual_absorption_hearts gm4_aa_data *= #4 gm4_aa_data +scoreboard players operation $target_absorption_hearts gm4_aa_data -= $actual_absorption_hearts gm4_aa_data +scoreboard players operation $damage_absorption gm4_sr_data += $target_absorption_hearts gm4_aa_data + +# if player was not going to be damaged make sure they are +execute unless score @s gm4_sr_stat.damage_resisted matches 1.. run scoreboard players set @s gm4_sr_stat.damage_resisted 1 + +# apply absorption level +execute store result storage gm4_augmented_armor:temp absorption.level int 1 run scoreboard players remove $apply_absorption_level gm4_aa_data 1 +function gm4_augmented_armor:armor/augment/type/reactive/eval_absorption with storage gm4_augmented_armor:temp absorption + +# set the absorption level, to be reduced when damage is calculated later this tick +data remove storage gm4_augmented_armor:temp absorption + +# cleanup the add absorption score for next time +scoreboard players reset $reactive.add_absorption gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/reactive/add_levels.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/reactive/add_levels.mcfunction new file mode 100644 index 0000000000..97b9f0c4d9 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/reactive/add_levels.mcfunction @@ -0,0 +1,70 @@ +# add absorption to player that got hit (red health hits only) +# @s = player wearing armor +# at @s +# run from armor/trigger/armor_break + +# store armor items to storage +item replace block 29999998 1 7134 container.0 from entity @s armor.head +item replace block 29999998 1 7134 container.1 from entity @s armor.chest +item replace block 29999998 1 7134 container.2 from entity @s armor.legs +item replace block 29999998 1 7134 container.3 from entity @s armor.feet +data modify storage gm4_augmented_armor:temp Items set from block 29999998 1 7134 Items +data remove block 29999998 1 7134 Items + +# playsound + +function gm4_survival_refightalized:player/health/calculate_hp + +# add levels together +scoreboard players set $total_level gm4_aa_data 0 + +scoreboard players set $level gm4_aa_data 0 +execute if data storage gm4_augmented_armor:temp Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:reactive}} store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor.levels[0] +scoreboard players operation $total_level gm4_aa_data += $level gm4_aa_data + +scoreboard players set $level gm4_aa_data 0 +execute if data storage gm4_augmented_armor:temp Items[{Slot:1b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:reactive}} store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:1b}].components."minecraft:custom_data".gm4_augmented_armor.levels[0] +scoreboard players operation $total_level gm4_aa_data += $level gm4_aa_data + +scoreboard players set $level gm4_aa_data 0 +execute if data storage gm4_augmented_armor:temp Items[{Slot:2b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:reactive}} store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:2b}].components."minecraft:custom_data".gm4_augmented_armor.levels[0] +scoreboard players operation $total_level gm4_aa_data += $level gm4_aa_data + +scoreboard players set $level gm4_aa_data 0 +execute if data storage gm4_augmented_armor:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor{augment:{name:reactive}} store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor.levels[0] +scoreboard players operation $total_level gm4_aa_data += $level gm4_aa_data + +# get total percentage of max health that should be added as absorption +scoreboard players operation $reactive.add_absorption gm4_aa_data = @s gm4_sr_stat.max_health +scoreboard players operation $reactive.add_absorption gm4_aa_data *= $total_level gm4_aa_data +scoreboard players operation $reactive.add_absorption gm4_aa_data /= #100 gm4_aa_data + +# get player absorption amount and add the added absorption +scoreboard players operation $target_absorption_hearts gm4_aa_data = @s gm4_sr_stat.current_absorption +scoreboard players operation $target_absorption_hearts gm4_aa_data += $reactive.add_absorption gm4_aa_data + +# check what level of absorption would do this and apply it +scoreboard players operation $apply_absorption_level gm4_aa_data = $target_absorption_hearts gm4_aa_data +scoreboard players add $apply_absorption_level gm4_aa_data 3 +scoreboard players operation $apply_absorption_level gm4_aa_data /= #4 gm4_aa_data + +# check how many extra hearts this gives the player, add to absorption damage taken +scoreboard players operation $actual_absorption_hearts gm4_aa_data = $apply_absorption_level gm4_aa_data +scoreboard players operation $actual_absorption_hearts gm4_aa_data *= #4 gm4_aa_data +scoreboard players operation $target_absorption_hearts gm4_aa_data -= $actual_absorption_hearts gm4_aa_data +scoreboard players operation $damage_absorption gm4_sr_data -= $target_absorption_hearts gm4_aa_data + +# set the absorption level, to be reduced when damage is calculated later this tick +execute store result storage gm4_augmented_armor:temp absorption.level int 1 run scoreboard players remove $apply_absorption_level gm4_aa_data 1 +function gm4_augmented_armor:armor/augment/type/reactive/eval_absorption with storage gm4_augmented_armor:temp absorption +data remove storage gm4_augmented_armor:temp absorption + +# recalc absorption health +scoreboard players operation @s gm4_sr_stat.max_absorption = $actual_absorption_hearts gm4_aa_data +scoreboard players operation @s gm4_sr_stat.current_absorption = @s gm4_sr_stat.max_absorption + +# dev log +tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":" - Reactive Absorption: +","color":"gray"},{"score":{"name":"$reactive.add_absorption","objective":"gm4_aa_data"},"color":"white"},{"text":" (","color":"dark_gray"},{"score":{"name":"$actual_absorption_hearts","objective":"gm4_aa_data"},"color":"dark_gray"},{"text":")","color":"dark_gray"}] + +# cleanup +data remove storage gm4_augmented_armor:temp Items diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/reactive/eval_absorption.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/reactive/eval_absorption.mcfunction new file mode 100644 index 0000000000..25d85adbc5 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/reactive/eval_absorption.mcfunction @@ -0,0 +1,2 @@ + +$effect give @s absorption 30 $(level) diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/rejuvenating/activate.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/rejuvenating/activate.mcfunction new file mode 100644 index 0000000000..a00de19641 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/rejuvenating/activate.mcfunction @@ -0,0 +1,27 @@ +# add absorption to player that got hit (red health hits only) +# @s = player wearing armor +# at @s +# run from armor/augment/damage_taken + +# calculate damage taken to health +scoreboard players operation $health_damage gm4_aa_data = $damage_total gm4_sr_data +execute unless score $damage_total gm4_sr_data matches 1.. run scoreboard players operation $health_damage gm4_aa_data = @s gm4_sr_stat.damage_taken +scoreboard players add $health_damage gm4_aa_data 5 +scoreboard players operation $health_damage gm4_aa_data /= #10 gm4_aa_data +scoreboard players operation $health_damage gm4_aa_data -= @s gm4_sr_stat.armor +scoreboard players operation $health_damage gm4_aa_data -= @s gm4_sr_stat.current_absorption + +# only run if health damage is taken +execute unless score $health_damage gm4_aa_data matches 1.. run return 0 + +# get percentage of this that should be converted to fast regen health, rounded +execute store result score $quick_regen_health gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] +scoreboard players operation $quick_regen_health gm4_aa_data *= $health_damage gm4_aa_data +scoreboard players add $quick_regen_health gm4_aa_data 50 +scoreboard players operation $quick_regen_health gm4_aa_data /= #100 gm4_aa_data + +# add to players quick regeneration health +scoreboard players operation @s gm4_sr_health.quick_regeneration_health += $quick_regen_health gm4_aa_data + +# dev damage log +tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":"Rejuvenating Augment: ","color":"gray"},{"score":{"name":"$quick_regen_health","objective":"gm4_aa_data"},"color":"white"},{"text":" to quick regeneration"}] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/add_static.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/add_static.mcfunction new file mode 100644 index 0000000000..a69d81fef8 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/add_static.mcfunction @@ -0,0 +1,9 @@ + +# if the augment clock was not running first clear any old stacks +execute if score $keep_tick.sparking gm4_aa_keep_tick matches 0 as @e[scores={gm4_aa_augment.sparking.static_stacks=1..}] run function gm4_augmented_armor:armor/augment/type/sparking/remove_static + +scoreboard players operation @s gm4_aa_augment.sparking.static_stacks += $level gm4_aa_data +scoreboard players set @s gm4_aa_augment.sparking.timer 160 + +execute unless score $keep_tick.sparking gm4_aa_keep_tick matches 1 run schedule function gm4_augmented_armor:clocks/temp/sparking 1t +scoreboard players set $keep_tick.sparking gm4_aa_keep_tick 1 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/damage_dealt.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/damage_dealt.mcfunction new file mode 100644 index 0000000000..cd8628d686 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/damage_dealt.mcfunction @@ -0,0 +1,10 @@ +# actiavate spark armor on wearer getting hit +# @s = player wearing armor +# at @s +# run from armor/augment/damage_dealt + +# get amount of static to apply +execute store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] + +# apply stacks +execute anchored eyes positioned ^ ^ ^3 as @e[type=!#gm4_augmented_armor:augment_immune,distance=..12,tag=!gm4_aa_self,tag=!smithed.strict,nbt={HurtTime:10s}] run function gm4_augmented_armor:armor/augment/type/sparking/add_static diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/damage_taken.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/damage_taken.mcfunction new file mode 100644 index 0000000000..6eceb1d5e1 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/damage_taken.mcfunction @@ -0,0 +1,12 @@ +# actiavate spark armor on wearer getting hit +# @s = player wearing armor +# at @s +# run from armor/augment/damage_taken + +# get amount of static to apply +execute store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] + +# apply stacks unless damage came from self +tag @s add gm4_aa_self +execute on attacker unless entity @s[tag=gm4_aa_self] run function gm4_augmented_armor:armor/augment/type/sparking/add_static +tag @s remove gm4_aa_self diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/particles/display.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/particles/display.mcfunction new file mode 100644 index 0000000000..d39ef0b089 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/particles/display.mcfunction @@ -0,0 +1,10 @@ +# play particles around the affected entity +# @s = entity with a lightning charge +# at @s rotaed ~x ~ +# run from weapon/modifier/lightning/particles/eval_rotation +# run from here + +$particle electric_spark ^ ^$(height) ^$(scale) 0.015 0.015 0.015 0.05 1 + +scoreboard players remove $particles_to_display gm4_aa_data 1 +$execute if score $particles_to_display gm4_aa_data matches 1.. rotated ~$(deg_pp) ~ run function gm4_augmented_armor:armor/augment/type/sparking/particles/display with storage gm4_augmented_armor:temp lightning diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/particles/eval_rotation.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/particles/eval_rotation.mcfunction new file mode 100644 index 0000000000..3bda9bd92b --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/particles/eval_rotation.mcfunction @@ -0,0 +1,6 @@ +# rotate particles around the entity based on a score +# @s = entity with a lightning charge +# at @s rotaed ~x ~ +# run from weapon/modifier/lightning/tick + +$execute rotated ~$(deg) ~ run function gm4_augmented_armor:armor/augment/type/sparking/particles/display with storage gm4_augmented_armor:temp lightning diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/remove_static.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/remove_static.mcfunction new file mode 100644 index 0000000000..9760abf87c --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/remove_static.mcfunction @@ -0,0 +1,3 @@ + +scoreboard players reset @s gm4_aa_augment.sparking.static_stacks +scoreboard players reset @s gm4_aa_augment.sparking.striking_timer diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/strike.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/strike.mcfunction new file mode 100644 index 0000000000..f103e1123e --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/strike.mcfunction @@ -0,0 +1,13 @@ +# strike players with full lightning charges +# @s = entity with a lightning charge +# at @s +# run from weapon/modifier/lightning/tick + +execute unless entity @s[type=player] run damage @s 42 lightning_bolt at ~ ~ ~ +execute if entity @s[type=player] run damage @s 16 lightning_bolt at ~ ~ ~ +execute as @e[distance=0.01..2.5,type=!player,type=!#gm4_augmented_armor:augment_resist,tag=!smithed.strict] run damage @s 21 lightning_bolt at ~ ~ ~ +summon lightning_bolt + +scoreboard players set @s gm4_aa_augment.sparking.timer 0 +scoreboard players set @s gm4_aa_augment.sparking.striking_timer 0 +scoreboard players set @s gm4_aa_augment.sparking.static_stacks 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/tick.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/tick.mcfunction new file mode 100644 index 0000000000..0d1c57b5d9 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sparking/tick.mcfunction @@ -0,0 +1,42 @@ +# process entities with lightning charge +# @s = entity with a lightning charge +# at @s +# run from clocks/temp/lightning + +# keep tick +scoreboard players set $keep_tick.sparking gm4_aa_keep_tick 1 + +# track striking timer +scoreboard players add @s[scores={gm4_aa_augment.sparking.striking_timer=1..}] gm4_aa_augment.sparking.striking_timer 1 +execute unless score @s gm4_aa_augment.sparking.striking_timer matches 1.. run scoreboard players set @s[scores={gm4_aa_augment.sparking.static_stacks=21..}] gm4_aa_augment.sparking.striking_timer 1 + +# limit statoc charge to 21 +scoreboard players set @s[scores={gm4_aa_augment.sparking.static_stacks=22..}] gm4_aa_augment.sparking.static_stacks 21 + +# display particles based on the amount of lightning charges a player has +scoreboard players operation @s gm4_aa_augment.sparking.deg += @s gm4_aa_augment.sparking.static_stacks +scoreboard players remove @s[scores={gm4_aa_augment.sparking.deg=360..}] gm4_aa_augment.sparking.deg 360 +execute store result storage gm4_augmented_armor:temp lightning.deg int 1 run scoreboard players get @s gm4_aa_augment.sparking.deg + +scoreboard players set $degree_per_particle gm4_aa_data 360 +execute store result storage gm4_augmented_armor:temp lightning.deg_pp int 1 run scoreboard players operation $degree_per_particle gm4_aa_data /= @s gm4_aa_augment.sparking.static_stacks + +scoreboard players operation $particles_to_display gm4_aa_data = @s gm4_aa_augment.sparking.static_stacks + +execute store result storage gm4_augmented_armor:temp lightning.scale float 0.0075 run attribute @s minecraft:scale get 100 +execute store result storage gm4_augmented_armor:temp lightning.height float 0.0133 run attribute @s minecraft:scale get 100 + +execute rotated 0 0 run function gm4_augmented_armor:armor/augment/type/sparking/particles/eval_rotation with storage gm4_augmented_armor:temp lightning + +# check for full charge +execute if score @s gm4_aa_augment.sparking.striking_timer matches 1 run playsound minecraft:entity.lightning_bolt.thunder player @a ~ ~ ~ 1 0 +execute if score @s gm4_aa_augment.sparking.striking_timer matches 1.. run particle electric_spark ~ ~10 ~ 0.1 4 0.1 0.2 16 +execute if score @s gm4_aa_augment.sparking.striking_timer matches 45.. run function gm4_augmented_armor:armor/augment/type/sparking/strike + +# reduce lightning charges if timer runs out +scoreboard players remove @s gm4_aa_augment.sparking.timer 1 +scoreboard players remove @s[scores={gm4_aa_augment.sparking.timer=..0,gm4_aa_augment.sparking.static_stacks=..20}] gm4_aa_augment.sparking.static_stacks 1 +scoreboard players set @s[scores={gm4_aa_augment.sparking.timer=..0}] gm4_aa_augment.sparking.timer 5 + +# cleanup +data remove storage gm4_augmented_armor:temp lightning diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/steelheart/check.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/steelheart/check.mcfunction new file mode 100644 index 0000000000..ea2b127ae0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/steelheart/check.mcfunction @@ -0,0 +1,43 @@ + +# check what regeneration speed this player would have without this armor +execute store result score $mod_regeneration_speed gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed.value +scoreboard players operation $current_regeneration_speed gm4_aa_data = @s gm4_sr_stat.regeneration_rate_base +scoreboard players operation $current_regeneration_speed gm4_aa_data += @s gm4_sr_stat.regeneration_rate_change +scoreboard players operation $current_regeneration_speed gm4_aa_data -= $mod_regeneration_speed gm4_aa_data + +# check if the armor already gives the right amount of regeneration reduction +scoreboard players set $regeneration_speed_set gm4_aa_data 0 +scoreboard players operation $regeneration_speed_set gm4_aa_data -= $current_regeneration_speed gm4_aa_data +execute if score $regeneration_speed_set gm4_aa_data = $mod_regeneration_speed gm4_aa_data run return 0 + +# update player score +scoreboard players operation @s gm4_sr_stat.regeneration_rate_change -= $mod_regeneration_speed gm4_aa_data +scoreboard players operation @s gm4_sr_stat.regeneration_rate_change += $regeneration_speed_set gm4_aa_data + +# otherwise update the armor +execute store result score $armor_recharge_set gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] -25 +scoreboard players operation $armor_recharge_set gm4_aa_data *= $regeneration_speed_set gm4_aa_data + +# update the custom attributes +scoreboard players set $change gm4_aa_data 1 +execute store result storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed.value int 1 run scoreboard players get $regeneration_speed_set gm4_aa_data +execute store result storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.armor_recharge.value int 0.01 run scoreboard players get $armor_recharge_set gm4_aa_data + +# use lib_lore to remove the old current bonus text +data modify storage gm4_lore:temp Source set from storage gm4_augmented_armor:temp components."minecraft:lore" +data modify storage gm4_lore:temp Target set value '{"color":"gray","fallback":"%s Augment:","italic":false,"translate":"item.gm4.augmented_armor.lore.augment","with":[{"fallback":"Steelheart","translate":"item.gm4.augmented_armor.augment.steelheart"}]}' +scoreboard players set $start gm4_lore 4 +scoreboard players set $extra gm4_lore 1 +function #gm4_lore:remove + +# use lib_lore to update the current bonus text +data modify storage gm4_lore:temp Target set value '{"color":"gray","fallback":"%s Augment:","italic":false,"translate":"item.gm4.augmented_armor.lore.augment","with":[{"fallback":"Steelheart","translate":"item.gm4.augmented_armor.augment.steelheart"}]}' +execute store result storage gm4_augmented_armor:temp set.regen_speed int -1 run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed.value +data modify storage gm4_augmented_armor:temp set.armor_recharge set from storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.armor_recharge.value +function gm4_augmented_armor:armor/augment/type/steelheart/eval_lore with storage gm4_augmented_armor:temp set +data remove storage gm4_augmented_armor:temp set +scoreboard players set $start gm4_lore 4 +function #gm4_lore:insert + +# update +data modify storage gm4_augmented_armor:temp components."minecraft:lore" set from storage gm4_lore:temp Source diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/steelheart/eval_lore.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/steelheart/eval_lore.mcfunction new file mode 100644 index 0000000000..a9d035ffb0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/steelheart/eval_lore.mcfunction @@ -0,0 +1,2 @@ + +$data modify storage gm4_lore:temp Input set value ['{"color":"red","italic":true,"translate":"attribute.modifier.take.1","with":["$(regen_speed)",{"fallback":"Regeneration Speed","translate":"attribute.gm4.augmented_armor.regen_speed"}]}','{"color":"blue","italic":true,"translate":"attribute.modifier.plus.1","with":["$(armor_recharge)",{"fallback":"Armor Recharge Rate","translate":"attribute.gm4.augmented_armor.armor_recharge"}]}'] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sturdy/reduce_damage.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sturdy/reduce_damage.mcfunction new file mode 100644 index 0000000000..573a3b2e91 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sturdy/reduce_damage.mcfunction @@ -0,0 +1,20 @@ +# add absorption to player that got hit (red health hits only) +# @s = player wearing armor +# at @s +# run from armor/augment/damage_taken + +# calculate damage reduction % x10 +execute store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] 10 +scoreboard players operation $level gm4_aa_data *= @s gm4_sr_stat.armor +scoreboard players operation $level gm4_aa_data /= #20 gm4_aa_data + +# calculate damage reduction +scoreboard players operation $damage_reduction gm4_aa_data = $level gm4_aa_data +scoreboard players operation $damage_reduction gm4_aa_data *= $damage_total gm4_sr_data +scoreboard players operation $damage_reduction gm4_aa_data /= #1000 gm4_aa_data + +# reduce damage, it will be set to at least 1 later if needed +scoreboard players operation $damage_total gm4_sr_data -= $damage_reduction gm4_aa_data + +# dev damage log +tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":"Sturdy Augment: ","color":"gray"},{"text":"-","color":"white"},{"score":{"name":"$damage_reduction","objective":"gm4_aa_data"},"color":"white"},{"text":" = "},{"score":{"name":"$damage_total","objective":"gm4_sr_data"},"color":"white"},{"text":" (","color":"dark_gray"},{"score":{"name":"$level","objective":"gm4_aa_data"},"color":"dark_gray"},{"text":"‰)","color":"dark_gray"}] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sustaining/check.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sustaining/check.mcfunction new file mode 100644 index 0000000000..2b40fb41ab --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sustaining/check.mcfunction @@ -0,0 +1,13 @@ +# check if armor should activate +# @s = player being checked +# at unspecified +# run from armor/augment/clocked + +function gm4_survival_refightalized:player/health/calculate_hp + +execute store result score $stored_missing_hp gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.stored_missing_hp + +scoreboard players operation $missing_health gm4_aa_data = @s gm4_sr_stat.max_health +scoreboard players operation $missing_health gm4_aa_data -= @s gm4_sr_stat.current_health + +execute unless score $missing_health gm4_aa_data = $stored_missing_hp gm4_aa_data run function gm4_augmented_armor:armor/augment/type/sustaining/update diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sustaining/eval_lore.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sustaining/eval_lore.mcfunction new file mode 100644 index 0000000000..917173c02e --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sustaining/eval_lore.mcfunction @@ -0,0 +1,2 @@ + +$data modify storage gm4_lore:temp Input set value ['{"color":"dark_gray","fallback":"Currently %s","italic":true,"translate":"item.gm4.augmented_armor.lore.sustaining_2","with":[{"color":"blue","italic":true,"translate":"attribute.modifier.equals.1","with":["$(value)",{"fallback":"Regeneration Speed","translate":"attribute.gm4.augmented_armor.regen_speed"}]}]}'] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sustaining/update.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sustaining/update.mcfunction new file mode 100644 index 0000000000..14a97ed52d --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/sustaining/update.mcfunction @@ -0,0 +1,29 @@ +# activate the augments on the armor piece +# @s = player wearing the armor +# at unspecified +# run from functions in armor/augment/type/acrobatic/check + +scoreboard players set $change gm4_aa_data 1 + +execute store result storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.stored_missing_hp int 1 run scoreboard players get $missing_health gm4_aa_data + +execute store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] +scoreboard players operation $level gm4_aa_data *= $missing_health gm4_aa_data + +# modify attribute +execute store result storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed.value int 1 run scoreboard players get $level gm4_aa_data + +# use lib_lore to remove the old current bonus text +data modify storage gm4_lore:temp Source set from storage gm4_augmented_armor:temp components."minecraft:lore" +data modify storage gm4_lore:temp Target set value '{"color":"gray","fallback":"%s Augment:","italic":false,"translate":"item.gm4.augmented_armor.lore.augment","with":[{"fallback":"Sustaining","translate":"item.gm4.augmented_armor.augment.sustaining"}]}' +scoreboard players set $start gm4_lore 2 +function #gm4_lore:remove + +# use lib_lore to update the current bonus text +data modify storage gm4_lore:temp Target set value '{"color":"gray","fallback":"%s Augment:","italic":false,"translate":"item.gm4.augmented_armor.lore.augment","with":[{"fallback":"Sustaining","translate":"item.gm4.augmented_armor.augment.sustaining"}]}' +function gm4_augmented_armor:armor/augment/type/sustaining/eval_lore with storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed +scoreboard players set $start gm4_lore 2 +function #gm4_lore:insert + +# update +data modify storage gm4_augmented_armor:temp components."minecraft:lore" set from storage gm4_lore:temp Source diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/activate.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/activate.mcfunction new file mode 100644 index 0000000000..53de395419 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/activate.mcfunction @@ -0,0 +1,14 @@ +# activate or spawn a totem +# @s = player that got the kill +# at @s +# run from armor/check_augment/killing + +# if there's no totem nearby spawn a new one and start the clock +execute unless entity @e[type=armor_stand,tag=gm4_aa_totem,distance=..18,limit=1] run function gm4_augmented_armor:armor/augment/type/totemic/spawn + +# check which effect should be applied +execute store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] +execute if score $level gm4_aa_data matches 1 as @n[type=armor_stand,tag=gm4_aa_totem,distance=..18] at @s run tag @s add gm4_aa_totem.healing +execute if score $level gm4_aa_data matches 2 as @n[type=armor_stand,tag=gm4_aa_totem,distance=..18] at @s run tag @s add gm4_aa_totem.haste +execute if score $level gm4_aa_data matches 3 as @n[type=armor_stand,tag=gm4_aa_totem,distance=..18] at @s run tag @s add gm4_aa_totem.freezing +execute if score $level gm4_aa_data matches 4 as @n[type=armor_stand,tag=gm4_aa_totem,distance=..18] at @s run tag @s add gm4_aa_totem.strength diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/freezing/find_target.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/freezing/find_target.mcfunction new file mode 100644 index 0000000000..1eb5ec7dfa --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/freezing/find_target.mcfunction @@ -0,0 +1,8 @@ + +scoreboard players remove $attempts_left gm4_aa_data 1 + +# find target +scoreboard players set $ray_distance gm4_aa_data 0 +execute as @n[predicate=gm4_augmented_armor:technical/pvp_able,tag=!smithed.strict,tag=!gm4_mu_frozen,tag=!gm4_mu_tried,distance=..16] facing entity @s eyes positioned ^ ^ ^0.1 run function gm4_augmented_armor:armor/augment/type/totemic/freezing/los_raycast + +execute if score $attempts_left gm4_aa_data matches 1.. run function gm4_augmented_armor:armor/augment/type/totemic/freezing/find_target diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/freezing/found_target.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/freezing/found_target.mcfunction new file mode 100644 index 0000000000..4c25f8028a --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/freezing/found_target.mcfunction @@ -0,0 +1,9 @@ + +scoreboard players set $attempts_left gm4_aa_data 0 + +# make the particle raycast +execute positioned ~0.8 ~0.8 ~0.8 run function gm4_augmented_armor:armor/augment/type/totemic/freezing/particle_raycast + +damage @s 0.01 freeze +effect give @s slowness 2 3 +effect give @s weakness 2 3 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/freezing/los_raycast.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/freezing/los_raycast.mcfunction new file mode 100644 index 0000000000..f5b9960306 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/freezing/los_raycast.mcfunction @@ -0,0 +1,12 @@ + +scoreboard players add $ray_distance gm4_aa_data 1 + +# raycast failed +execute if block ~ ~ ~ #gm4:full_collision run return run tag @s add gm4_mu_tried +execute if score $ray_distance gm4_aa_data matches 160.. run return run tag @s add gm4_mu_tried + +# target found +execute positioned ~-0.2 ~-0.2 ~-0.2 if entity @s[dx=0,dy=0,dz=0] positioned ~-0.6 ~-0.6 ~-0.6 if entity @s[dx=0,dy=0,dz=0] run return run function gm4_augmented_armor:armor/augment/type/totemic/freezing/found_target + +# continue raycast +execute positioned ^ ^ ^0.1 run function gm4_augmented_armor:armor/augment/type/totemic/freezing/los_raycast diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/freezing/particle_raycast.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/freezing/particle_raycast.mcfunction new file mode 100644 index 0000000000..dcf48f58ad --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/freezing/particle_raycast.mcfunction @@ -0,0 +1,7 @@ + +scoreboard players remove $ray_distance gm4_aa_data 1 + +particle dust{color:[0.545,0.686,0.878],scale:2} ~ ~ ~ 0.02 0.02 0.02 0 1 normal + +# continue raycast +execute if score $ray_distance gm4_aa_data matches 1.. positioned ^ ^ ^-0.1 run function gm4_augmented_armor:armor/augment/type/totemic/freezing/particle_raycast diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/freezing/run.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/freezing/run.mcfunction new file mode 100644 index 0000000000..c4be97e885 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/freezing/run.mcfunction @@ -0,0 +1,9 @@ +# freeze closest mob for 2 seconds +# @s = totem armor_stand +# at @s +# run from armor/augment/type/totemic/process + +particle entity_effect{color:[0.545,0.686,0.878,0.33]} ~ ~1.2 ~ 0.1 0.1 0.1 0.05 12 +scoreboard players set $attempts_left gm4_aa_data 5 +execute positioned ~ ~1.25 ~ run function gm4_augmented_armor:armor/augment/type/totemic/freezing/find_target +tag @e[predicate=gm4_augmented_armor:technical/pvp_able,tag=!smithed.strict,tag=gm4_mu_tried,distance=..16] remove gm4_mu_tried diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/haste/found_target.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/haste/found_target.mcfunction new file mode 100644 index 0000000000..ab164adcf1 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/haste/found_target.mcfunction @@ -0,0 +1,8 @@ + +scoreboard players set $target_affected gm4_aa_data 1 +scoreboard players set $ray_distance gm4_aa_data 0 + +tag @s add gm4_aa_totem_hasted +attribute @s minecraft:attack_speed modifier add gm4_augmented_armor:haste_totem 0.2 add_multiplied_total +attribute @s minecraft:movement_speed modifier add gm4_augmented_armor:haste_totem 0.2 add_multiplied_total +attribute @s minecraft:block_break_speed modifier add gm4_augmented_armor:haste_totem 0.2 add_multiplied_total diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/haste/los_raycast.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/haste/los_raycast.mcfunction new file mode 100644 index 0000000000..c5df1ee8f6 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/haste/los_raycast.mcfunction @@ -0,0 +1,12 @@ + +scoreboard players add $ray_distance gm4_aa_data 1 + +# raycast failed +execute if block ~ ~ ~ #gm4:full_collision run return run scoreboard players set $ray_distance gm4_aa_data 0 +execute if score $ray_distance gm4_aa_data matches 160.. run return run scoreboard players set $ray_distance gm4_aa_data 0 + +# target found +execute positioned ~-0.2 ~-0.2 ~-0.2 if entity @s[dx=0,dy=0,dz=0] positioned ~-0.6 ~-0.6 ~-0.6 if entity @s[dx=0,dy=0,dz=0] run return run function gm4_augmented_armor:armor/augment/type/totemic/haste/found_target + +# continue raycast +execute positioned ^ ^ ^0.1 run function gm4_augmented_armor:armor/augment/type/totemic/haste/los_raycast diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/haste/particle_ring.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/haste/particle_ring.mcfunction new file mode 100644 index 0000000000..1ab38d7840 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/haste/particle_ring.mcfunction @@ -0,0 +1,9 @@ + +scoreboard players remove $particle_ring gm4_aa_data 1 + +particle dust{color:[0.851,0.753,0.263],scale:1} ^ ^ ^0.5 0.01 0.01 0.01 1 1 normal +execute if predicate {condition:"random_chance",chance:0.5} run particle dust{color:[0.851,0.753,0.263],scale:1} ^ ^ ^1 0.01 0.01 0.01 1 1 normal +execute if predicate {condition:"random_chance",chance:0.33} run particle dust{color:[0.851,0.753,0.263],scale:1} ^ ^ ^1.75 0.01 0.01 0.01 1 1 normal + +# continue raycast +execute if score $particle_ring gm4_aa_data matches 1.. rotated ~2 ~ run function gm4_augmented_armor:armor/augment/type/totemic/haste/particle_ring diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/haste/remove_buff.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/haste/remove_buff.mcfunction new file mode 100644 index 0000000000..428423c042 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/haste/remove_buff.mcfunction @@ -0,0 +1,5 @@ + +tag @s remove gm4_aa_totem_hasted +attribute @s minecraft:attack_speed modifier remove gm4_augmented_armor:haste_totem +attribute @s minecraft:movement_speed modifier remove gm4_augmented_armor:haste_totem +attribute @s minecraft:block_break_speed modifier remove gm4_augmented_armor:haste_totem diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/haste/run.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/haste/run.mcfunction new file mode 100644 index 0000000000..0040b5c6eb --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/haste/run.mcfunction @@ -0,0 +1,13 @@ +# grant all players in range +20% attack speed and movement speed for 4 seconds +# @s = totem armor_stand +# at @s +# run from armor/augment/type/totemic/process + +particle entity_effect{color:[0.851,0.753,0.263,0.33]} ~ ~1.2 ~ 0.1 0.1 0.1 0.05 12 + +scoreboard players set $target_affected gm4_aa_data 0 +execute positioned ~ ~1.25 ~ as @a[distance=..16,gamemode=!spectator] facing entity @s eyes positioned ^ ^ ^0.1 run function gm4_augmented_armor:armor/augment/type/totemic/haste/los_raycast + +scoreboard players set $particle_ring gm4_aa_data 180 +execute if score $target_affected gm4_aa_data matches 1 positioned ~ ~1.25 ~ run function gm4_augmented_armor:armor/augment/type/totemic/haste/particle_ring + diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/healing/found_target.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/healing/found_target.mcfunction new file mode 100644 index 0000000000..36a4289410 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/healing/found_target.mcfunction @@ -0,0 +1,4 @@ + +function gm4_survival_refightalized:player/health/calculate_hp +execute if score @s gm4_sr_stat.health_percentage < $lowest_percentage_seen gm4_aa_data run function gm4_augmented_armor:armor/augment/type/totemic/healing/set_target +scoreboard players set $ray_distance gm4_aa_data 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/healing/heal.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/healing/heal.mcfunction new file mode 100644 index 0000000000..f538768f6c --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/healing/heal.mcfunction @@ -0,0 +1,6 @@ + +scoreboard players add @s gm4_sr_health.restoration 10 +tag @s remove gm4_aa_healing_totem_target +execute at @s anchored eyes positioned ^ ^0.33 ^ run particle heart ~ ~ ~ 0.33 0.2 0.33 0 3 + +execute positioned ~ ~1.75 ~ facing entity @s eyes positioned ^ ^ ^0.1 run function gm4_augmented_armor:armor/augment/type/totemic/healing/particle_raycast diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/healing/los_raycast.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/healing/los_raycast.mcfunction new file mode 100644 index 0000000000..96d6bec82e --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/healing/los_raycast.mcfunction @@ -0,0 +1,12 @@ + +scoreboard players add $ray_distance gm4_aa_data 1 + +# raycast failed +execute if block ~ ~ ~ #gm4:full_collision run return run scoreboard players set $ray_distance gm4_aa_data 0 +execute if score $ray_distance gm4_aa_data matches 160.. run return run scoreboard players set $ray_distance gm4_aa_data 0 + +# target found +execute positioned ~-0.2 ~-0.2 ~-0.2 if entity @s[dx=0,dy=0,dz=0] positioned ~-0.6 ~-0.6 ~-0.6 if entity @s[dx=0,dy=0,dz=0] run return run function gm4_augmented_armor:armor/augment/type/totemic/healing/found_target + +# continue raycast +execute positioned ^ ^ ^0.1 run function gm4_augmented_armor:armor/augment/type/totemic/healing/los_raycast diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/healing/particle_raycast.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/healing/particle_raycast.mcfunction new file mode 100644 index 0000000000..92a979d1bd --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/healing/particle_raycast.mcfunction @@ -0,0 +1,7 @@ + +scoreboard players remove $ray_distance_target gm4_aa_data 1 + +particle dust{color:[0.973,0.141,0.137],scale:1} ~ ~-0.5 ~ 0.15 0.15 0.15 0 1 normal + +# continue raycast +execute if score $ray_distance_target gm4_aa_data matches 1.. positioned ^ ^ ^0.1 run function gm4_augmented_armor:armor/augment/type/totemic/healing/particle_raycast diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/healing/run.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/healing/run.mcfunction new file mode 100644 index 0000000000..c32e4b3c51 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/healing/run.mcfunction @@ -0,0 +1,11 @@ +# restore 1 health to the most damaged player in range +# @s = totem armor_stand +# at @s +# run from armor/augment/type/totemic/process + +particle entity_effect{color:[0.973,0.141,0.137,0.33]} ~ ~1.2 ~ 0.1 0.1 0.1 0.05 12 + +scoreboard players set $lowest_percentage_seen gm4_aa_data 100 +execute positioned ~ ~1.25 ~ as @a[distance=..16,gamemode=!spectator,sort=nearest] facing entity @s eyes positioned ^ ^ ^0.1 run function gm4_augmented_armor:armor/augment/type/totemic/healing/los_raycast + +execute as @p[distance=..16,tag=gm4_aa_healing_totem_target] run function gm4_augmented_armor:armor/augment/type/totemic/healing/heal diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/healing/set_target.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/healing/set_target.mcfunction new file mode 100644 index 0000000000..95d0b3b955 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/healing/set_target.mcfunction @@ -0,0 +1,5 @@ + +tag @a remove gm4_aa_healing_totem_target +tag @s add gm4_aa_healing_totem_target +scoreboard players operation $lowest_percentage_seen gm4_aa_data = @s gm4_sr_stat.health_percentage +scoreboard players operation $ray_distance_target gm4_aa_data = $ray_distance gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/no_charge.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/no_charge.mcfunction new file mode 100644 index 0000000000..7325a4a9a1 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/no_charge.mcfunction @@ -0,0 +1,3 @@ + +particle cloud ~ ~1 ~ 0.2 0.2 0.2 0.05 2 +playsound block.fire.extinguish neutral @a[distance=..16] ~ ~1 ~ 0.25 0.8 1 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/process.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/process.mcfunction new file mode 100644 index 0000000000..45ee010fea --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/process.mcfunction @@ -0,0 +1,17 @@ +# process totems +# @s = totem armor stand +# at @s +# run from clocks/temp/totemic + +execute unless entity @a[distance=..32,gamemode=!spectator] run return run function gm4_augmented_armor:armor/augment/type/totemic/remove + +scoreboard players set $keep_tick.totemic gm4_aa_keep_tick 1 + +tp @s ~ ~ ~ ~90 ~ +playsound minecraft:block.beacon.ambient block @a ~ ~ ~ 0.4 2 +playsound minecraft:block.beacon.ambient block @a ~ ~ ~ 0.8 0.6 + +execute if entity @s[tag=gm4_aa_totem.freezing] run function gm4_augmented_armor:armor/augment/type/totemic/freezing/run +execute if entity @s[tag=gm4_aa_totem.haste] run function gm4_augmented_armor:armor/augment/type/totemic/haste/run +execute if entity @s[tag=gm4_aa_totem.healing] run function gm4_augmented_armor:armor/augment/type/totemic/healing/run +execute if entity @s[tag=gm4_aa_totem.strength] run function gm4_augmented_armor:armor/augment/type/totemic/strength/run diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/remove.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/remove.mcfunction new file mode 100644 index 0000000000..19a5628edd --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/remove.mcfunction @@ -0,0 +1,8 @@ +# remove this totem because players went too far away +# @s = totem armor stand +# at @s +# run from armor/augment/type/totemic/process + +particle minecraft:poof ~ ~0.2 ~ 0.2 0.2 0.2 0.01 5 +execute on passengers run kill @s +kill @s diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/spawn.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/spawn.mcfunction new file mode 100644 index 0000000000..f4ce898931 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/spawn.mcfunction @@ -0,0 +1,3 @@ + +summon armor_stand ~ ~.2 ~ {Silent:1b,Invulnerable:1b,NoBasePlate:1b,Motion:[0.0,0.05,0.0],Tags:["gm4_aa_totem","smithed.entity","smithed.strict"],Pose:{LeftLeg:[0f,0f,11f],RightLeg:[0f,0f,348f],Head:[179f,0f,0f]},DisabledSlots:4144959,Passengers:[{id:"minecraft:block_display",Tags:["gm4_aa_totem_display","smithed.entity","smithed.strict"],block_state:{Name:"minecraft:oak_fence",Properties:{north:"false",south:"false",east:"false",west:"false"}},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.5f,-1.4825f,-0.5f],scale:[1f,1f,1f]}}],ArmorItems:[{},{},{},{id:"minecraft:beacon",count:1}]} +execute unless score $keep_tick.totemic gm4_aa_keep_tick matches 1 run schedule function gm4_augmented_armor:clocks/temp/totemic 1t diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/strength/add_buff.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/strength/add_buff.mcfunction new file mode 100644 index 0000000000..cf9f73ced9 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/strength/add_buff.mcfunction @@ -0,0 +1,8 @@ + +scoreboard players add @s gm4_aa_augment.totemic.strength_effect 11 +scoreboard players set @s[scores={gm4_aa_augment.totemic.strength_effect=15..}] gm4_aa_augment.totemic.strength_effect 14 +attribute @s[scores={gm4_aa_augment.totemic.strength_effect=11}] minecraft:attack_damage modifier add gm4_augmented_armor:strength_totem 1 add_value +attribute @s[scores={gm4_aa_augment.totemic.strength_effect=12}] minecraft:attack_damage modifier add gm4_augmented_armor:strength_totem 2 add_value +attribute @s[scores={gm4_aa_augment.totemic.strength_effect=13}] minecraft:attack_damage modifier add gm4_augmented_armor:strength_totem 3 add_value +attribute @s[scores={gm4_aa_augment.totemic.strength_effect=14}] minecraft:attack_damage modifier add gm4_augmented_armor:strength_totem 4 add_value +execute at @s anchored eyes run particle trial_spawner_detection ^ ^-0.25 ^ 0.4 0.01 0.4 0 6 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/strength/remove_buff.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/strength/remove_buff.mcfunction new file mode 100644 index 0000000000..deac446acf --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/strength/remove_buff.mcfunction @@ -0,0 +1,4 @@ + +attribute @s minecraft:attack_damage modifier remove gm4_augmented_armor:strength_totem +scoreboard players remove @s gm4_aa_augment.totemic.strength_effect 10 +scoreboard players set @s[scores={gm4_aa_augment.totemic.strength_effect=..-1}] gm4_aa_augment.totemic.strength_effect 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/strength/run.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/strength/run.mcfunction new file mode 100644 index 0000000000..a90d0b0a3d --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/totemic/strength/run.mcfunction @@ -0,0 +1,10 @@ +# grant all players in range +1 attack damage for 4 seconds +# @s = totem armor_stand +# at @s +# run from armor/augment/type/totemic/process + +particle entity_effect{color:[1.000,0.843,0.000,0.33]} ~ ~1.2 ~ 0.1 0.1 0.1 0.05 12 + +particle trial_spawner_detection ~ ~0.85 ~ 0.4 0.01 0.4 0 6 +execute as @a[distance=..16,gamemode=!spectator] run function gm4_augmented_armor:armor/augment/type/totemic/strength/add_buff +effect give @e[predicate=gm4_augmented_armor:technical/pvp_able,tag=!smithed.strict,distance=..16] glowing 6 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vampiric/activate.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vampiric/activate.mcfunction new file mode 100644 index 0000000000..663f710b91 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vampiric/activate.mcfunction @@ -0,0 +1,16 @@ +# store healing in 'healstore' which will be healed at the end of the player processing (this tick) +# @s = player to heal +# at unspecified +# run from armor/check_augment/killing + +function gm4_survival_refightalized:player/health/calculate_hp + +# healing is 5% of max health per kill, rounded +scoreboard players operation $healing gm4_aa_data = @s gm4_sr_stat.max_health +scoreboard players operation $healing gm4_aa_data *= #5 gm4_aa_data +scoreboard players operation $healing gm4_aa_data *= @s gm4_aa_stat.kills +scoreboard players add $healing gm4_aa_data 50 +scoreboard players operation $healing gm4_aa_data /= #100 gm4_aa_data + +# store healing +scoreboard players operation @s gm4_sr_health.restoration += $healing gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vigorous/get_immunities.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vigorous/get_immunities.mcfunction new file mode 100644 index 0000000000..cbb114c475 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vigorous/get_immunities.mcfunction @@ -0,0 +1,37 @@ +# grant immunity tags to player depending on the armor worn +# @s = player wearing immune armour below 50% health +# at unspecified +# run from armor/augment/clocked + +# get levels +execute store result score $level gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[0] +execute store result score $level_2 gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.levels[1] + +# get effects to become immune to +execute if score $level gm4_aa_data matches 1 run tag @s add gm4_aa_effect_immunity.mining_fatigue +execute if score $level gm4_aa_data matches 2 run tag @s add gm4_aa_effect_immunity.poison +execute if score $level gm4_aa_data matches 3 run tag @s add gm4_aa_effect_immunity.weakness +execute if score $level gm4_aa_data matches 4 run tag @s add gm4_aa_effect_immunity.hunger +execute if score $level gm4_aa_data matches 5 run tag @s add gm4_aa_effect_immunity.blind +execute if score $level gm4_aa_data matches 6 run tag @s add gm4_aa_effect_immunity.nausea +execute if score $level gm4_aa_data matches 7 run tag @s add gm4_aa_effect_immunity.wither + +execute if score $level_2 gm4_aa_data matches 1 run tag @s add gm4_aa_effect_immunity.mining_fatigue +execute if score $level_2 gm4_aa_data matches 2 run tag @s add gm4_aa_effect_immunity.poison +execute if score $level_2 gm4_aa_data matches 3 run tag @s add gm4_aa_effect_immunity.weakness +execute if score $level_2 gm4_aa_data matches 4 run tag @s add gm4_aa_effect_immunity.hunger +execute if score $level_2 gm4_aa_data matches 5 run tag @s add gm4_aa_effect_immunity.blind +execute if score $level_2 gm4_aa_data matches 6 run tag @s add gm4_aa_effect_immunity.nausea +execute if score $level_2 gm4_aa_data matches 7 run tag @s add gm4_aa_effect_immunity.wither + +# remove effects if they were present +effect clear @s[tag=gm4_aa_effect_immunity.mining_fatigue] mining_fatigue +effect clear @s[tag=gm4_aa_effect_immunity.poison] poison +effect clear @s[tag=gm4_aa_effect_immunity.weakness] weakness +effect clear @s[tag=gm4_aa_effect_immunity.hunger] hunger +effect clear @s[tag=gm4_aa_effect_immunity.blind] blindness +effect clear @s[tag=gm4_aa_effect_immunity.nausea] nausea +effect clear @s[tag=gm4_aa_effect_immunity.wither] wither + +# tag for effect removal +tag @s add gm4_aa_effect_immunity.active diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/attempt.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/attempt.mcfunction new file mode 100644 index 0000000000..a014665415 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/attempt.mcfunction @@ -0,0 +1,15 @@ +# code taken from Orb of Ankou - expeditious +# @s = player wearing vorpal armor being damaged +# at @s +# run from armor/type/vorpal/context + +tag @s remove gm4_aa_vorpal_start + +# effects where you leave +particle reverse_portal ~ ~0.8 ~ 0.2 0.4 0.2 0.1 16 + +# teleport up to 8 blocks away +execute summon marker run function gm4_augmented_armor:armor/augment/type/vorpal/spawn_marker + +execute if score $warp_safe gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/type/vorpal/tp_player +execute if score $warp_safe gm4_aa_data matches 0 run function gm4_augmented_armor:armor/augment/type/vorpal/failsafe diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/context.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/context.mcfunction new file mode 100644 index 0000000000..e0359ad93f --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/context.mcfunction @@ -0,0 +1,7 @@ +# schedule is needed to let teleport work, because minecraft, that's why +# @s = unspecified +# at unspecified +# run from armor/type/vorpal/schedule + +# regain context +execute as @a[tag=gm4_aa_vorpal_start] at @s run function gm4_augmented_armor:armor/augment/type/vorpal/attempt diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/eval_failsafe.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/eval_failsafe.mcfunction new file mode 100644 index 0000000000..8b48c92107 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/eval_failsafe.mcfunction @@ -0,0 +1,8 @@ +# eval spreadplayer command +# @s = player wearing vorpal armor being damaged +# at @s +# run from armor/type/vorpal/failsafe + +$spreadplayers ~ ~ 0 8 under $(max_y) false @s +scoreboard players set $warp_safe gm4_aa_data 0 +execute at @s if predicate gm4_augmented_armor:technical/valid_tp run scoreboard players set $warp_safe gm4_aa_data 1 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/failsafe.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/failsafe.mcfunction new file mode 100644 index 0000000000..023b2c37ee --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/failsafe.mcfunction @@ -0,0 +1,12 @@ +# use spreadplayer command if other method fails +# @s = player wearing vorpal armor being damaged +# at @s +# run from armor/type/vorpal/attempt + +# search for the correct height +execute store result storage gm4_augmented_armor:temp vorpal.max_y int 1 run scoreboard players add $y_pos gm4_aa_data 8 +execute as @e[type=marker,tag=gm4_aa_vorpal] run function gm4_augmented_armor:armor/augment/type/vorpal/eval_failsafe with storage gm4_augmented_armor:temp vorpal +data remove storage gm4_augmented_armor:temp vorpal + +# teleport +function gm4_augmented_armor:armor/augment/type/vorpal/tp_player diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/randomize.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/randomize.mcfunction new file mode 100644 index 0000000000..82748869a4 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/randomize.mcfunction @@ -0,0 +1,10 @@ +# code taken from Orb of Ankou - expeditious +# @s = vorpal marker +# at @s +# run from armor/type/vorpal/spawn_marker +# run from armor/type/vorpal/tp_marker + +execute store result score $randomX gm4_aa_data run random value 0..16 +execute store result score $randomZ gm4_aa_data run random value 0..16 + +execute at @s run function gm4_augmented_armor:armor/augment/type/vorpal/tp_marker diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/schedule.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/schedule.mcfunction new file mode 100644 index 0000000000..d29a8ba4cb --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/schedule.mcfunction @@ -0,0 +1,8 @@ +# activate vorpal armor when player is damaged +# @s = player wearing armor +# at @s +# run from armor/augment/damage_taken + +# schedule a tick later, this also means vorpal cannot trigger twice +tag @s add gm4_aa_vorpal_start +schedule function gm4_augmented_armor:armor/augment/type/vorpal/context 1t replace diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/set_ypos.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/set_ypos.mcfunction new file mode 100644 index 0000000000..dce583f4de --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/set_ypos.mcfunction @@ -0,0 +1,11 @@ +# code taken from Orb of Ankou - expeditious +# @s = vorpal marker +# at @s +# run from armor/type/vorpal/tp_marker + +execute at @s run tp @s ~ ~-1 ~ +scoreboard players add $set_y gm4_aa_data 1 +scoreboard players set $warp_safe gm4_aa_data 0 +execute at @s if predicate gm4_augmented_armor:technical/valid_tp run scoreboard players set $warp_safe gm4_aa_data 1 +execute if score $warp_safe gm4_aa_data matches 1 run scoreboard players set $warp_attempt gm4_aa_data 33 +execute unless score $set_y gm4_aa_data matches 17.. at @s unless score $warp_safe gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/type/vorpal/set_ypos diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/spawn_marker.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/spawn_marker.mcfunction new file mode 100644 index 0000000000..1f3b53ba14 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/spawn_marker.mcfunction @@ -0,0 +1,11 @@ +# spawn a marker and start the moving of it +# @s = vorpal marker +# at @s +# run from armor/type/vorpal/attempt + +tag @s add gm4_aa_vorpal +tp @s ~-8 ~ ~-8 +execute store result score $y_pos gm4_aa_data run data get entity @s Pos[1] +scoreboard players set $warp_attempt gm4_aa_data 0 + +function gm4_augmented_armor:armor/augment/type/vorpal/randomize diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/tp_marker.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/tp_marker.mcfunction new file mode 100644 index 0000000000..656bcc358f --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/tp_marker.mcfunction @@ -0,0 +1,34 @@ +# code taken from Orb of Ankou - expeditious +# @s = vorpal marker +# at @s +# run from armor/type/vorpal/randomize + +execute at @s if score $randomX gm4_aa_data matches 16.. run tp @s ~16 ~ ~ +execute if score $randomX gm4_aa_data matches 16.. run scoreboard players remove $randomX gm4_aa_data 16 +execute at @s if score $randomX gm4_aa_data matches 8.. run tp @s ~8 ~ ~ +execute if score $randomX gm4_aa_data matches 8.. run scoreboard players remove $randomX gm4_aa_data 8 +execute at @s if score $randomX gm4_aa_data matches 4.. run tp @s ~4 ~ ~ +execute if score $randomX gm4_aa_data matches 4.. run scoreboard players remove $randomX gm4_aa_data 4 +execute at @s if score $randomX gm4_aa_data matches 2.. run tp @s ~2 ~ ~ +execute if score $randomX gm4_aa_data matches 2.. run scoreboard players remove $randomX gm4_aa_data 2 +execute at @s if score $randomX gm4_aa_data matches 1.. run tp @s ~1 ~ ~ +execute if score $randomX gm4_aa_data matches 1.. run scoreboard players remove $randomX gm4_aa_data 1 + +execute at @s if score $randomZ gm4_aa_data matches 16.. run tp @s ~ ~ ~16 +execute if score $randomZ gm4_aa_data matches 16.. run scoreboard players remove $randomZ gm4_aa_data 16 +execute at @s if score $randomZ gm4_aa_data matches 8.. run tp @s ~ ~ ~8 +execute if score $randomZ gm4_aa_data matches 8.. run scoreboard players remove $randomZ gm4_aa_data 8 +execute at @s if score $randomZ gm4_aa_data matches 4.. run tp @s ~ ~ ~4 +execute if score $randomZ gm4_aa_data matches 4.. run scoreboard players remove $randomZ gm4_aa_data 4 +execute at @s if score $randomZ gm4_aa_data matches 2.. run tp @s ~ ~ ~2 +execute if score $randomZ gm4_aa_data matches 2.. run scoreboard players remove $randomZ gm4_aa_data 2 +execute at @s if score $randomZ gm4_aa_data matches 1.. run tp @s ~ ~ ~1 +execute if score $randomZ gm4_aa_data matches 1.. run scoreboard players remove $randomZ gm4_aa_data 1 + +execute store result entity @s Pos[1] double 1 run scoreboard players get $y_pos gm4_aa_data +execute at @s run tp @s ~ ~8 ~ +scoreboard players set $set_y gm4_aa_data 0 +execute at @s run function gm4_augmented_armor:armor/augment/type/vorpal/set_ypos + +scoreboard players add $warp_attempt gm4_aa_data 1 +execute unless score $warp_attempt gm4_aa_data matches 33.. run function gm4_augmented_armor:armor/augment/type/vorpal/randomize diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/tp_player.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/tp_player.mcfunction new file mode 100644 index 0000000000..a17dce86cd --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/vorpal/tp_player.mcfunction @@ -0,0 +1,18 @@ +# code taken from Orb of Ankou - expeditious +# @s = player wearing vorpal armor being damaged +# at @s +# run from armor/type/vorpal/attempt + +# effects +execute if score $warp_safe gm4_aa_data matches 1.. at @e[type=marker,tag=gm4_aa_vorpal] align xyz run tp @s ~0.5 ~ ~0.5 +kill @e[type=marker,tag=gm4_aa_vorpal] + +playsound entity.enderman.teleport player @a ~ ~ ~ 0.8 1.2 +execute at @s run playsound entity.enderman.teleport player @a ~ ~ ~ 0.8 0.8 +execute at @s run particle portal ~ ~0.8 ~ 0.2 0.4 0.2 1 16 + +# compatibility with teleportation anchors +execute if score gm4_teleportation_anchors load.status matches 1 run function gm4_teleportation_anchors:player/used_chorus + +# advancement +advancement grant @s only gm4:augmented_armor_vorpal diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/activate.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/activate.mcfunction new file mode 100644 index 0000000000..1c3bd6129f --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/activate.mcfunction @@ -0,0 +1,55 @@ +# activate wild_magic armor when player is damaged +# @s = player wearing armor +# at @s +# run from armor/augment/damage_taken + +# Pick Effect +execute store result score $wild_magic.id gm4_aa_data run random value 1..100 +scoreboard players set $add gm4_aa_data 0 +# rare good +execute if score $wild_magic.id gm4_aa_data matches 100 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/good/instant_health +execute if score $wild_magic.id gm4_aa_data matches 99 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/good/haste +execute if score $wild_magic.id gm4_aa_data matches 98 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/good/absorption +execute if score $wild_magic.id gm4_aa_data matches 97 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/good/strength +# uncommon good +execute if score $wild_magic.id gm4_aa_data matches 95..96 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/good/health_boost +execute if score $wild_magic.id gm4_aa_data matches 93..94 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/good/regeneration +execute if score $wild_magic.id gm4_aa_data matches 91..92 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/good/resistance +execute if score $wild_magic.id gm4_aa_data matches 89..90 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/good/saturation +execute if score $wild_magic.id gm4_aa_data matches 87..88 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/good/speed +# common good +execute if score $wild_magic.id gm4_aa_data matches 83..86 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/good/conduit_power +execute if score $wild_magic.id gm4_aa_data matches 79..82 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/good/jump_boost +execute if score $wild_magic.id gm4_aa_data matches 75..78 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/good/invisibility +execute if score $wild_magic.id gm4_aa_data matches 71..74 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/good/dolphins_grace +execute if score $wild_magic.id gm4_aa_data matches 66..70 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/good/glowing +execute if score $wild_magic.id gm4_aa_data matches 58..65 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/good/fire_resistance +execute if score $wild_magic.id gm4_aa_data matches 48..57 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/good/night_vision +execute if score $wild_magic.id gm4_aa_data matches 38..47 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/good/water_breathing +# common bad +execute if score $wild_magic.id gm4_aa_data matches 33..37 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/bad/hunger +execute if score $wild_magic.id gm4_aa_data matches 28..32 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/bad/mining_fatigue +execute if score $wild_magic.id gm4_aa_data matches 23..27 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/bad/nausea +execute if score $wild_magic.id gm4_aa_data matches 17..22 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/bad/slowness +# uncommon bad +execute if score $wild_magic.id gm4_aa_data matches 11..12 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/bad/levitation +execute if score $wild_magic.id gm4_aa_data matches 9..10 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/bad/slow_falling +execute if score $wild_magic.id gm4_aa_data matches 7..8 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/bad/weakness +execute if score $wild_magic.id gm4_aa_data matches 5..6 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/bad/darkness +# rare bad +execute if score $wild_magic.id gm4_aa_data matches 4 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/bad/wither +execute if score $wild_magic.id gm4_aa_data matches 3 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/bad/poison +execute if score $wild_magic.id gm4_aa_data matches 2 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/bad/blindness +execute if score $wild_magic.id gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/type/wild_magic/effect/bad/instant_damage + +# TODO: remove (spigot bug) +execute positioned 29999998 1 7133 run kill @e[type=item,distance=..2] + +# Store in storage and apply +function gm4_augmented_armor:armor/augment/type/wild_magic/eval with storage gm4_augmented_armor:temp wild_magic + +# SFX +playsound minecraft:entity.allay.item_thrown player @s ~ ~ ~ 1 0.55 + +# Cleanup +data remove storage gm4_augmented_armor:temp wild_magic diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/blindness.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/blindness.mcfunction new file mode 100644 index 0000000000..525701e032 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/blindness.mcfunction @@ -0,0 +1,8 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "blindness" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 6..25 + +# Level +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run scoreboard players set $base gm4_aa_data 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/darkness.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/darkness.mcfunction new file mode 100644 index 0000000000..943fe2de9c --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/darkness.mcfunction @@ -0,0 +1,8 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "darkness" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 15..45 + +# Level +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run scoreboard players set $base gm4_aa_data 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/hunger.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/hunger.mcfunction new file mode 100644 index 0000000000..f5f6cb6399 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/hunger.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "hunger" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 15..60 + +# Level +scoreboard players set $add gm4_aa_data 9 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/instant_damage.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/instant_damage.mcfunction new file mode 100644 index 0000000000..53d5dd6fe6 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/instant_damage.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "instant_damage" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run scoreboard players set $base gm4_aa_data 1 + +# Level +scoreboard players set $add gm4_aa_data 2 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/levitation.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/levitation.mcfunction new file mode 100644 index 0000000000..692d84d4a3 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/levitation.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "levitation" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 1..5 + +# Level +scoreboard players set $add gm4_aa_data 9 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/mining_fatigue.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/mining_fatigue.mcfunction new file mode 100644 index 0000000000..2a6477543c --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/mining_fatigue.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "mining_fatigue" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 15..45 + +# Level +scoreboard players set $add gm4_aa_data 4 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/nausea.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/nausea.mcfunction new file mode 100644 index 0000000000..034e96b280 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/nausea.mcfunction @@ -0,0 +1,8 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "nausea" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 15..45 + +# Level +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run scoreboard players set $base gm4_aa_data 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/poison.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/poison.mcfunction new file mode 100644 index 0000000000..5c3e88d24f --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/poison.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "poison" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 6..25 + +# Level +scoreboard players set $add gm4_aa_data 2 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/slow_falling.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/slow_falling.mcfunction new file mode 100644 index 0000000000..6cb31817cc --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/slow_falling.mcfunction @@ -0,0 +1,8 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "slow_falling" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 15..60 + +# Level +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run scoreboard players set $base gm4_aa_data 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/slowness.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/slowness.mcfunction new file mode 100644 index 0000000000..44c170ad0b --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/slowness.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "slowness" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 15..90 + +# Level +scoreboard players set $add gm4_aa_data 4 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/weakness.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/weakness.mcfunction new file mode 100644 index 0000000000..fa1e6bd961 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/weakness.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "weakness" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 15..45 + +# Level +scoreboard players set $add gm4_aa_data 4 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/wither.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/wither.mcfunction new file mode 100644 index 0000000000..0a3d9875ea --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/bad/wither.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "wither" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 6..20 + +# Level +scoreboard players set $add gm4_aa_data 2 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/absorption.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/absorption.mcfunction new file mode 100644 index 0000000000..ad4c6d7848 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/absorption.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "absorption" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 45..90 + +# Level +scoreboard players set $add gm4_aa_data 4 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/conduit_power.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/conduit_power.mcfunction new file mode 100644 index 0000000000..c4d1f6c3f0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/conduit_power.mcfunction @@ -0,0 +1,8 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "conduit_power" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 15..90 + +# Level +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run scoreboard players set $base gm4_aa_data 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/dolphins_grace.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/dolphins_grace.mcfunction new file mode 100644 index 0000000000..50133bb6b0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/dolphins_grace.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "dolphins_grace" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 45..180 + +# Level +scoreboard players set $add gm4_aa_data 9 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/fire_resistance.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/fire_resistance.mcfunction new file mode 100644 index 0000000000..92538722f7 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/fire_resistance.mcfunction @@ -0,0 +1,8 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "fire_resistance" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 60..90 + +# Level +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run scoreboard players set $base gm4_aa_data 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/glowing.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/glowing.mcfunction new file mode 100644 index 0000000000..ef46e9e16b --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/glowing.mcfunction @@ -0,0 +1,8 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "glowing" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 15..90 + +# Level +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run scoreboard players set $base gm4_aa_data 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/haste.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/haste.mcfunction new file mode 100644 index 0000000000..fc5c39e821 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/haste.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "haste" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 45..120 + +# Level +scoreboard players set $add gm4_aa_data 3 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/health_boost.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/health_boost.mcfunction new file mode 100644 index 0000000000..5816d45dbf --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/health_boost.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "health_boost" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 45..120 + +# Level +scoreboard players set $add gm4_aa_data 4 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/instant_health.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/instant_health.mcfunction new file mode 100644 index 0000000000..6311018c55 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/instant_health.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "instant_health" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run scoreboard players set $base gm4_aa_data 1 + +# Level +scoreboard players set $add gm4_aa_data 4 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/invisibility.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/invisibility.mcfunction new file mode 100644 index 0000000000..8edb8d813f --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/invisibility.mcfunction @@ -0,0 +1,8 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "invisibility" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 15..120 + +# Level +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run scoreboard players set $base gm4_aa_data 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/jump_boost.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/jump_boost.mcfunction new file mode 100644 index 0000000000..18dc572db3 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/jump_boost.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "jump_boost" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 15..90 + +# Level +scoreboard players set $add gm4_aa_data 9 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/night_vision.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/night_vision.mcfunction new file mode 100644 index 0000000000..062ee2c217 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/night_vision.mcfunction @@ -0,0 +1,8 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "night_vision" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 45..180 + +# Level +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run scoreboard players set $base gm4_aa_data 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/regeneration.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/regeneration.mcfunction new file mode 100644 index 0000000000..aeba718b24 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/regeneration.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "regeneration" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 15..30 + +# Level +scoreboard players set $add gm4_aa_data 4 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/resistance.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/resistance.mcfunction new file mode 100644 index 0000000000..309469c53f --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/resistance.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "resistance" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 15..60 + +# Level +scoreboard players set $add gm4_aa_data 4 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/saturation.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/saturation.mcfunction new file mode 100644 index 0000000000..734108e92e --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/saturation.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "saturation" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 5..20 + +# Level +scoreboard players set $add gm4_aa_data 1 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/speed.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/speed.mcfunction new file mode 100644 index 0000000000..6b6eb97d28 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/speed.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "speed" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 60..180 + +# Level +scoreboard players set $add gm4_aa_data 9 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/strength.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/strength.mcfunction new file mode 100644 index 0000000000..42511c13c6 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/strength.mcfunction @@ -0,0 +1,9 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "strength" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 45..90 + +# Level +scoreboard players set $add gm4_aa_data 1 +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run loot spawn 29999998 1 7133 loot gm4_augmented_armor:technical/wild_magic_level diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/water_breathing.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/water_breathing.mcfunction new file mode 100644 index 0000000000..113adcc71b --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/effect/good/water_breathing.mcfunction @@ -0,0 +1,8 @@ + +data modify storage gm4_augmented_armor:temp wild_magic.id set value "water_breathing" + +# Duration +execute store result storage gm4_augmented_armor:temp wild_magic.duration int 1 run random value 60..180 + +# Level +execute store result storage gm4_augmented_armor:temp wild_magic.level int 1 run scoreboard players set $base gm4_aa_data 0 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/eval.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/eval.mcfunction new file mode 100644 index 0000000000..de9c602fef --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/augment/type/wild_magic/eval.mcfunction @@ -0,0 +1,7 @@ +# apply the stored effect to player +# @s = player wearing armor +# at @s +# run from armor/augment/type/wild_magic/activate + +$effect give @s $(id) $(duration) $(level) +$tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":"Wild Magic: ","color":"gray"},{"text":"$(id) $(level) - $(duration)s","color":"dark_gray"}] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/convert_netherite.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/convert_netherite.mcfunction new file mode 100644 index 0000000000..fa1f911470 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/convert_netherite.mcfunction @@ -0,0 +1,39 @@ +# update the armor and name when it is upgraded to netherite +# @s = player having the armor equipped +# at @s +# run from any armor/slot/ + +# set armor to be converted +data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.netherite set value 1 +data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.material set value 6 + +# add 1 to armor toughness +execute if score $slot gm4_aa_data matches 0 store result score $armor_toughness gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{type:"minecraft:armor_toughness",id:"minecraft:armor.helmet"}].amount 100 +execute if score $slot gm4_aa_data matches 1 store result score $armor_toughness gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{type:"minecraft:armor_toughness",id:"minecraft:armor.chestplate"}].amount 100 +execute if score $slot gm4_aa_data matches 2 store result score $armor_toughness gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{type:"minecraft:armor_toughness",id:"minecraft:armor.leggings"}].amount 100 +execute if score $slot gm4_aa_data matches 3 store result score $armor_toughness gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{type:"minecraft:armor_toughness",id:"minecraft:armor.boots"}].amount 100 + +execute if score $slot gm4_aa_data matches 0 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{type:"minecraft:armor_toughness",id:"minecraft:armor.helmet"}].amount double 0.01 run scoreboard players add $armor_toughness gm4_aa_data 100 +execute if score $slot gm4_aa_data matches 1 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{type:"minecraft:armor_toughness",id:"minecraft:armor.chestplate"}].amount double 0.01 run scoreboard players add $armor_toughness gm4_aa_data 100 +execute if score $slot gm4_aa_data matches 2 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{type:"minecraft:armor_toughness",id:"minecraft:armor.leggings"}].amount double 0.01 run scoreboard players add $armor_toughness gm4_aa_data 100 +execute if score $slot gm4_aa_data matches 3 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{type:"minecraft:armor_toughness",id:"minecraft:armor.boots"}].amount double 0.01 run scoreboard players add $armor_toughness gm4_aa_data 100 + +# add 0.1 to knockback resistance +execute if score $slot gm4_aa_data matches 0 store result score $knockback_resistance gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{type:"minecraft:knockback_resistance",id:"minecraft:armor.helmet"}].amount 100 +execute if score $slot gm4_aa_data matches 1 store result score $knockback_resistance gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{type:"minecraft:knockback_resistance",id:"minecraft:armor.chestplate"}].amount 100 +execute if score $slot gm4_aa_data matches 2 store result score $knockback_resistance gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{type:"minecraft:knockback_resistance",id:"minecraft:armor.leggings"}].amount 100 +execute if score $slot gm4_aa_data matches 3 store result score $knockback_resistance gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{type:"minecraft:knockback_resistance",id:"minecraft:armor.boots"}].amount 100 + +execute if score $slot gm4_aa_data matches 0 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{type:"minecraft:knockback_resistance",id:"minecraft:armor.helmet"}].amount double 0.01 run scoreboard players add $knockback_resistance gm4_aa_data 10 +execute if score $slot gm4_aa_data matches 1 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{type:"minecraft:knockback_resistance",id:"minecraft:armor.chestplate"}].amount double 0.01 run scoreboard players add $knockback_resistance gm4_aa_data 10 +execute if score $slot gm4_aa_data matches 2 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{type:"minecraft:knockback_resistance",id:"minecraft:armor.leggings"}].amount double 0.01 run scoreboard players add $knockback_resistance gm4_aa_data 10 +execute if score $slot gm4_aa_data matches 3 store result storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[{type:"minecraft:knockback_resistance",id:"minecraft:armor.boots"}].amount double 0.01 run scoreboard players add $knockback_resistance gm4_aa_data 10 + +# set durability from netherite +execute if score $slot gm4_aa_data matches 3 run data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.durability set value 481 +execute if score $slot gm4_aa_data matches 2 run data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.durability set value 555 +execute if score $slot gm4_aa_data matches 1 run data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.durability set value 592 +execute if score $slot gm4_aa_data matches 0 run data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.durability set value 407 + +# update item +scoreboard players set $change gm4_aa_data 1 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/custom_attribute/armor_recharge_rate.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/custom_attribute/armor_recharge_rate.mcfunction new file mode 100644 index 0000000000..f582afe6c9 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/custom_attribute/armor_recharge_rate.mcfunction @@ -0,0 +1,17 @@ + +# check each piece +scoreboard players set $add_armor_recharge gm4_aa_data 0 +execute store result score $add_armor_recharge gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.armor_recharge.value +scoreboard players operation @s gm4_sr_stat.armor_recharge_change += $add_armor_recharge gm4_aa_data + +scoreboard players set $add_armor_recharge gm4_aa_data 0 +execute store result score $add_armor_recharge gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:1b}].components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.armor_recharge.value +scoreboard players operation @s gm4_sr_stat.armor_recharge_change += $add_armor_recharge gm4_aa_data + +scoreboard players set $add_armor_recharge gm4_aa_data 0 +execute store result score $add_armor_recharge gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:2b}].components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.armor_recharge.value +scoreboard players operation @s gm4_sr_stat.armor_recharge_change += $add_armor_recharge gm4_aa_data + +scoreboard players set $add_armor_recharge gm4_aa_data 0 +execute store result score $add_armor_recharge gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.armor_recharge.value +scoreboard players operation @s gm4_sr_stat.armor_recharge_change += $add_armor_recharge gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/custom_attribute/arrow_damage.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/custom_attribute/arrow_damage.mcfunction new file mode 100644 index 0000000000..baa3163ea0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/custom_attribute/arrow_damage.mcfunction @@ -0,0 +1,24 @@ + +# | Arrow Damage +scoreboard players set $arrow_damage_change gm4_aa_data 0 + +scoreboard players set $add_arrow_damage gm4_aa_data 0 +execute store result score $add_arrow_damage gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_damage.value +scoreboard players operation $arrow_damage_change gm4_aa_data += $add_arrow_damage gm4_aa_data + +scoreboard players set $add_arrow_damage gm4_aa_data 0 +execute store result score $add_arrow_damage gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:1b}].components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_damage.value +scoreboard players operation $arrow_damage_change gm4_aa_data += $add_arrow_damage gm4_aa_data + +scoreboard players set $add_arrow_damage gm4_aa_data 0 +execute store result score $add_arrow_damage gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:2b}].components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_damage.value +scoreboard players operation $arrow_damage_change gm4_aa_data += $add_arrow_damage gm4_aa_data + +scoreboard players set $add_arrow_damage gm4_aa_data 0 +execute store result score $add_arrow_damage gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_damage.value +scoreboard players operation $arrow_damage_change gm4_aa_data += $add_arrow_damage gm4_aa_data + +# add arrow damage to arrow /5 to go from percentage to value, make sure arrow damage is at least 1 +scoreboard players operation $arrow_damage_change gm4_aa_data /= #5 gm4_aa_data +scoreboard players operation $arrow_damage gm4_sr_data += $arrow_damage_change gm4_aa_data +scoreboard players operation $arrow_damage gm4_sr_data > #1 gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/custom_attribute/arrow_speed.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/custom_attribute/arrow_speed.mcfunction new file mode 100644 index 0000000000..c3208a8bc3 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/custom_attribute/arrow_speed.mcfunction @@ -0,0 +1,22 @@ + +# | Arrow Speed +scoreboard players set $motion_reduction gm4_aa_data 0 + +scoreboard players set $add_motion_reduction gm4_aa_data 0 +execute store result score $add_motion_reduction gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_speed.value +scoreboard players operation $motion_reduction gm4_aa_data += $add_motion_reduction gm4_aa_data + +scoreboard players set $add_motion_reduction gm4_aa_data 0 +execute store result score $add_motion_reduction gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:1b}].components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_speed.value +scoreboard players operation $motion_reduction gm4_aa_data += $add_motion_reduction gm4_aa_data + +scoreboard players set $add_motion_reduction gm4_aa_data 0 +execute store result score $add_motion_reduction gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:2b}].components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_speed.value +scoreboard players operation $motion_reduction gm4_aa_data += $add_motion_reduction gm4_aa_data + +scoreboard players set $add_motion_reduction gm4_aa_data 0 +execute store result score $add_motion_reduction gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_speed.value +scoreboard players operation $motion_reduction gm4_aa_data += $add_motion_reduction gm4_aa_data + +# apply arrow speed if needed +execute unless score $motion_reduction gm4_aa_data matches 0 as @n[type=#gm4_survival_refightalized:arrow,tag=gm4_sr_current_arrow] run function gm4_augmented_armor:armor/modify_arrow_speed diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/custom_attribute/regeneration_speed.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/custom_attribute/regeneration_speed.mcfunction new file mode 100644 index 0000000000..1658be0fd4 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/custom_attribute/regeneration_speed.mcfunction @@ -0,0 +1,25 @@ + +# check each piece +scoreboard players set $add_regen_speed gm4_aa_data 0 +execute store result score $add_regen_speed gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed.value +scoreboard players operation $add_regen_speed gm4_aa_data *= @s gm4_sr_stat.regeneration_rate_base +scoreboard players operation $add_regen_speed gm4_aa_data /= #100 gm4_aa_data +scoreboard players operation @s gm4_sr_stat.regeneration_rate_change += $add_regen_speed gm4_aa_data + +scoreboard players set $add_regen_speed gm4_aa_data 0 +execute store result score $add_regen_speed gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:1b}].components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed.value +scoreboard players operation $add_regen_speed gm4_aa_data *= @s gm4_sr_stat.regeneration_rate_base +scoreboard players operation $add_regen_speed gm4_aa_data /= #100 gm4_aa_data +scoreboard players operation @s gm4_sr_stat.regeneration_rate_change += $add_regen_speed gm4_aa_data + +scoreboard players set $add_regen_speed gm4_aa_data 0 +execute store result score $add_regen_speed gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:2b}].components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed.value +scoreboard players operation $add_regen_speed gm4_aa_data *= @s gm4_sr_stat.regeneration_rate_base +scoreboard players operation $add_regen_speed gm4_aa_data /= #100 gm4_aa_data +scoreboard players operation @s gm4_sr_stat.regeneration_rate_change += $add_regen_speed gm4_aa_data + +scoreboard players set $add_regen_speed gm4_aa_data 0 +execute store result score $add_regen_speed gm4_aa_data run data get storage gm4_augmented_armor:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed.value +scoreboard players operation $add_regen_speed gm4_aa_data *= @s gm4_sr_stat.regeneration_rate_base +scoreboard players operation $add_regen_speed gm4_aa_data /= #100 gm4_aa_data +scoreboard players operation @s gm4_sr_stat.regeneration_rate_change += $add_regen_speed gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/modify_arrow_speed.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/modify_arrow_speed.mcfunction new file mode 100644 index 0000000000..648a013f79 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/modify_arrow_speed.mcfunction @@ -0,0 +1,22 @@ + +# alter motion with reduction +execute store result score $mot_x gm4_aa_data run data get entity @s Motion[0] 1000 +execute store result score $mot_y gm4_aa_data run data get entity @s Motion[1] 1000 +execute store result score $mot_z gm4_aa_data run data get entity @s Motion[2] 1000 + +scoreboard players operation $mot_x_change gm4_aa_data = $mot_x gm4_aa_data +scoreboard players operation $mot_y_change gm4_aa_data = $mot_y gm4_aa_data +scoreboard players operation $mot_z_change gm4_aa_data = $mot_z gm4_aa_data +scoreboard players operation $mot_x_change gm4_aa_data *= $motion_reduction gm4_aa_data +scoreboard players operation $mot_y_change gm4_aa_data *= $motion_reduction gm4_aa_data +scoreboard players operation $mot_z_change gm4_aa_data *= $motion_reduction gm4_aa_data +scoreboard players operation $mot_x_change gm4_aa_data /= #100 gm4_aa_data +scoreboard players operation $mot_y_change gm4_aa_data /= #100 gm4_aa_data +scoreboard players operation $mot_z_change gm4_aa_data /= #100 gm4_aa_data +scoreboard players operation $mot_x gm4_aa_data += $mot_x_change gm4_aa_data +scoreboard players operation $mot_y gm4_aa_data += $mot_y_change gm4_aa_data +scoreboard players operation $mot_z gm4_aa_data += $mot_z_change gm4_aa_data + +execute store result entity @s Motion[0] double 0.001 run scoreboard players get $mot_x gm4_aa_data +execute store result entity @s Motion[1] double 0.001 run scoreboard players get $mot_y gm4_aa_data +execute store result entity @s Motion[2] double 0.001 run scoreboard players get $mot_z gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/silence_equip_sound.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/silence_equip_sound.mcfunction new file mode 100644 index 0000000000..ea6c33d4bf --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/silence_equip_sound.mcfunction @@ -0,0 +1,22 @@ +# stop the equip sound from playing when armor changes +# @s = player that is having their armor nbt change +# at unspecified +# run from armor/augment/type/convert/update +# run from armor/augment/type/linked/process/set_max_health +# run from armor/augment/type/psychic/damage_dealt/apply_durability +# run from item_modify_eval/chest_update +# run from item_modify_eval/feet_update +# run from item_modify_eval/head_update +# run from item_modify_eval/legs_update +# run from item_modify_eval/set_damage + +stopsound @s player item.armor.equip_chain +stopsound @s player item.armor.equip_diamond +stopsound @s player item.armor.equip_generic +stopsound @s player item.armor.equip_gold +stopsound @s player item.armor.equip_iron +stopsound @s player item.armor.equip_leather +stopsound @s player item.armor.equip_netherite +stopsound @s player item.armor.equip_turtle + +scoreboard players reset $change gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/slot/chest.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/slot/chest.mcfunction new file mode 100644 index 0000000000..cc8b4b89d4 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/slot/chest.mcfunction @@ -0,0 +1,23 @@ +# process the chestplate +# @s = player wearing the armor +# at @s +# run from armor/get_armor + +# store information +data modify storage gm4_augmented_armor:temp components set from storage gm4_augmented_armor:temp Items[{Slot:1b}].components +execute store result score $clocked gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.triggers.clocked +scoreboard players set $slot gm4_aa_data 1 + +# process augments that require processing +execute if score $trigger.clocked gm4_aa_data matches 1 if score $clocked gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/clocked +execute if score $trigger.damage_dealt gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/damage_dealt +execute if score $trigger.damage_taken gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/damage_taken + +# check netherite +execute if predicate gm4_augmented_armor:technical/convert_netherite/chest run function gm4_augmented_armor:armor/convert_netherite + +# make changes +execute if score $change gm4_aa_data matches 1 run function gm4_augmented_armor:item_modify_eval/chest_update with storage gm4_augmented_armor:temp + +# cleanup +data remove storage gm4_augmented_armor:temp components diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/slot/feet.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/slot/feet.mcfunction new file mode 100644 index 0000000000..dacff7e8a3 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/slot/feet.mcfunction @@ -0,0 +1,23 @@ +# process the boots +# @s = player wearing the armor +# at @s +# run from armor/get_armor + +# store information +data modify storage gm4_augmented_armor:temp components set from storage gm4_augmented_armor:temp Items[{Slot:3b}].components +execute store result score $clocked gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.triggers.clocked +scoreboard players set $slot gm4_aa_data 3 + +# process augments that require processing +execute if score $trigger.clocked gm4_aa_data matches 1 if score $clocked gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/clocked +execute if score $trigger.damage_dealt gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/damage_dealt +execute if score $trigger.damage_taken gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/damage_taken + +# check netherite +execute if predicate gm4_augmented_armor:technical/convert_netherite/feet run function gm4_augmented_armor:armor/convert_netherite + +# make changes +execute if score $change gm4_aa_data matches 1 run function gm4_augmented_armor:item_modify_eval/feet_update with storage gm4_augmented_armor:temp + +# cleanup +data remove storage gm4_augmented_armor:temp components diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/slot/head.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/slot/head.mcfunction new file mode 100644 index 0000000000..cb1f3b575b --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/slot/head.mcfunction @@ -0,0 +1,24 @@ +# process the helmet +# @s = player wearing the armor +# at @s +# run from armor/get_armor + +# store information +data modify storage gm4_augmented_armor:temp components set from storage gm4_augmented_armor:temp Items[{Slot:0b}].components +execute store result score $clocked gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.triggers.clocked +scoreboard players set $slot gm4_aa_data 0 + +# process augments that require processing +execute if score $trigger.clocked gm4_aa_data matches 1 if score $clocked gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/clocked +execute if score $trigger.damage_dealt gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/damage_dealt +execute if score $trigger.damage_taken gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/damage_taken + +# check netherite +execute if predicate gm4_augmented_armor:technical/convert_netherite/head run function gm4_augmented_armor:armor/convert_netherite + +# make changes +data modify storage gm4_augmented_armor:temp store set from storage gm4_augmented_armor:temp components +execute if score $change gm4_aa_data matches 1 run function gm4_augmented_armor:item_modify_eval/head_update with storage gm4_augmented_armor:temp + +# cleanup +data remove storage gm4_augmented_armor:temp components diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/slot/legs.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/slot/legs.mcfunction new file mode 100644 index 0000000000..23a49b68b9 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/slot/legs.mcfunction @@ -0,0 +1,23 @@ +# process the leggings +# @s = player wearing the armor +# at @s +# run from armor/get_armor + +# store information +data modify storage gm4_augmented_armor:temp components set from storage gm4_augmented_armor:temp Items[{Slot:2b}].components +execute store result score $clocked gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.augment.triggers.clocked +scoreboard players set $slot gm4_aa_data 2 + +# process augments that require processing +execute if score $trigger.clocked gm4_aa_data matches 1 if score $clocked gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/clocked +execute if score $trigger.damage_dealt gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/damage_dealt +execute if score $trigger.damage_taken gm4_aa_data matches 1 run function gm4_augmented_armor:armor/augment/damage_taken + +# check netherite +execute if predicate gm4_augmented_armor:technical/convert_netherite/legs run function gm4_augmented_armor:armor/convert_netherite + +# make changes +execute if score $change gm4_aa_data matches 1 run function gm4_augmented_armor:item_modify_eval/legs_update with storage gm4_augmented_armor:temp + +# cleanup +data remove storage gm4_augmented_armor:temp components diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/armor_break.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/armor_break.mcfunction new file mode 100644 index 0000000000..e045854776 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/armor_break.mcfunction @@ -0,0 +1,9 @@ +# process a player that had their armor broken +# @s = damaged player +# at @s +# run from base survival_refightalized module, from function player/health/damaged/calculate_damage + +# augments +execute if items entity @s armor.* #gm4_survival_refightalized:armor[custom_data~{gm4_augmented_armor:{augment:{name:reactive}}}] run function gm4_augmented_armor:armor/augment/type/reactive/add_levels +execute if items entity @s armor.* #gm4_survival_refightalized:armor[custom_data~{gm4_augmented_armor:{augment:{name:bursting}}}] run function gm4_augmented_armor:armor/augment/type/bursting/add_levels +execute if items entity @s armor.* #gm4_survival_refightalized:armor[custom_data~{gm4_augmented_armor:{augment:{name:berserkers}}}] run function gm4_augmented_armor:armor/augment/type/berserkers/armor_break diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/clocked.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/clocked.mcfunction new file mode 100644 index 0000000000..d980b5e77d --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/clocked.mcfunction @@ -0,0 +1,28 @@ +# store armor information in storage and process them +# @s = player wearing armor with augments +# at @s +# run from player/process + +# store armor items to storage +item replace block 29999998 1 7134 container.0 from entity @s armor.head +item replace block 29999998 1 7134 container.1 from entity @s armor.chest +item replace block 29999998 1 7134 container.2 from entity @s armor.legs +item replace block 29999998 1 7134 container.3 from entity @s armor.feet +data modify storage gm4_augmented_armor:temp Items set from block 29999998 1 7134 Items +data remove block 29999998 1 7134 Items + +# check for custom attributes +execute if items entity @s armor.* #gm4_survival_refightalized:armor[custom_data~{gm4_augmented_armor:{custom_attribute:{armor_recharge:{}}}}] run function gm4_augmented_armor:armor/custom_attribute/armor_recharge_rate +execute if items entity @s armor.* #gm4_survival_refightalized:armor[custom_data~{gm4_augmented_armor:{custom_attribute:{regen_speed:{}}}}] run function gm4_augmented_armor:armor/custom_attribute/regeneration_speed + +# process armor +# runs for any augment so we can check for things like netherite upgrading +scoreboard players set $trigger.clocked gm4_aa_data 1 +execute if data storage gm4_augmented_armor:temp Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor run function gm4_augmented_armor:armor/slot/head +execute if data storage gm4_augmented_armor:temp Items[{Slot:1b}].components."minecraft:custom_data".gm4_augmented_armor run function gm4_augmented_armor:armor/slot/chest +execute if data storage gm4_augmented_armor:temp Items[{Slot:2b}].components."minecraft:custom_data".gm4_augmented_armor run function gm4_augmented_armor:armor/slot/legs +execute if data storage gm4_augmented_armor:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor run function gm4_augmented_armor:armor/slot/feet +scoreboard players set $trigger.clocked gm4_aa_data 0 + +# cleanup +data remove storage gm4_augmented_armor:temp Items diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/damage_dealt.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/damage_dealt.mcfunction new file mode 100644 index 0000000000..bdb6a5074c --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/damage_dealt.mcfunction @@ -0,0 +1,28 @@ +# store armor information in storage and process them +# @s = player wearing armor with augments +# at @s +advancement revoke @s only gm4_augmented_armor:damage_dealt +# run from player/in_pvp + +# | Prep for augments +# store attack speed +execute store result score $attribute.attack_speed gm4_aa_data run attribute @s minecraft:attack_speed get 10 + +# store armor items to storage +item replace block 29999998 1 7134 container.0 from entity @s armor.head +item replace block 29999998 1 7134 container.1 from entity @s armor.chest +item replace block 29999998 1 7134 container.2 from entity @s armor.legs +item replace block 29999998 1 7134 container.3 from entity @s armor.feet +data modify storage gm4_augmented_armor:temp Items set from block 29999998 1 7134 Items +data remove block 29999998 1 7134 Items + +# process armor +scoreboard players set $trigger.damage_dealt gm4_aa_data 1 +execute if data storage gm4_augmented_armor:temp Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor.augment.triggers{damage_dealt:1} run function gm4_augmented_armor:armor/slot/head +execute if data storage gm4_augmented_armor:temp Items[{Slot:1b}].components."minecraft:custom_data".gm4_augmented_armor.augment.triggers{damage_dealt:1} run function gm4_augmented_armor:armor/slot/chest +execute if data storage gm4_augmented_armor:temp Items[{Slot:2b}].components."minecraft:custom_data".gm4_augmented_armor.augment.triggers{damage_dealt:1} run function gm4_augmented_armor:armor/slot/legs +execute if data storage gm4_augmented_armor:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor.augment.triggers{damage_dealt:1} run function gm4_augmented_armor:armor/slot/feet +scoreboard players set $trigger.damage_dealt gm4_aa_data 0 + +# cleanup +data remove storage gm4_augmented_armor:temp Items diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/damage_taken.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/damage_taken.mcfunction new file mode 100644 index 0000000000..acff92a7fa --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/damage_taken.mcfunction @@ -0,0 +1,26 @@ +# store armor information in storage and process them +# @s = player wearing armor with augments +# at @s +# run from player/damage_taken + +# store armor items to storage +item replace block 29999998 1 7134 container.0 from entity @s armor.head +item replace block 29999998 1 7134 container.1 from entity @s armor.chest +item replace block 29999998 1 7134 container.2 from entity @s armor.legs +item replace block 29999998 1 7134 container.3 from entity @s armor.feet +data modify storage gm4_augmented_armor:temp Items set from block 29999998 1 7134 Items +data remove block 29999998 1 7134 Items + +# process armor +scoreboard players set $trigger.damage_taken gm4_aa_data 1 +execute if data storage gm4_augmented_armor:temp Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor.augment.triggers{damage_taken:1} run function gm4_augmented_armor:armor/slot/head +execute if data storage gm4_augmented_armor:temp Items[{Slot:1b}].components."minecraft:custom_data".gm4_augmented_armor.augment.triggers{damage_taken:1} run function gm4_augmented_armor:armor/slot/chest +execute if data storage gm4_augmented_armor:temp Items[{Slot:2b}].components."minecraft:custom_data".gm4_augmented_armor.augment.triggers{damage_taken:1} run function gm4_augmented_armor:armor/slot/legs +execute if data storage gm4_augmented_armor:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor.augment.triggers{damage_taken:1} run function gm4_augmented_armor:armor/slot/feet +scoreboard players set $trigger.damage_taken gm4_aa_data 0 + +# apply absorption +execute if score $reactive.add_absorption gm4_aa_data matches 1.. run function gm4_augmented_armor:armor/augment/type/reactive/add_absorption + +# cleanup +data remove storage gm4_augmented_armor:temp Items diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/fired_arrow.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/fired_arrow.mcfunction new file mode 100644 index 0000000000..fdf2dc218e --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/armor/trigger/fired_arrow.mcfunction @@ -0,0 +1,22 @@ +# process a player that shot an arrow +# @s = damaged player +# at @s +# run from base survival_refightalized module, from function mob/process/arrow/run + +# store armor for checking +item replace block 29999998 1 7134 container.0 from entity @s armor.head +item replace block 29999998 1 7134 container.1 from entity @s armor.chest +item replace block 29999998 1 7134 container.2 from entity @s armor.legs +item replace block 29999998 1 7134 container.3 from entity @s armor.feet +data modify storage gm4_augmented_armor:temp Items set from block 29999998 1 7134 Items +data remove block 29999998 1 7134 Items + +# apply custom attributes +execute if items entity @s armor.* #gm4_survival_refightalized:armor[custom_data~{gm4_augmented_armor:{custom_attribute:{arrow_damage:{}}}}] run function gm4_augmented_armor:armor/custom_attribute/arrow_damage +execute if items entity @s armor.* #gm4_survival_refightalized:armor[custom_data~{gm4_augmented_armor:{custom_attribute:{arrow_speed:{}}}}] run function gm4_augmented_armor:armor/custom_attribute/arrow_speed + +# archery +execute if items entity @s armor.* #gm4_survival_refightalized:armor[custom_data~{gm4_augmented_armor:{augment:{name:archery}}}] run function gm4_augmented_armor:armor/augment/type/archery/find_arrow + +# cleanup +data remove storage gm4_augmented_armor:temp Items diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/check_item.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/check_item.mcfunction new file mode 100644 index 0000000000..3aa18d61f7 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/check_item.mcfunction @@ -0,0 +1,14 @@ +# check items on ground for Augmented Armor items +# @s = item +# at unspecified +# run from tick + +# tag item as checked and try to process +tag @s add gm4_aa_item_checked +scoreboard players set $item_processed gm4_aa_data 0 + +# check for unidentified items +execute if items entity @s contents *[custom_data~{gm4_augmented_armor:{identified:0}}] at @s run function gm4_augmented_armor:identification/run + +# tag link armor +execute if score $item_processed gm4_aa_data matches 0 if data entity @s Item.components."minecraft:custom_data".gm4_augmented_armor.link_id run tag @s add gm4_aa_link.forming diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/clocks/temp/linked.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/clocks/temp/linked.mcfunction new file mode 100644 index 0000000000..602a3065ba --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/clocks/temp/linked.mcfunction @@ -0,0 +1,29 @@ +# use this tick clock only when needed +# @s = unspecified +# at unspecified +# schedule from amor/augment/type/linked/check +# schedule from here + +scoreboard players set $keep_tick.link gm4_aa_keep_tick 0 +# calculate hp for all players in this link +execute as @a[tag=gm4_aa_linked] run function gm4_survival_refightalized:player/health/calculate_hp + +# get links into storage +data modify storage gm4_augmented_armor:temp run_links set from storage gm4_augmented_armor:data active_links + +# always keep first entry, it is for unlicked (licked? yes, licked) linked pieces +data modify storage gm4_augmented_armor:temp rebuild_links set value [] +data modify storage gm4_augmented_armor:temp rebuild_links append from storage gm4_augmented_armor:temp run_links[0] +data remove storage gm4_augmented_armor:temp run_links[0] + +# process active links +execute if data storage gm4_augmented_armor:temp run_links[0] run function gm4_augmented_armor:armor/augment/type/linked/process/loop_links + +# put any still active links back +data modify storage gm4_augmented_armor:data active_links set from storage gm4_augmented_armor:temp rebuild_links +data remove storage gm4_augmented_armor:temp rebuild_links + +# only calc max health stuff once per 16t +scoreboard players set $link.calc_max_health gm4_aa_data 0 + +execute if score $keep_tick.link gm4_aa_keep_tick matches 1 run schedule function gm4_augmented_armor:clocks/temp/linked 1t diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/clocks/temp/psychic.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/clocks/temp/psychic.mcfunction new file mode 100644 index 0000000000..40179f1968 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/clocks/temp/psychic.mcfunction @@ -0,0 +1,13 @@ +# use this tick clock only when needed +# @s = unspecified +# at unspecified +# run from main +# schedule from here + +scoreboard players set $keep_tick.psychic gm4_aa_keep_tick 0 + +scoreboard players add $check.psychic gm4_aa_keep_tick 1 +execute as @a[predicate=gm4_augmented_armor:modified_armor/augment/psychic,gamemode=!spectator] at @s run function gm4_augmented_armor:armor/augment/type/psychic/prep +execute as @e[type=item_display,tag=gm4_aa_psychic.sword] unless score @s gm4_aa_keep_tick = $check.psychic gm4_aa_keep_tick run kill @s + +execute if score $keep_tick.psychic gm4_aa_keep_tick matches 1 run schedule function gm4_augmented_armor:clocks/temp/psychic 1t diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/clocks/temp/sparking.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/clocks/temp/sparking.mcfunction new file mode 100644 index 0000000000..59a95f87d3 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/clocks/temp/sparking.mcfunction @@ -0,0 +1,9 @@ +# use this tick clock only when needed +# @s = unspecified +# at unspecified +# schedule from armor/augment/type/spark/activate +# schedule from here + +scoreboard players set $keep_tick.sparking gm4_aa_keep_tick 0 +execute as @e[scores={gm4_aa_augment.sparking.static_stacks=1..}] at @s run function gm4_augmented_armor:armor/augment/type/sparking/tick +execute if score $keep_tick.sparking gm4_aa_keep_tick matches 1 run schedule function gm4_augmented_armor:clocks/temp/sparking 1t diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/clocks/temp/totemic.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/clocks/temp/totemic.mcfunction new file mode 100644 index 0000000000..20263035a3 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/clocks/temp/totemic.mcfunction @@ -0,0 +1,15 @@ +# clock totem processing +# @s = unspecified +# at unspecified +# scheduled from armor/augment/type/totemic/activate +# scheduled from here +# run from main + +scoreboard players set $keep_tick.totemic gm4_aa_keep_tick 0 + +execute as @a[tag=gm4_aa_totem_hasted] run function gm4_augmented_armor:armor/augment/type/totemic/haste/remove_buff +execute as @a[scores={gm4_aa_augment.totemic.strength_effect=1..}] run function gm4_augmented_armor:armor/augment/type/totemic/strength/remove_buff + +execute as @e[type=armor_stand,tag=gm4_aa_totem] at @s run function gm4_augmented_armor:armor/augment/type/totemic/process + +execute if score $keep_tick.totemic gm4_aa_keep_tick matches 1 run schedule function gm4_augmented_armor:clocks/temp/totemic 5s diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/debug/give_unidentified_set/chainmail.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/debug/give_unidentified_set/chainmail.mcfunction new file mode 100644 index 0000000000..d07b448e7b --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/debug/give_unidentified_set/chainmail.mcfunction @@ -0,0 +1,4 @@ +loot give @s loot gm4_augmented_armor:armor/material/chainmail/feet +loot give @s loot gm4_augmented_armor:armor/material/chainmail/legs +loot give @s loot gm4_augmented_armor:armor/material/chainmail/chest +loot give @s loot gm4_augmented_armor:armor/material/chainmail/head diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/debug/give_unidentified_set/diamond.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/debug/give_unidentified_set/diamond.mcfunction new file mode 100644 index 0000000000..114be1042c --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/debug/give_unidentified_set/diamond.mcfunction @@ -0,0 +1,4 @@ +loot give @s loot gm4_augmented_armor:armor/material/diamond/feet +loot give @s loot gm4_augmented_armor:armor/material/diamond/legs +loot give @s loot gm4_augmented_armor:armor/material/diamond/chest +loot give @s loot gm4_augmented_armor:armor/material/diamond/head diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/debug/give_unidentified_set/gold.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/debug/give_unidentified_set/gold.mcfunction new file mode 100644 index 0000000000..4cc75d8fcc --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/debug/give_unidentified_set/gold.mcfunction @@ -0,0 +1,4 @@ +loot give @s loot gm4_augmented_armor:armor/material/golden/feet +loot give @s loot gm4_augmented_armor:armor/material/golden/legs +loot give @s loot gm4_augmented_armor:armor/material/golden/chest +loot give @s loot gm4_augmented_armor:armor/material/golden/head diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/debug/give_unidentified_set/iron.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/debug/give_unidentified_set/iron.mcfunction new file mode 100644 index 0000000000..00bed46aef --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/debug/give_unidentified_set/iron.mcfunction @@ -0,0 +1,4 @@ +loot give @s loot gm4_augmented_armor:armor/material/iron/feet +loot give @s loot gm4_augmented_armor:armor/material/iron/legs +loot give @s loot gm4_augmented_armor:armor/material/iron/chest +loot give @s loot gm4_augmented_armor:armor/material/iron/head diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/debug/give_unidentified_set/leather.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/debug/give_unidentified_set/leather.mcfunction new file mode 100644 index 0000000000..31c2c47d4a --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/debug/give_unidentified_set/leather.mcfunction @@ -0,0 +1,4 @@ +loot give @s loot gm4_augmented_armor:armor/material/leather/feet +loot give @s loot gm4_augmented_armor:armor/material/leather/legs +loot give @s loot gm4_augmented_armor:armor/material/leather/chest +loot give @s loot gm4_augmented_armor:armor/material/leather/head diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/get_components.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/get_components.mcfunction new file mode 100644 index 0000000000..50fb081224 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/get_components.mcfunction @@ -0,0 +1,31 @@ + +$say $(pick) +# get levels for this augment, they are stored as the amount of items in slots +data remove block 29999998 1 7134 Items +$loot insert 29999998 1 7134 loot gm4_augmented_armor:armor/identification/augment/$(pick)/levels + +# store levels in storage and scores +data modify storage gm4_augmented_armor:temp augment.levels set value [0,0,0,0] + +execute store result score $level_1 gm4_aa_data run data get block 29999998 1 7134 Items[0].count +execute store result score $level_1_mult gm4_aa_data run data get block 29999998 1 7134 Items[0].components."minecraft:custom_data".gm4_augmented_armor.multiplier +execute unless score $level_1_mult gm4_aa_data matches 0..1 run scoreboard players operation $level_1 gm4_aa_data *= $level_1_mult gm4_aa_data +execute store result storage gm4_augmented_armor:temp augment.levels[0] int 1 run scoreboard players get $level_1 gm4_aa_data + +execute store result score $level_2 gm4_aa_data run data get block 29999998 1 7134 Items[1].count +execute store result score $level_2_mult gm4_aa_data run data get block 29999998 1 7134 Items[1].components."minecraft:custom_data".gm4_augmented_armor.multiplier +execute unless score $level_2_mult gm4_aa_data matches 0..1 run scoreboard players operation $level_2 gm4_aa_data *= $level_2_mult gm4_aa_data +execute store result storage gm4_augmented_armor:temp augment.levels[1] int 1 run scoreboard players get $level_2 gm4_aa_data + +execute store result score $level_3 gm4_aa_data run data get block 29999998 1 7134 Items[2].count +execute store result score $level_3_mult gm4_aa_data run data get block 29999998 1 7134 Items[2].components."minecraft:custom_data".gm4_augmented_armor.multiplier +execute unless score $level_3_mult gm4_aa_data matches 0..1 run scoreboard players operation $level_3 gm4_aa_data *= $level_3_mult gm4_aa_data +execute store result storage gm4_augmented_armor:temp augment.levels[2] int 1 run scoreboard players get $level_3 gm4_aa_data + +execute store result score $level_4 gm4_aa_data run data get block 29999998 1 7134 Items[3].count +execute store result score $level_4_mult gm4_aa_data run data get block 29999998 1 7134 Items[3].components."minecraft:custom_data".gm4_augmented_armor.multiplier +execute unless score $level_4_mult gm4_aa_data matches 0..1 run scoreboard players operation $level_4 gm4_aa_data *= $level_4_mult gm4_aa_data +execute store result storage gm4_augmented_armor:temp augment.levels[3] int 1 run scoreboard players get $level_4 gm4_aa_data + +# get components to use for this item, run as player for components requiring resolution +$execute as @p run loot replace block 29999998 1 7134 container.0 loot gm4_augmented_armor:armor/identification/augment/$(pick)/components diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/run.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/run.mcfunction new file mode 100644 index 0000000000..b9ff23fdf0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/run.mcfunction @@ -0,0 +1,52 @@ +# prepare identifying item +# @s = unidentified item +# at @s +# run from check_item + +# put data in storage +data modify storage gm4_augmented_armor:temp components set from entity @s Item.components +# get material and slot of this armor +execute store result score $material gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.material +execute store result score $set_slot gm4_aa_data run data get storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.slot + +# pick a random augment, unless one was already set +loot replace block 29999998 1 7134 container.0 loot gm4_augmented_armor:armor/identification/random +execute unless data storage gm4_augmented_armor:temp augment.pick run data modify storage gm4_augmented_armor:temp augment.pick set from block 29999998 1 7134 Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor.set_augment + +# get component data for this augment +function gm4_augmented_armor:identification/get_components with storage gm4_augmented_armor:temp augment +data modify storage gm4_augmented_armor:temp new_components set from block 29999998 1 7134 Items[{Slot:0b}].components + +# merge components from item +data modify storage gm4_augmented_armor:temp new_components."minecraft:damage" merge from storage gm4_augmented_armor:temp components."minecraft:damage" +data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers append from storage gm4_augmented_armor:temp components."minecraft:attribute_modifiers".modifiers[] +data modify storage gm4_augmented_armor:temp new_components."minecraft:enchantments" merge from storage gm4_augmented_armor:temp components."minecraft:enchantments" + +# get slot to use for attribute_modifiers +execute if score $set_slot gm4_aa_data matches 0 run function gm4_augmented_armor:identification/set_attribute/modifiers_head +execute if score $set_slot gm4_aa_data matches 1 run function gm4_augmented_armor:identification/set_attribute/modifiers_chest +execute if score $set_slot gm4_aa_data matches 2 run function gm4_augmented_armor:identification/set_attribute/modifiers_legs +execute if score $set_slot gm4_aa_data matches 3 run function gm4_augmented_armor:identification/set_attribute/modifiers_feet +# apply levels to custom attributes +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.armor_recharge run function gm4_augmented_armor:identification/set_attribute/armor_recharge +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed run function gm4_augmented_armor:identification/set_attribute/regen_speed +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_damage run function gm4_augmented_armor:identification/set_attribute/arrow_damage +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_speed run function gm4_augmented_armor:identification/set_attribute/arrow_speed + +# merge components into item +data modify storage gm4_augmented_armor:temp components merge from storage gm4_augmented_armor:temp new_components + +# mark as identified +data modify storage gm4_augmented_armor:temp components."minecraft:custom_data".gm4_augmented_armor.identified set value 1 + +# remove durability damage taken +data modify storage gm4_augmented_armor:temp components."minecraft:damage" set value 0 + +# update item +data modify entity @s Item.components set from storage gm4_augmented_armor:temp components + +# cleanup +data remove block 29999998 1 7134 Items +data remove storage gm4_augmented_armor:temp augment +data remove storage gm4_augmented_armor:temp new_components +data remove storage gm4_augmented_armor:temp components diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/armor_recharge.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/armor_recharge.mcfunction new file mode 100644 index 0000000000..68fe21a5bb --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/armor_recharge.mcfunction @@ -0,0 +1,5 @@ + +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.armor_recharge{value:'level_1'} store result storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.armor_recharge.value int 1 run scoreboard players get $level_1 gm4_aa_data +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.armor_recharge{value:'level_2'} store result storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.armor_recharge.value int 1 run scoreboard players get $level_2 gm4_aa_data +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.armor_recharge{value:'level_3'} store result storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.armor_recharge.value int 1 run scoreboard players get $level_3 gm4_aa_data +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.armor_recharge{value:'level_4'} store result storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.armor_recharge.value int 1 run scoreboard players get $level_4 gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/arrow_damage.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/arrow_damage.mcfunction new file mode 100644 index 0000000000..1279ad0160 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/arrow_damage.mcfunction @@ -0,0 +1,5 @@ + +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_damage{value:'level_1'} store result storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_damage.value int 1 run scoreboard players get $level_1 gm4_aa_data +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_damage{value:'level_2'} store result storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_damage.value int 1 run scoreboard players get $level_2 gm4_aa_data +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_damage{value:'level_3'} store result storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_damage.value int 1 run scoreboard players get $level_3 gm4_aa_data +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_damage{value:'level_4'} store result storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_damage.value int 1 run scoreboard players get $level_4 gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/arrow_speed.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/arrow_speed.mcfunction new file mode 100644 index 0000000000..7ce0659379 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/arrow_speed.mcfunction @@ -0,0 +1,5 @@ + +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_speed{value:'level_1'} store result storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_speed.value int 1 run scoreboard players get $level_1 gm4_aa_data +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_speed{value:'level_2'} store result storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_speed.value int 1 run scoreboard players get $level_2 gm4_aa_data +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_speed{value:'level_3'} store result storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_speed.value int 1 run scoreboard players get $level_3 gm4_aa_data +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_speed{value:'level_4'} store result storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.arrow_speed.value int 1 run scoreboard players get $level_4 gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/modifiers_chest.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/modifiers_chest.mcfunction new file mode 100644 index 0000000000..d056879c73 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/modifiers_chest.mcfunction @@ -0,0 +1,14 @@ + +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent"}] merge value {id:"gm4_augmented_armor:chest.permanent",slot:"chest"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_2"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_2"}] merge value {id:"gm4_augmented_armor:chest.permanent_2",slot:"chest"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_3"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_3"}] merge value {id:"gm4_augmented_armor:chest.permanent_3",slot:"chest"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_4"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_4"}] merge value {id:"gm4_augmented_armor:chest.permanent_4",slot:"chest"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_5"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_5"}] merge value {id:"gm4_augmented_armor:chest.permanent_5",slot:"chest"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_6"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_6"}] merge value {id:"gm4_augmented_armor:chest.permanent_6",slot:"chest"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_7"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_7"}] merge value {id:"gm4_augmented_armor:chest.permanent_7",slot:"chest"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_8"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_8"}] merge value {id:"gm4_augmented_armor:chest.permanent_8",slot:"chest"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_9"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_9"}] merge value {id:"gm4_augmented_armor:chest.permanent_9",slot:"chest"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic"}] merge value {id:"gm4_augmented_armor:chest.dynamic",slot:"chest"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_2"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_2"}] merge value {id:"gm4_augmented_armor:chest.dynamic_2",slot:"chest"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_3"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_3"}] merge value {id:"gm4_augmented_armor:chest.dynamic_3",slot:"chest"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_4"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_4"}] merge value {id:"gm4_augmented_armor:chest.dynamic_4",slot:"chest"} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/modifiers_feet.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/modifiers_feet.mcfunction new file mode 100644 index 0000000000..bc361397ad --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/modifiers_feet.mcfunction @@ -0,0 +1,14 @@ + +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent"}] merge value {id:"gm4_augmented_armor:feet.permanent",slot:"feet"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_2"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_2"}] merge value {id:"gm4_augmented_armor:feet.permanent_2",slot:"feet"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_3"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_3"}] merge value {id:"gm4_augmented_armor:feet.permanent_3",slot:"feet"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_4"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_4"}] merge value {id:"gm4_augmented_armor:feet.permanent_4",slot:"feet"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_5"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_5"}] merge value {id:"gm4_augmented_armor:feet.permanent_5",slot:"feet"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_6"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_6"}] merge value {id:"gm4_augmented_armor:feet.permanent_6",slot:"feet"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_7"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_7"}] merge value {id:"gm4_augmented_armor:feet.permanent_7",slot:"feet"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_8"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_8"}] merge value {id:"gm4_augmented_armor:feet.permanent_8",slot:"feet"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_9"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_9"}] merge value {id:"gm4_augmented_armor:feet.permanent_9",slot:"feet"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic"}] merge value {id:"gm4_augmented_armor:feet.dynamic",slot:"feet"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_2"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_2"}] merge value {id:"gm4_augmented_armor:feet.dynamic_2",slot:"feet"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_3"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_3"}] merge value {id:"gm4_augmented_armor:feet.dynamic_3",slot:"feet"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_4"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_4"}] merge value {id:"gm4_augmented_armor:feet.dynamic_4",slot:"feet"} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/modifiers_head.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/modifiers_head.mcfunction new file mode 100644 index 0000000000..e900ae3204 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/modifiers_head.mcfunction @@ -0,0 +1,14 @@ + +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent"}] merge value {id:"gm4_augmented_armor:head.permanent",slot:"head"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_2"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_2"}] merge value {id:"gm4_augmented_armor:head.permanent_2",slot:"head"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_3"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_3"}] merge value {id:"gm4_augmented_armor:head.permanent_3",slot:"head"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_4"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_4"}] merge value {id:"gm4_augmented_armor:head.permanent_4",slot:"head"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_5"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_5"}] merge value {id:"gm4_augmented_armor:head.permanent_5",slot:"head"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_6"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_6"}] merge value {id:"gm4_augmented_armor:head.permanent_6",slot:"head"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_7"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_7"}] merge value {id:"gm4_augmented_armor:head.permanent_7",slot:"head"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_8"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_8"}] merge value {id:"gm4_augmented_armor:head.permanent_8",slot:"head"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_9"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_9"}] merge value {id:"gm4_augmented_armor:head.permanent_9",slot:"head"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic"}] merge value {id:"gm4_augmented_armor:head.dynamic",slot:"head"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_2"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_2"}] merge value {id:"gm4_augmented_armor:head.dynamic_2",slot:"head"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_3"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_3"}] merge value {id:"gm4_augmented_armor:head.dynamic_3",slot:"head"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_4"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_4"}] merge value {id:"gm4_augmented_armor:head.dynamic_4",slot:"head"} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/modifiers_legs.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/modifiers_legs.mcfunction new file mode 100644 index 0000000000..e90ccf86a2 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/modifiers_legs.mcfunction @@ -0,0 +1,14 @@ + +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent"}] merge value {id:"gm4_augmented_armor:legs.permanent",slot:"legs"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_2"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_2"}] merge value {id:"gm4_augmented_armor:legs.permanent_2",slot:"legs"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_3"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_3"}] merge value {id:"gm4_augmented_armor:legs.permanent_3",slot:"legs"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_4"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_4"}] merge value {id:"gm4_augmented_armor:legs.permanent_4",slot:"legs"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_5"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_5"}] merge value {id:"gm4_augmented_armor:legs.permanent_5",slot:"legs"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_6"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_6"}] merge value {id:"gm4_augmented_armor:legs.permanent_6",slot:"legs"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_7"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_7"}] merge value {id:"gm4_augmented_armor:legs.permanent_7",slot:"legs"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_8"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_8"}] merge value {id:"gm4_augmented_armor:legs.permanent_8",slot:"legs"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_9"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:permanent_9"}] merge value {id:"gm4_augmented_armor:legs.permanent_9",slot:"legs"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic"}] merge value {id:"gm4_augmented_armor:legs.dynamic",slot:"legs"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_2"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_2"}] merge value {id:"gm4_augmented_armor:legs.dynamic_2",slot:"legs"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_3"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_3"}] merge value {id:"gm4_augmented_armor:legs.dynamic_3",slot:"legs"} +execute if data storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_4"}] run data modify storage gm4_augmented_armor:temp new_components."minecraft:attribute_modifiers".modifiers[{id:"gm4_augmented_armor:dynamic_4"}] merge value {id:"gm4_augmented_armor:legs.dynamic_4",slot:"legs"} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/regen_speed.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/regen_speed.mcfunction new file mode 100644 index 0000000000..9560f369de --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/identification/set_attribute/regen_speed.mcfunction @@ -0,0 +1,5 @@ + +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed{value:'level_1'} store result storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed.value int 1 run scoreboard players get $level_1 gm4_aa_data +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed{value:'level_2'} store result storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed.value int 1 run scoreboard players get $level_2 gm4_aa_data +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed{value:'level_3'} store result storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed.value int 1 run scoreboard players get $level_3 gm4_aa_data +execute if data storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed{value:'level_4'} store result storage gm4_augmented_armor:temp new_components."minecraft:custom_data".gm4_augmented_armor.custom_attribute.regen_speed.value int 1 run scoreboard players get $level_4 gm4_aa_data diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/init.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/init.mcfunction new file mode 100644 index 0000000000..95a765a5f2 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/init.mcfunction @@ -0,0 +1,87 @@ +execute unless score augmented_armor gm4_modules matches 1 run data modify storage gm4:log queue append value {type:"install",module:"Augmented Armor"} +execute unless score augmented_armor gm4_earliest_version < augmented_armor gm4_modules run scoreboard players operation augmented_armor gm4_earliest_version = augmented_armor gm4_modules +scoreboard players set augmented_armor gm4_modules 1 + +# reset all links +data modify storage gm4_augmented_armor:data active_links set value [{id:-1,name:{"translate":"item.gm4.augmented_armor.name.link","fallback":"Unlinked %s","with":[{"translate":"item.minecraft.iron_chestplate","italic":false}],"italic":false,"color":"light_purple"}}] + +# scoreboards +scoreboard objectives add gm4_aa_data dummy +scoreboard objectives add gm4_aa_id dummy +scoreboard objectives add gm4_aa_in_pvp dummy +scoreboard objectives add gm4_aa_in_combat dummy +scoreboard objectives add gm4_aa_keep_tick dummy + +scoreboard objectives add gm4_aa_stat.damage_taken minecraft.custom:minecraft.damage_taken +scoreboard objectives add gm4_aa_stat.kills minecraft.custom:minecraft.mob_kills +scoreboard objectives add gm4_aa_stat.kills_add minecraft.custom:minecraft.player_kills +scoreboard objectives add gm4_aa_stat.sprint_one_cm minecraft.custom:minecraft.sprint_one_cm +scoreboard objectives add gm4_aa_stat.swim_one_cm minecraft.custom:minecraft.swim_one_cm +scoreboard objectives add gm4_aa_stat.used_bow minecraft.used:minecraft.bow +scoreboard objectives add gm4_aa_stat.used_crossbow minecraft.used:minecraft.crossbow +scoreboard objectives add gm4_aa_stat.armor armor +scoreboard objectives add gm4_aa_stat.damage_dealt minecraft.custom:minecraft.damage_dealt +scoreboard objectives add gm4_aa_stat.damage_dealt_add minecraft.custom:minecraft.damage_absorbed +scoreboard objectives add gm4_aa_stat.damage_dealt_resisted minecraft.custom:minecraft.damage_dealt_resisted + +scoreboard objectives add gm4_aa_augment.link.id dummy +scoreboard objectives add gm4_aa_augment.link.slot dummy +scoreboard objectives add gm4_aa_augment.link.max_health dummy + +scoreboard objectives add gm4_aa_augment.equine.speed_level dummy +scoreboard objectives add gm4_aa_augment.psychic.id dummy +scoreboard objectives add gm4_aa_augment.psychic.degree dummy +scoreboard objectives add gm4_aa_augment.totemic.strength_effect dummy +scoreboard objectives add gm4_aa_augment.canine.timer dummy +scoreboard objectives add gm4_aa_augment.canine.slot dummy +scoreboard objectives add gm4_aa_augment.dashing.timer dummy +scoreboard objectives add gm4_aa_augment.dashing.timeout dummy +scoreboard objectives add gm4_aa_augment.dashing.pieces_equipped dummy +scoreboard objectives add gm4_aa_augment.rejuvenating.stored_health dummy +scoreboard objectives add gm4_aa_augment.sparking.static_stacks dummy +scoreboard objectives add gm4_aa_augment.sparking.timer dummy +scoreboard objectives add gm4_aa_augment.sparking.deg dummy +scoreboard objectives add gm4_aa_augment.sparking.striking_timer dummy +scoreboard objectives add gm4_aa_augment.berserkers.timer dummy + +scoreboard objectives add gm4_aa_training_dummy.dps dummy +scoreboard objectives add gm4_aa_training_dummy.total_damage dummy +scoreboard objectives add gm4_aa_training_dummy.timer dummy + +# constants +scoreboard players set #-1 gm4_aa_data -1 +scoreboard players set #0 gm4_aa_data 0 +scoreboard players set #1 gm4_aa_data 1 +scoreboard players set #2 gm4_aa_data 2 +scoreboard players set #3 gm4_aa_data 3 +scoreboard players set #4 gm4_aa_data 4 +scoreboard players set #5 gm4_aa_data 5 +scoreboard players set #7 gm4_aa_data 7 +scoreboard players set #8 gm4_aa_data 8 +scoreboard players set #10 gm4_aa_data 10 +scoreboard players set #11 gm4_aa_data 11 +scoreboard players set #13 gm4_aa_data 13 +scoreboard players set #14 gm4_aa_data 14 +scoreboard players set #15 gm4_aa_data 15 +scoreboard players set #16 gm4_aa_data 16 +scoreboard players set #17 gm4_aa_data 17 +scoreboard players set #20 gm4_aa_data 20 +scoreboard players set #21 gm4_aa_data 21 +scoreboard players set #25 gm4_aa_data 25 +scoreboard players set #30 gm4_aa_data 30 +scoreboard players set #35 gm4_aa_data 35 +scoreboard players set #40 gm4_aa_data 40 +scoreboard players set #50 gm4_aa_data 50 +scoreboard players set #64 gm4_aa_data 64 +scoreboard players set #75 gm4_aa_data 75 +scoreboard players set #80 gm4_aa_data 80 +scoreboard players set #90 gm4_aa_data 90 +scoreboard players set #100 gm4_aa_data 100 +scoreboard players set #125 gm4_aa_data 125 +scoreboard players set #1000 gm4_aa_data 1000 +scoreboard players set #1875 gm4_aa_data 1875 +scoreboard players set #6000 gm4_aa_data 6000 + +# start clocks +schedule function gm4_augmented_armor:tick 1t +schedule function gm4_augmented_armor:slow_clock 1t diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/item_modify_eval/chest_update.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/item_modify_eval/chest_update.mcfunction new file mode 100644 index 0000000000..0d14184b53 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/item_modify_eval/chest_update.mcfunction @@ -0,0 +1,9 @@ +# update chestplate with data in storage +# @s = player wearing the item +# at unspecified +# run from armor/augment/type/hearty/update +# run from armor/augment/type/linked/process/set_max_health +# run from armor/slot/chest + +$item modify entity @s armor.chest {function:"minecraft:set_components",components:$(components)} +function gm4_augmented_armor:armor/silence_equip_sound diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/item_modify_eval/feet_update.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/item_modify_eval/feet_update.mcfunction new file mode 100644 index 0000000000..b2fe805109 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/item_modify_eval/feet_update.mcfunction @@ -0,0 +1,9 @@ +# update boots with data in storage +# @s = player wearing the item +# at unspecified +# run from armor/augment/type/hearty/update +# run from armor/augment/type/linked/process/set_max_health +# run from armor/slot/feet + +$item modify entity @s armor.feet {function:"minecraft:set_components",components:$(components)} +function gm4_augmented_armor:armor/silence_equip_sound diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/item_modify_eval/head_update.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/item_modify_eval/head_update.mcfunction new file mode 100644 index 0000000000..4187e3dfd2 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/item_modify_eval/head_update.mcfunction @@ -0,0 +1,9 @@ +# update boots with data in storage +# @s = player wearing the item +# at unspecified +# run from armor/augment/type/hearty/update +# run from armor/augment/type/linked/process/set_max_health +# run from armor/slot/head + +$item modify entity @s armor.head {function:"minecraft:set_components",components:$(components)} +function gm4_augmented_armor:armor/silence_equip_sound diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/item_modify_eval/legs_update.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/item_modify_eval/legs_update.mcfunction new file mode 100644 index 0000000000..81204cb3e2 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/item_modify_eval/legs_update.mcfunction @@ -0,0 +1,9 @@ +# update leggings with data in storage +# @s = player wearing the item +# at unspecified +# run from armor/augment/type/hearty/update +# run from armor/augment/type/linked/process/set_max_health +# run from armor/slot/legs + +$item modify entity @s armor.legs {function:"minecraft:set_components",components:$(components)} +function gm4_augmented_armor:armor/silence_equip_sound diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/item_modify_eval/set_damage.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/item_modify_eval/set_damage.mcfunction new file mode 100644 index 0000000000..9cc9008bf5 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/item_modify_eval/set_damage.mcfunction @@ -0,0 +1,10 @@ +# set damage on armor item +# @s = player wearing the item +# at unspecified +# run from armor/augment/type/psychic/damage_dealt/apply_durability + +$execute if score $slot gm4_aa_data matches 0 run item modify entity @s armor.head {function:"minecraft:set_components",components:{"minecraft:damage":$(damage)}} +$execute if score $slot gm4_aa_data matches 1 run item modify entity @s armor.chest {function:"minecraft:set_components",components:{"minecraft:damage":$(damage)}} +$execute if score $slot gm4_aa_data matches 2 run item modify entity @s armor.legs {function:"minecraft:set_components",components:{"minecraft:damage":$(damage)}} +$execute if score $slot gm4_aa_data matches 3 run item modify entity @s armor.feet {function:"minecraft:set_components",components:{"minecraft:damage":$(damage)}} +function gm4_augmented_armor:armor/silence_equip_sound diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/main.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/main.mcfunction new file mode 100644 index 0000000000..965cee149c --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/main.mcfunction @@ -0,0 +1,12 @@ +# main function +# @s = unspecified +# at unspecified +# run from base survival_refightalized module, from function main + +# | Armor +# process canine set wolves +execute as @e[type=wolf,tag=gm4_aa_wolf] run function gm4_augmented_armor:armor/augment/type/canine/wolf_process +# psychic +execute unless score $keep_tick.psychic gm4_aa_keep_tick matches 1 if entity @a[predicate=gm4_augmented_armor:modified_armor/augment/psychic,gamemode=!spectator] run function gm4_augmented_armor:clocks/temp/psychic +# totem +execute unless score $keep_tick.totemic gm4_aa_keep_tick matches 1 if entity @e[type=armor_stand,tag=gm4_aa_totem] run function gm4_augmented_armor:clocks/temp/totemic diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/player/clear_immunities.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/player/clear_immunities.mcfunction new file mode 100644 index 0000000000..a4329f1a86 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/player/clear_immunities.mcfunction @@ -0,0 +1,17 @@ +# remove immunity tags from player +# @s = player with gm4_aa_effect_immunity.active tag +# at unspecified +# run from player/process + +tag @s remove gm4_aa_effect_immunity.active + +tag @s remove gm4_aa_effect_immunity.mining_fatigue +tag @s remove gm4_aa_effect_immunity.poison +tag @s remove gm4_aa_effect_immunity.wither +tag @s remove gm4_aa_effect_immunity.hunger +tag @s remove gm4_aa_effect_immunity.blind +tag @s remove gm4_aa_effect_immunity.nausea +tag @s remove gm4_aa_effect_immunity.weakness +tag @s remove gm4_aa_effect_immunity.levitation +tag @s remove gm4_aa_effect_immunity.slow_falling +tag @s remove gm4_aa_effect_immunity.slowness diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/player/combat_regeneration/on_apply.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/player/combat_regeneration/on_apply.mcfunction new file mode 100644 index 0000000000..870c4eacb6 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/player/combat_regeneration/on_apply.mcfunction @@ -0,0 +1,4 @@ +# process a player that regenerated health from combat regeneration +# @s = damaged player +# at @s +# run from base survival_refightalized module, from function player/health/damaged/run diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/player/damage_taken.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/player/damage_taken.mcfunction new file mode 100644 index 0000000000..9750c09c57 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/player/damage_taken.mcfunction @@ -0,0 +1,10 @@ +# process a player that took damage (after damage is processed) +# @s = damaged player +# at @s +# run from base survival_refightalized module, from function player/health/damaged/run + +# set the player to be in combat for ~10 seconds +scoreboard players set @s[advancements={gm4_survival_refightalized:damaged={combat_damage=true}}] gm4_aa_in_combat 13 + +# trigger augments that run from taking damage +execute if entity @s[predicate=gm4_augmented_armor:modified_armor/generic_damage_taken] run function gm4_augmented_armor:armor/trigger/damage_taken diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/player/effect_immunity.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/player/effect_immunity.mcfunction new file mode 100644 index 0000000000..aefb782869 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/player/effect_immunity.mcfunction @@ -0,0 +1,18 @@ +# clear effects depending on player tags from armor +# @s = player with immunity +# at unspecified +advancement revoke @s only gm4_augmented_armor:effect_immunity + +# clear effects +effect clear @s[tag=gm4_aa_effect_immunity.mining_fatigue] mining_fatigue +effect clear @s[tag=gm4_aa_effect_immunity.wither] wither +effect clear @s[tag=gm4_aa_effect_immunity.poison] poison + +effect clear @s[tag=gm4_aa_effect_immunity.hunger] hunger +effect clear @s[tag=gm4_aa_effect_immunity.blind] blindness +effect clear @s[tag=gm4_aa_effect_immunity.nausea] nausea +effect clear @s[tag=gm4_aa_effect_immunity.weakness] weakness + +effect clear @s[tag=gm4_aa_effect_immunity.levitation] levitation +effect clear @s[tag=gm4_aa_effect_immunity.slow_falling] slow_falling +effect clear @s[tag=gm4_aa_effect_immunity.slowness] slowness diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/player/give_id.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/player/give_id.mcfunction new file mode 100644 index 0000000000..7880b7812e --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/player/give_id.mcfunction @@ -0,0 +1,6 @@ +# give every player a unique id +# @s = new player +# at unspecified +# run from advancement give_id + +execute store result score @s gm4_aa_id run scoreboard players add $next gm4_aa_id 1 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/player/in_pvp.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/player/in_pvp.mcfunction new file mode 100644 index 0000000000..d66e09c2fb --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/player/in_pvp.mcfunction @@ -0,0 +1,13 @@ +# add a timer for this player to be in pvp so they can be hit with certain augments +# @s = player damaging or being damaged by a player +# at @s +# run from advancement in_pvp + +# if damaged a non-pvp player also activate damage dealt manually +execute if entity @s[advancements={gm4_augmented_armor:in_pvp={damage_pvp_player=true}},predicate=gm4_augmented_armor:modified_armor/generic_damage_dealt] run function gm4_augmented_armor:armor/trigger/damage_dealt + +# revoke advancement +advancement revoke @s only gm4_augmented_armor:in_pvp + +# set a pvp timer for 32 seconds +scoreboard players set @s gm4_aa_in_pvp 40 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/player/player_submain.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/player/player_submain.mcfunction new file mode 100644 index 0000000000..4f6f67333f --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/player/player_submain.mcfunction @@ -0,0 +1,33 @@ +# process anything player related +# @s = unspecified +# at unspecified +# run from base survival_refightalized module, from function clocks/player_submain + +# prep link armor +##scoreboard players set $link.calc_max_health gm4_aa_data 1 +##tag @a remove gm4_aa_linked +##scoreboard players reset @a gm4_aa_augment.link.id + +# process players +execute as @a[gamemode=!spectator] run function gm4_augmented_armor:player/process + +# linked armor after player processing +##tag @a[tag=!gm4_aa_linked] remove gm4_aa_was_linked + +# apply equine speed effect +execute as @a on vehicle if score @s gm4_aa_augment.equine.speed_level matches 1.. run function gm4_augmented_armor:armor/augment/type/equine/apply_effect + +# timers +scoreboard players remove @a[scores={gm4_aa_in_combat=1..}] gm4_aa_in_combat 1 +scoreboard players remove @a[scores={gm4_aa_augment.canine.timer=1..}] gm4_aa_augment.canine.timer 1 +scoreboard players remove @a[scores={gm4_aa_augment.berserkers.timer=1..}] gm4_aa_augment.berserkers.timer 1 +scoreboard players remove @a[scores={gm4_aa_in_pvp=1..}] gm4_aa_in_pvp 1 + +# reset scoreboards +scoreboard players reset @a gm4_aa_stat.damage_taken +scoreboard players reset @a gm4_aa_stat.kills +scoreboard players reset @a gm4_aa_stat.kills_add +scoreboard players reset @a gm4_aa_stat.damage_dealt +scoreboard players reset @a gm4_aa_stat.damage_dealt_add +scoreboard players reset @a gm4_aa_stat.sprint_one_cm +scoreboard players reset @a gm4_aa_stat.swim_one_cm diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/player/process.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/player/process.mcfunction new file mode 100644 index 0000000000..1cd71c20ba --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/player/process.mcfunction @@ -0,0 +1,22 @@ +# process player +# @s = online player +# at unspecified +# run from player/player_submain + +# add player kills and mob kills together +scoreboard players operation @s gm4_aa_stat.kills += @s gm4_aa_stat.kills_add +# add red heart and absorption damage together +scoreboard players operation @s gm4_aa_stat.damage_dealt += @s gm4_aa_stat.damage_dealt_add + +# remove dashing sprint score if player didn't sprint for too long +execute unless score @s gm4_aa_stat.sprint_one_cm matches 1.. run scoreboard players add @s[scores={gm4_aa_augment.dashing.timer=1..}] gm4_aa_augment.dashing.timeout 1 +scoreboard players reset @s[scores={gm4_aa_augment.dashing.timeout=3..,gm4_aa_augment.dashing.timer=1..}] gm4_aa_augment.dashing.timer +scoreboard players add @s[scores={gm4_aa_augment.dashing.timer=..-1}] gm4_aa_augment.dashing.timer 1 +scoreboard players reset @s gm4_aa_augment.dashing.pieces_equipped + +# remove tags +##tag @s remove gm4_aa_linked +execute if entity @s[tag=gm4_aa_effect_immunity.active] run function gm4_augmented_armor:player/clear_immunities + +# process armor augments +execute if items entity @s armor.* #gm4_survival_refightalized:armor[custom_data~{gm4_augmented_armor:{}}] at @s run function gm4_augmented_armor:armor/trigger/clocked diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/slow_clock.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/slow_clock.mcfunction new file mode 100644 index 0000000000..bba0d98e53 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/slow_clock.mcfunction @@ -0,0 +1,5 @@ +schedule function gm4_augmented_armor:slow_clock 30s + +# cleanup totems +execute as @e[type=armor_stand,tag=gm4_aa_totem] at @s unless entity @a[distance=..32,gamemode=!spectator] run function gm4_augmented_armor:armor/augment/type/totemic/remove +execute as @e[type=block_display,tag=gm4_aa_totem_display] at @s unless entity @e[type=armor_stand,tag=gm4_aa_totem,distance=..5] run kill @s diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/tick.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/tick.mcfunction new file mode 100644 index 0000000000..4e9dd4959e --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/tick.mcfunction @@ -0,0 +1,7 @@ +schedule function gm4_augmented_armor:tick 1t + +# check for items on the ground +execute as @e[type=item,tag=!gm4_aa_item_checked] run function gm4_augmented_armor:check_item + +# training dummy +execute as @e[type=zombie,tag=gm4_aa_training_dummy] run function gm4_augmented_armor:training_dummy/process diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/damage_dealt.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/damage_dealt.mcfunction new file mode 100644 index 0000000000..9a4927b245 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/damage_dealt.mcfunction @@ -0,0 +1,16 @@ + +# add new entry to dps_array +data modify storage gm4_augmented_armor:temp dps.new set value {gametime:0,damage:0} +execute store result storage gm4_augmented_armor:temp dps.new.gametime int 1 run scoreboard players get $gametime gm4_aa_data +execute store result storage gm4_augmented_armor:temp dps.new.damage int 1 run scoreboard players get $damage_dealt gm4_aa_data +data modify storage gm4_augmented_armor:temp dps.array append from storage gm4_augmented_armor:temp dps.new + +# update recent hit +execute on passengers if entity @s[tag=gm4_aa_training_dummy.recent_hit] run function gm4_augmented_armor:training_dummy/update/recent_hit + +# update total damage (resets after 10 seconds of not taking damage) +execute unless score @s gm4_aa_training_dummy.timer matches 1.. run scoreboard players set @s gm4_aa_training_dummy.total_damage 0 +scoreboard players set @s gm4_aa_training_dummy.timer 100 +scoreboard players operation @s gm4_aa_training_dummy.total_damage += $damage_dealt gm4_aa_data +scoreboard players operation $total_damage gm4_aa_data = @s gm4_aa_training_dummy.total_damage +execute on passengers if entity @s[tag=gm4_aa_training_dummy.total_damage] run function gm4_augmented_armor:training_dummy/update/total_damage diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/dps_remove.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/dps_remove.mcfunction new file mode 100644 index 0000000000..b3b946c0c6 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/dps_remove.mcfunction @@ -0,0 +1,5 @@ + +# remove old damage +execute store result score $reduce_dps gm4_aa_data run data get storage gm4_augmented_armor:temp dps.array[0].damage +scoreboard players operation @s gm4_aa_training_dummy.dps -= $reduce_dps gm4_aa_data +data remove storage gm4_augmented_armor:temp dps.array[0] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/process.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/process.mcfunction new file mode 100644 index 0000000000..a17f5d8b02 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/process.mcfunction @@ -0,0 +1,35 @@ + +# total damage timer +scoreboard players remove @s[scores={gm4_aa_training_dummy.timer=1..}] gm4_aa_training_dummy.timer 1 + +# check if the dummy lost health +execute store result score $health gm4_aa_data run data get entity @s Health 10 +execute if score $health gm4_aa_data matches 10000.. unless score @s gm4_aa_training_dummy.dps matches 1.. run return 0 + +# calculate the damage dealt (x10) +scoreboard players set $damage_dealt gm4_aa_data 10000 +scoreboard players operation $damage_dealt gm4_aa_data -= $health gm4_aa_data + +# grab the array of recent damages +data modify storage gm4_augmented_armor:temp dps.array set from entity @s ArmorItems[0].components."minecraft:custom_data".gm4_augmented_armor.dps_array +# check if the oldest entry is more than 10 seconds old, if so remove it and reduce total damage by it +execute store result score $keep_entry gm4_aa_data run data get storage gm4_augmented_armor:temp dps.array[0].gametime +scoreboard players add $keep_entry gm4_aa_data 100 +execute store result score $gametime gm4_aa_data run time query gametime +scoreboard players operation $keep_entry gm4_aa_data -= $gametime gm4_aa_data +execute unless score $keep_entry gm4_aa_data matches 1.. run function gm4_augmented_armor:training_dummy/dps_remove + +# update the damage displays if needed +execute if score $damage_dealt gm4_aa_data matches 1.. run function gm4_augmented_armor:training_dummy/damage_dealt + +# update dps display +scoreboard players operation @s gm4_aa_training_dummy.dps += $damage_dealt gm4_aa_data +scoreboard players operation $dps gm4_aa_data = @s gm4_aa_training_dummy.dps +execute on passengers if entity @s[tag=gm4_aa_training_dummy.dps] run function gm4_augmented_armor:training_dummy/update/dps + +# store the array of recent damages +data modify entity @s ArmorItems[0].components."minecraft:custom_data".gm4_augmented_armor.dps_array set from storage gm4_augmented_armor:temp dps.array + +# cleanup +data remove storage gm4_augmented_armor:temp dps +data modify entity @s Health set value 1000 diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/spawn.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/spawn.mcfunction new file mode 100644 index 0000000000..01127c280d --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/spawn.mcfunction @@ -0,0 +1,8 @@ + +summon zombie ~ ~ ~ {Silent:1b,DeathLootTable:"empty",attributes:[{id:"minecraft:max_health",base:1000}],PersistenceRequired:1b,NoAI:1b,Health:1000f,Tags:["gm4_aa_training_dummy"],ArmorItems:[{id:"minecraft:stone_button",count:1,components:{"minecraft:custom_data":{gm4_augmented_armor:{dps_array:[]}}}},{},{},{}],Passengers:[\ +\ +{id:"minecraft:text_display",billboard:"vertical",Tags:["gm4_aa_training_dummy","gm4_aa_training_dummy.recent_hit"],text:'[{"translate":"entity.gm4.augmented_armor.training_dummy.recent_hit","fallback":"Last Hit: ","color":"gray"},{"text":"0.0","color":"white"}]'},\ +\ +{id:"minecraft:text_display",billboard:"vertical",Tags:["gm4_aa_training_dummy","gm4_aa_training_dummy.dps"],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.3f,0f],scale:[1f,1f,1f]},text:'[{"translate":"entity.gm4.augmented_armor.training_dummy.dps","fallback":"Damage / Second: ","color":"gray"},{"text":"0.0","color":"white"}]'},\ +\ +{id:"minecraft:text_display",billboard:"vertical",Tags:["gm4_aa_training_dummy","gm4_aa_training_dummy.total_damage"],transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.6f,0f],scale:[1f,1f,1f]},text:'[{"translate":"entity.gm4.augmented_armor.training_dummy.total_damage","fallback":"Total Damage: ","color":"gray"},{"text":"0.0","color":"white"}]'}]} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/dps.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/dps.mcfunction new file mode 100644 index 0000000000..3f927d01b0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/dps.mcfunction @@ -0,0 +1,18 @@ + +# calculate the actual damage per second +execute store result score $oldest_hit_time gm4_aa_data run data get storage gm4_augmented_armor:temp dps.array[0].gametime +scoreboard players operation $dps_duration gm4_aa_data = $gametime gm4_aa_data +scoreboard players operation $dps_duration gm4_aa_data -= $oldest_hit_time gm4_aa_data +scoreboard players operation $dps_duration gm4_aa_data /= #2 gm4_aa_data +scoreboard players operation $dps_duration gm4_aa_data > #10 gm4_aa_data +scoreboard players operation $dps gm4_aa_data *= #10 gm4_aa_data +scoreboard players operation $dps gm4_aa_data /= $dps_duration gm4_aa_data + +# convert to scores with decimals +scoreboard players operation $dps.1 gm4_aa_data = $dps gm4_aa_data +scoreboard players operation $dps.1 gm4_aa_data %= #10 gm4_aa_data +scoreboard players operation $dps.10 gm4_aa_data = $dps gm4_aa_data +scoreboard players operation $dps.10 gm4_aa_data /= #10 gm4_aa_data + +# update display +data modify entity @s text set value '[{"translate":"entity.gm4.augmented_armor.training_dummy.dps","fallback":"Damage / Second: ","color":"gray"},{"score":{"name":"$dps.10","objective":"gm4_aa_data"},"color":"white"},{"text":".","color":"white"},{"score":{"name":"$dps.1","objective":"gm4_aa_data"},"color":"white"}]' diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/recent_hit.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/recent_hit.mcfunction new file mode 100644 index 0000000000..8b10d6d2c8 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/recent_hit.mcfunction @@ -0,0 +1,9 @@ + +# convert to scores with decimals +scoreboard players operation $recent_hit.1 gm4_aa_data = $damage_dealt gm4_aa_data +scoreboard players operation $recent_hit.1 gm4_aa_data %= #10 gm4_aa_data +scoreboard players operation $recent_hit.10 gm4_aa_data = $damage_dealt gm4_aa_data +scoreboard players operation $recent_hit.10 gm4_aa_data /= #10 gm4_aa_data + +# update display +data modify entity @s text set value '[{"translate":"entity.gm4.augmented_armor.training_dummy.recent_hit","fallback":"Last Hit: ","color":"gray"},{"score":{"name":"$recent_hit.10","objective":"gm4_aa_data"},"color":"white"},{"text":".","color":"white"},{"score":{"name":"$recent_hit.1","objective":"gm4_aa_data"},"color":"white"}]' diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/total_damage.mcfunction b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/total_damage.mcfunction new file mode 100644 index 0000000000..d81f318238 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/function/training_dummy/update/total_damage.mcfunction @@ -0,0 +1,9 @@ + +# convert to scores with decimals +scoreboard players operation $total_damage.1 gm4_aa_data = $total_damage gm4_aa_data +scoreboard players operation $total_damage.1 gm4_aa_data %= #10 gm4_aa_data +scoreboard players operation $total_damage.10 gm4_aa_data = $total_damage gm4_aa_data +scoreboard players operation $total_damage.10 gm4_aa_data /= #10 gm4_aa_data + +# update display +data modify entity @s text set value '[{"translate":"entity.gm4.augmented_armor.training_dummy.total_damage","fallback":"Total Damage: ","color":"gray"},{"score":{"name":"$total_damage.10","objective":"gm4_aa_data"},"color":"white"},{"text":".","color":"white"},{"score":{"name":"$total_damage.1","objective":"gm4_aa_data"},"color":"white"}]' diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/acrobatic/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/acrobatic/components.json new file mode 100644 index 0000000000..4a6d3796b2 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/acrobatic/components.json @@ -0,0 +1,217 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:fall_damage_multiplier", + "id": "gm4_augmented_armor:dynamic", + "amount": 0, + "operation": "add_multiplied_total", + "slot": "chest" + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{augment:{name:acrobatic,id:4,triggers:{clocked:1,damage_dealt:0,damage_taken:1}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.acrobatic", + "fallback": "Acrobatic" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.immunity", + "fallback": "%s Immunity", + "with": [ + { + "translate": "effect.minecraft.levitation" + } + ], + "color": "blue", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 1 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.immunity", + "fallback": "%s Immunity", + "with": [ + { + "translate": "effect.minecraft.slow_falling" + } + ], + "color": "blue", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 2 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.immunity", + "fallback": "%s Immunity", + "with": [ + { + "translate": "effect.minecraft.slowness" + } + ], + "color": "blue", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 3 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.acrobatic", + "fallback": "%s out of combat", + "with": [ + { + "translate": "attribute.modifier.take.2", + "with": [ + { + "score": { + "name": "$level_2", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.name.fall_damage_multiplier" + } + ], + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.acrobatic", + "fallback": "Acrobatic" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/acrobatic/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/acrobatic/levels.json new file mode 100644 index 0000000000..25c4889ff4 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/acrobatic/levels.json @@ -0,0 +1,50 @@ +{ + "pools": [ + { + "rolls": { + "min": 1, + "max": 3 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + }, + { + "function": "minecraft:set_count", + "count": 1 + } + ] + } + ] + }, + { + "rolls": { + "min": 4, + "max": 10 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 2" + }, + { + "function": "minecraft:set_count", + "count": 5 + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/archery/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/archery/components.json new file mode 100644 index 0000000000..2bfec61c55 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/archery/components.json @@ -0,0 +1,139 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{custom_attribute:{arrow_damage:{value:'level_1'}},augment:{active:0,name:archery,id:18,triggers:{clocked:0,damage_dealt:0,damage_taken:0}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.archery", + "fallback": "Archery" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.archery", + "fallback": "Shoot %s arrows when firing", + "with": [ + { + "score": { + "name": "$level_2", + "objective": "gm4_aa_data" + }, + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.archery_2", + "fallback": "%s arrows shoot half the amount", + "with": [ + { + "translate": "enchantment.minecraft.multishot" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + { + "score": { + "name": "$level_1", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.gm4.augmented_armor.arrow_damage", + "fallback": "Arrow Damage" + } + ], + "color": "red", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.archery", + "fallback": "Archery" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/archery/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/archery/levels.json new file mode 100644 index 0000000000..c5758f89a8 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/archery/levels.json @@ -0,0 +1,50 @@ +{ + "pools": [ + { + "rolls": { + "min": 1, + "max": 4 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + }, + { + "function": "set_custom_data", + "tag": "{gm4_augmented_armor:{multiplier:-5}}" + } + ] + } + ] + }, + { + "rolls": { + "min": 1, + "max": 3 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 2" + }, + { + "function": "set_custom_data", + "tag": "{gm4_augmented_armor:{multiplier:2}}" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/berserkers/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/berserkers/components.json new file mode 100644 index 0000000000..dd4fa84444 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/berserkers/components.json @@ -0,0 +1,220 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:attack_speed", + "id": "gm4_augmented_armor:dynamic", + "amount": 0, + "operation": "add_multiplied_base", + "slot": "chest" + }, + { + "attribute": "minecraft:movement_speed", + "id": "gm4_augmented_armor:dynamic_2", + "amount": 0, + "operation": "add_multiplied_base", + "slot": "chest" + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{custom_attribute:{armor_recharge:{value:'level_3'}},augment:{active:0,name:berserkers,id:14,triggers:{clocked:1,damage_dealt:0,damage_taken:0}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.berserkers", + "fallback": "Berserkers" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.berserkers", + "fallback": "While at 0 %s gain %s,", + "with": [ + { + "translate": "attribute.name.armor" + }, + { + "translate": "attribute.modifier.plus.1", + "with": [ + { + "score": { + "name": "$level_1", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.name.attack_speed" + } + ], + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.berserkers_2", + "fallback": "%s, effect is doubled for", + "with": [ + { + "translate": "attribute.modifier.plus.1", + "with": [ + { + "score": { + "name": "$level_2", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.name.movement_speed" + } + ], + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.berserkers_3", + "fallback": "4 seconds when %s breaks", + "with": [ + { + "translate": "attribute.name.armor" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + { + "score": { + "name": "$level_3", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.gm4.augmented_armor.armor_recharge", + "fallback": "Armor Recharge Rate" + } + ], + "color": "red", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_3" + }, + "score": "gm4_aa_data" + }, + "range": { + "max": -1 + } + } + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.berserkers", + "fallback": "Berserkers" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/berserkers/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/berserkers/levels.json new file mode 100644 index 0000000000..89298803ae --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/berserkers/levels.json @@ -0,0 +1,73 @@ +{ + "pools": [ + { + "rolls": { + "min": 3, + "max": 6 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + }, + { + "function": "minecraft:set_count", + "count": 5 + } + ] + } + ] + }, + { + "rolls": { + "min": 1, + "max": 3 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 2" + }, + { + "function": "minecraft:set_count", + "count": 5 + } + ] + } + ] + }, + { + "rolls": { + "min": 0, + "max": 2 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 3" + }, + { + "function": "set_custom_data", + "tag": "{gm4_augmented_armor:{multiplier:-5}}" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/bursting/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/bursting/components.json new file mode 100644 index 0000000000..07f6a894bd --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/bursting/components.json @@ -0,0 +1,135 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{custom_attribute:{armor_recharge:{value:'level_2'}},augment:{name:bursting,id:11,triggers:{clocked:0,damage_dealt:0,damage_taken:0}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.bursting", + "fallback": "Bursting" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.bursting", + "fallback": "When %s breaks release an explosion", + "with": [ + { + "translate": "attribute.name.armor" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.bursting_2", + "fallback": "knocking back mobs within %s", + "with": [ + { + "translate": "attribute.name.entity_interaction_range" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + { + "score": { + "name": "$level_1", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.gm4.augmented_armor.armor_recharge", + "fallback": "Armor Recharge Rate" + } + ], + "color": "red", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.bursting", + "fallback": "Bursting" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/bursting/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/bursting/levels.json new file mode 100644 index 0000000000..44187fb737 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/bursting/levels.json @@ -0,0 +1,27 @@ +{ + "pools": [ + { + "rolls": { + "min": 4, + "max": 8 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + }, + { + "function": "set_custom_data", + "tag": "{gm4_augmented_armor:{multiplier:-5}}" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/canine/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/canine/components.json new file mode 100644 index 0000000000..4d27ebdb70 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/canine/components.json @@ -0,0 +1,208 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:attack_speed", + "id": "gm4_augmented_armor:permanent", + "amount": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data", + "scale": 0.01 + }, + "operation": "add_multiplied_base", + "slot": "chest" + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{augment:{cooldown:0,name:canine,id:17,triggers:{clocked:1,damage_dealt:0,damage_taken:0}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.canine", + "fallback": "Canine" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.canine", + "fallback": "Spawn a %s, %s %s", + "with": [ + { + "translate": "attribute.modifier.equals.0", + "with": [ + "4", + { + "translate": "attribute.name.attack_damage" + } + ], + "color": "dark_gray", + "italic": false + }, + { + "translate": "attribute.modifier.equals.0", + "with": [ + "40", + { + "translate": "attribute.name.max_health" + } + ], + "color": "dark_gray", + "italic": false + }, + { + "translate": "entity.minecraft.wolf" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.canine_2", + "fallback": "Command to sit to lose aggro", + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.canine_3", + "fallback": "Feed to strengthen for 60 seconds", + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.canine_4", + "fallback": "Respawns after 30 seconds on death", + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + { + "score": { + "name": "$level_1", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.name.attack_speed" + } + ], + "color": "red", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.canine", + "fallback": "Canine" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + }, + { + "function": "minecraft:set_components", + "components": { + "minecraft:rarity": "uncommon" + } + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/canine/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/canine/levels.json new file mode 100644 index 0000000000..01fb0c0f0e --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/canine/levels.json @@ -0,0 +1,27 @@ +{ + "pools": [ + { + "rolls": { + "min": 3, + "max": 5 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + }, + { + "function": "set_custom_data", + "tag": "{gm4_augmented_armor:{multiplier:-5}}" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/dashing/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/dashing/components.json new file mode 100644 index 0000000000..882ec45806 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/dashing/components.json @@ -0,0 +1,188 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:movement_speed", + "id": "gm4_augmented_armor:permanent", + "amount": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data", + "scale": 0.01 + }, + "operation": "add_multiplied_base", + "slot": "chest" + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{augment:{name:dashing,id:2,triggers:{clocked:1,damage_dealt:1,damage_taken:1}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.dashing", + "fallback": "Dashing" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.dashing", + "fallback": "%s & %s ramp up while sprinting,", + "color": "dark_gray", + "italic": false, + "with": [ + { + "translate": "effect.minecraft.speed" + }, + { + "translate": "effect.minecraft.hunger" + } + ] + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.dashing_2", + "fallback": "up to level %s. Taking or dealing damage", + "color": "dark_gray", + "italic": false, + "with": [ + { + "translate": "potion.potency.4" + } + ] + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.dashing_3", + "fallback": "resets the effect. Additional pieces", + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.dashing_4", + "fallback": "add to max level and ramping speed", + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + { + "score": { + "name": "$level_1", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.name.movement_speed" + } + ], + "color": "red", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.dashing", + "fallback": "Dashing" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/dashing/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/dashing/levels.json new file mode 100644 index 0000000000..f616a22e0d --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/dashing/levels.json @@ -0,0 +1,27 @@ +{ + "pools": [ + { + "rolls": { + "min": 1, + "max": 3 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + }, + { + "function": "set_custom_data", + "tag": "{gm4_augmented_armor:{multiplier:-5}}" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/equine/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/equine/components.json new file mode 100644 index 0000000000..f50ab01815 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/equine/components.json @@ -0,0 +1,358 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{augment:{name:equine,id:1,triggers:{clocked:1,damage_dealt:0,damage_taken:0}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.equine", + "fallback": "Equine" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.equine", + "fallback": "Mount has %s", + "with": [ + { + "translate": "effect.minecraft.speed", + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 1 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.equine", + "fallback": "Mount has %s", + "with": [ + { + "translate": "potion.withAmplifier", + "with": [ + { + "translate": "effect.minecraft.speed" + }, + { + "translate": "potion.potency.1" + } + ], + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 2 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.equine", + "fallback": "Mount has %s", + "with": [ + { + "translate": "potion.withAmplifier", + "with": [ + { + "translate": "effect.minecraft.speed" + }, + { + "translate": "potion.potency.2" + } + ], + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 3 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.equine_2", + "fallback": "and %s", + "with": [ + { + "translate": "potion.withAmplifier", + "with": [ + { + "translate": "effect.minecraft.resistance" + }, + { + "translate": "potion.potency.1" + } + ], + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_2" + }, + "score": "gm4_aa_data" + }, + "range": 1 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.equine_2", + "fallback": "and %s", + "with": [ + { + "translate": "potion.withAmplifier", + "with": [ + { + "translate": "effect.minecraft.jump_boost" + }, + { + "translate": "potion.potency.1" + } + ], + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_2" + }, + "score": "gm4_aa_data" + }, + "range": 2 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.equine_2", + "fallback": "and %s", + "with": [ + { + "translate": "effect.minecraft.fire_resistance", + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_2" + }, + "score": "gm4_aa_data" + }, + "range": 3 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.equine_2", + "fallback": "and %s", + "with": [ + { + "translate": "effect.minecraft.regeneration", + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_2" + }, + "score": "gm4_aa_data" + }, + "range": 4 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.equine_3", + "fallback": "%s stacks like Enchantments (2x %s = %s)", + "with": [ + { + "translate": "effect.minecraft.speed" + }, + { + "translate": "potion.potency.1" + }, + { + "translate": "potion.potency.2" + } + ], + "color": "dark_gray", + "italic": true + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.equine", + "fallback": "Equine" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/equine/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/equine/levels.json new file mode 100644 index 0000000000..84ec5e2d55 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/equine/levels.json @@ -0,0 +1,42 @@ +{ + "pools": [ + { + "rolls": { + "min": 1, + "max": 3 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + } + ] + } + ] + }, + { + "rolls": { + "min": 1, + "max": 4 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 2" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/flighty/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/flighty/components.json new file mode 100644 index 0000000000..35123160a2 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/flighty/components.json @@ -0,0 +1,251 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:movement_speed", + "id": "gm4_augmented_armor:dynamic", + "amount": 0, + "operation": "add_multiplied_base", + "slot": "chest" + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{augment:{name:flighty,id:3,timer:0,stacks:0,triggers:{clocked:1,damage_dealt:1,damage_taken:1}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.flighty", + "fallback": "Flighty" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.flighty", + "fallback": "Taking or dealing damage grants %s", + "color": "dark_gray", + "italic": false, + "with": [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + "2.0", + { + "translate": "attribute.name.movement_speed" + } + ], + "color": "blue", + "italic": false + } + ] + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 200 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.flighty", + "fallback": "Taking or dealing damage grants %s", + "color": "dark_gray", + "italic": false, + "with": [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + "2.25", + { + "translate": "attribute.name.movement_speed" + } + ], + "color": "blue", + "italic": false + } + ] + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 225 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.flighty", + "fallback": "Taking or dealing damage grants %s", + "color": "dark_gray", + "italic": false, + "with": [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + "2.5", + { + "translate": "attribute.name.movement_speed" + } + ], + "color": "blue", + "italic": false + } + ] + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 250 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.flighty_2", + "fallback": "for 12 seconds, stacks 10 times", + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.flighty_3", + "fallback": "Currently %s", + "with": [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + "0", + { + "translate": "attribute.name.movement_speed" + } + ], + "color": "blue", + "italic": true + } + ], + "color": "dark_gray", + "italic": true + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.flighty", + "fallback": "Flighty" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/flighty/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/flighty/levels.json new file mode 100644 index 0000000000..71ed4c0954 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/flighty/levels.json @@ -0,0 +1,27 @@ +{ + "pools": [ + { + "rolls": { + "min": 8, + "max": 10 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + }, + { + "function": "set_custom_data", + "tag": "{gm4_augmented_armor:{multiplier:25}}" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/gutsy/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/gutsy/components.json new file mode 100644 index 0000000000..627237933e --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/gutsy/components.json @@ -0,0 +1,333 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:attack_damage", + "id": "gm4_augmented_armor:dynamic", + "amount": 0, + "operation": "add_value", + "slot": "chest" + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{custom_attribute:{arrow_damage:{value:0}},augment:{active:0,name:gutsy,id:15,triggers:{clocked:1,damage_dealt:0,damage_taken:0}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.gutsy", + "fallback": "Gutsy" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.gutsy", + "fallback": "While under a negative effect gain", + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.gutsy_2", + "fallback": "%s and %s", + "with": [ + { + "translate": "attribute.modifier.plus.0", + "with": [ + "0.5", + { + "translate": "attribute.name.attack_damage" + } + ], + "color": "blue", + "italic": false + }, + { + "translate": "attribute.modifier.plus.1", + "with": [ + { + "score": { + "name": "$level_2", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.gm4.augmented_armor.arrow_damage", + "fallback": "Arrow Damage" + } + ], + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 1 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.gutsy_2", + "fallback": "%s and %s", + "with": [ + { + "translate": "attribute.modifier.plus.0", + "with": [ + "1", + { + "translate": "attribute.name.attack_damage" + } + ], + "color": "blue", + "italic": false + }, + { + "translate": "attribute.modifier.plus.1", + "with": [ + { + "score": { + "name": "$level_2", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.gm4.augmented_armor.arrow_damage", + "fallback": "Arrow Damage" + } + ], + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 2 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.gutsy_2", + "fallback": "%s and %s", + "with": [ + { + "translate": "attribute.modifier.plus.0", + "with": [ + "1.5", + { + "translate": "attribute.name.attack_damage" + } + ], + "color": "blue", + "italic": false + }, + { + "translate": "attribute.modifier.plus.1", + "with": [ + { + "score": { + "name": "$level_2", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.gm4.augmented_armor.arrow_damage", + "fallback": "Arrow Damage" + } + ], + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 3 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.gutsy_2", + "fallback": "%s and %s", + "with": [ + { + "translate": "attribute.modifier.plus.0", + "with": [ + "2", + { + "translate": "attribute.name.attack_damage" + } + ], + "color": "blue", + "italic": false + }, + { + "translate": "attribute.modifier.plus.1", + "with": [ + { + "score": { + "name": "$level_2", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.gm4.augmented_armor.arrow_damage", + "fallback": "Arrow Damage" + } + ], + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 4 + } + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.gutsy", + "fallback": "Gutsy" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/gutsy/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/gutsy/levels.json new file mode 100644 index 0000000000..bc7e4e68a8 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/gutsy/levels.json @@ -0,0 +1,46 @@ +{ + "pools": [ + { + "rolls": { + "min": 1, + "max": 4 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + } + ] + } + ] + }, + { + "rolls": { + "min": 3, + "max": 6 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 2" + }, + { + "function": "minecraft:set_count", + "count": 5 + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/hearty/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/hearty/components.json new file mode 100644 index 0000000000..386e892a9f --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/hearty/components.json @@ -0,0 +1,138 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{custom_attribute:{regen_speed:{value:'level_1'}},augment:{name:hearty,id:9,triggers:{clocked:0,damage_dealt:0,damage_taken:0}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:max_health", + "id": "gm4_augmented_armor:dynamic", + "amount": 0, + "operation": "add_value", + "slot": "chest" + }, + { + "attribute": "minecraft:armor", + "id": "gm4_augmented_armor:dynamic_2", + "amount": 0, + "operation": "add_value", + "slot": "chest" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.hearty", + "fallback": "Hearty" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.hearty", + "fallback": "Convert %s to %s", + "with": [ + { + "translate": "attribute.name.armor" + }, + { + "translate": "attribute.name.max_health" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "attribute.modifier.plus.1", + "with": [ + { + "score": { + "name": "$level_1", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.gm4.augmented_armor.regen_speed", + "fallback": "Regeneration Speed" + } + ], + "color": "blue", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.hearty", + "fallback": "Hearty" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/hearty/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/hearty/levels.json new file mode 100644 index 0000000000..6ddc178be1 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/hearty/levels.json @@ -0,0 +1,27 @@ +{ + "pools": [ + { + "rolls": { + "min": 1, + "max": 4 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + }, + { + "function": "minecraft:set_count", + "count": 5 + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/linked/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/linked/components.json new file mode 100644 index 0000000000..bd2427123b --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/linked/components.json @@ -0,0 +1,139 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:max_health", + "id": "gm4_augmented_armor:dynamic", + "amount": 0, + "operation": "add_value", + "slot": "chest" + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{augment:{name:linked,id:24,stored_name:'',triggers:{clocked:1,damage_dealt:0,damage_taken:0}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.linked", + "fallback": "Linked" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.linked", + "fallback": "Rename item to create a link, share", + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.linked_2", + "fallback": "health with players in the link", + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.linked_3", + "fallback": "Link: %s", + "color": "dark_gray", + "italic": false, + "with": [ + { + "translate": "item.gm4.augmented_armor.lore.linked_4", + "fallback": "Unlinked" + } + ] + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.linked", + "fallback": "Linked" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + }, + { + "function": "minecraft:set_components", + "components": { + "minecraft:rarity": "epic" + } + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/linked/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/linked/levels.json new file mode 100644 index 0000000000..86cd056394 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/linked/levels.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/plated/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/plated/components.json new file mode 100644 index 0000000000..52c7f5a821 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/plated/components.json @@ -0,0 +1,300 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{custom_attribute:{armor_recharge:{value:'level_2'}},augment:{name:plated,id:12,triggers:{clocked:0,damage_dealt:0,damage_taken:1}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.plated", + "fallback": "Plated" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.plated", + "fallback": "Damage to %s is reduced by %s,", + "with": [ + { + "translate": "attribute.name.armor" + }, + { + "text": "0.5", + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 1 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.plated", + "fallback": "Damage to %s is reduced by %s,", + "with": [ + { + "translate": "attribute.name.armor" + }, + { + "text": "1", + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 2 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.plated", + "fallback": "Damage to %s is reduced by %s,", + "with": [ + { + "translate": "attribute.name.armor" + }, + { + "text": "1.5", + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 3 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.plated", + "fallback": "Damage to %s is reduced by %s,", + "with": [ + { + "translate": "attribute.name.armor" + }, + { + "text": "2", + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 4 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.plated", + "fallback": "Damage to %s is reduced by %s,", + "with": [ + { + "translate": "attribute.name.armor" + }, + { + "text": "2.5", + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 5 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.plated_2", + "fallback": "down to a minimum of 1", + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + { + "score": { + "name": "$level_2", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.gm4.augmented_armor.armor_recharge", + "fallback": "Armor Recharge Rate" + } + ], + "color": "red", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.plated", + "fallback": "Plated" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/plated/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/plated/levels.json new file mode 100644 index 0000000000..72fc8755c0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/plated/levels.json @@ -0,0 +1,50 @@ +{ + "pools": [ + { + "rolls": { + "min": 1, + "max": 5 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + }, + { + "function": "minecraft:set_count", + "count": 1 + } + ] + } + ] + }, + { + "rolls": { + "min": 2, + "max": 5 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 2" + }, + { + "function": "set_custom_data", + "tag": "{gm4_augmented_armor:{multiplier:-5}}" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/psychic/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/psychic/components.json new file mode 100644 index 0000000000..eedb69c031 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/psychic/components.json @@ -0,0 +1,325 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:attack_speed", + "id": "gm4_augmented_armor:permanent", + "amount": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data", + "scale": -0.01 + }, + "operation": "add_multiplied_total", + "slot": "chest" + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{augment:{name:psychic,id:16,triggers:{clocked:0,damage_dealt:0,damage_taken:0}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.psychic", + "fallback": "Psychic" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "attribute.modifier.take.1", + "with": [ + { + "score": { + "name": "$level_1", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.name.attack_speed" + } + ], + "color": "red", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.psychic", + "fallback": "Spawn a rotating sword at %s", + "with": [ + { + "translate": "attribute.name.entity_interaction_range" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.psychic_2", + "fallback": "The sword deals %s, sneak to spin faster", + "with": [ + { + "translate": "attribute.modifier.equals.0", + "with": [ + "2", + { + "translate": "attribute.name.attack_damage" + } + ], + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$material" + }, + "score": "gm4_aa_data" + }, + "range": 1 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.psychic_2", + "fallback": "The sword deals %s, sneak to spin faster", + "with": [ + { + "translate": "attribute.modifier.equals.0", + "with": [ + "3", + { + "translate": "attribute.name.attack_damage" + } + ], + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$material" + }, + "score": "gm4_aa_data" + }, + "range": 2 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.psychic_2", + "fallback": "The sword deals %s, sneak to spin faster", + "with": [ + { + "translate": "attribute.modifier.equals.0", + "with": [ + "4", + { + "translate": "attribute.name.attack_damage" + } + ], + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$material" + }, + "score": "gm4_aa_data" + }, + "range": { + "min": 3, + "max": 4 + } + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.psychic_2", + "fallback": "The sword deals %s, sneak to spin faster", + "with": [ + { + "translate": "attribute.modifier.equals.0", + "with": [ + "5", + { + "translate": "attribute.name.attack_damage" + } + ], + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$material" + }, + "score": "gm4_aa_data" + }, + "range": { + "min": 5 + } + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.psychic_3", + "fallback": "Dealing damage reduces armor durability", + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.psychic", + "fallback": "Psychic" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + }, + { + "function": "minecraft:set_components", + "components": { + "minecraft:rarity": "uncommon" + } + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/psychic/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/psychic/levels.json new file mode 100644 index 0000000000..15a96dc307 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/psychic/levels.json @@ -0,0 +1,27 @@ +{ + "pools": [ + { + "rolls": { + "min": 3, + "max": 7 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + }, + { + "function": "minecraft:set_count", + "count": 5 + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/reactive/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/reactive/components.json new file mode 100644 index 0000000000..454ebe92b3 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/reactive/components.json @@ -0,0 +1,157 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{custom_attribute:{armor_recharge:{value:'level_2'}},augment:{name:reactive,id:10,triggers:{clocked:0,damage_dealt:0,damage_taken:0}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.reactive", + "fallback": "Reactive" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.reactive", + "fallback": "When %s breaks gain %s", + "with": [ + { + "translate": "attribute.name.armor" + }, + { + "translate": "potion.withDuration", + "with": [ + { + "translate": "effect.minecraft.absorption" + }, + "0:30" + ] + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.reactive", + "fallback": "equal to %s", + "with": [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + { + "score": { + "name": "$level_1", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.name.max_health" + } + ], + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + { + "score": { + "name": "$level_2", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.gm4.augmented_armor.armor_recharge", + "fallback": "Armor Recharge Rate" + } + ], + "color": "red", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.reactive", + "fallback": "Reactive" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/reactive/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/reactive/levels.json new file mode 100644 index 0000000000..2ab91b67cc --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/reactive/levels.json @@ -0,0 +1,50 @@ +{ + "pools": [ + { + "rolls": { + "min": 2, + "max": 4 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + }, + { + "function": "minecraft:set_count", + "count": 10 + } + ] + } + ] + }, + { + "rolls": { + "min": 4, + "max": 8 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 2" + }, + { + "function": "set_custom_data", + "tag": "{gm4_augmented_armor:{multiplier:-5}}" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/rejuvenating/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/rejuvenating/components.json new file mode 100644 index 0000000000..105c20bd25 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/rejuvenating/components.json @@ -0,0 +1,129 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{custom_attribute:{regen_speed:{value:'level_2'}},augment:{name:rejuvenating,id:19,triggers:{clocked:1,damage_dealt:0,damage_taken:1}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.rejuvenating", + "fallback": "Rejuvenating" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.sustaining", + "fallback": "Regenerate %s taken", + "with": [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + { + "score": { + "name": "$level_1", + "objective": "gm4_aa_data" + } + }, + { + "translate": "item.gm4.augmented_armor.lore.sustaining_2", + "fallback": "Combat Damage" + } + ], + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + { + "score": { + "name": "$level_2", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.gm4.augmented_armor.regen_speed", + "fallback": "Regeneration Speed" + } + ], + "color": "red", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.rejuvenating", + "fallback": "Rejuvenating" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/rejuvenating/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/rejuvenating/levels.json new file mode 100644 index 0000000000..7d78840b1a --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/rejuvenating/levels.json @@ -0,0 +1,50 @@ +{ + "pools": [ + { + "rolls": { + "min": 1, + "max": 5 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + }, + { + "function": "minecraft:set_count", + "count": 5 + } + ] + } + ] + }, + { + "rolls": { + "min": 1, + "max": 3 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 2" + }, + { + "function": "set_custom_data", + "tag": "{gm4_augmented_armor:{multiplier:-5}}" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/sparking/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/sparking/components.json new file mode 100644 index 0000000000..a13ee316b4 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/sparking/components.json @@ -0,0 +1,177 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{augment:{name:sparking,id:8,triggers:{clocked:0,damage_dealt:1,damage_taken:1}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.sparking", + "fallback": "Sparking" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.sparking", + "fallback": "When dealing or taking damage", + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.sparking_2", + "fallback": "apply %s stack of static", + "with": [ + { + "score": { + "name": "$level_1", + "objective": "gm4_aa_data" + }, + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 1 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.sparking_2s", + "fallback": "apply %s stacks of static", + "with": [ + { + "score": { + "name": "$level_1", + "objective": "gm4_aa_data" + }, + "color": "blue" + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": { + "min": 2 + } + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.sparking_3", + "fallback": "At 21 stacks strike with empowered Lightning", + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.sparking", + "fallback": "Sparking" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/sparking/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/sparking/levels.json new file mode 100644 index 0000000000..f93e1f98d2 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/sparking/levels.json @@ -0,0 +1,27 @@ +{ + "pools": [ + { + "rolls": { + "min": 1, + "max": 3 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + }, + { + "function": "minecraft:set_count", + "count": 1 + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/steelheart/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/steelheart/components.json new file mode 100644 index 0000000000..144bee517b --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/steelheart/components.json @@ -0,0 +1,325 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{custom_attribute:{armor_recharge:{value:0},regen_speed:{value:0}},augment:{name:steelheart,id:27,triggers:{clocked:1,damage_dealt:0,damage_taken:0}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.steelheart", + "fallback": "Steelheart" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.steelheart", + "fallback": "Convert every %s", + "with": [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + "1", + { + "translate": "attribute.gm4.augmented_armor.regen_speed", + "fallback": "Regeneration Speed" + } + ] + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.steelheart_2", + "fallback": "to %s", + "with": [ + { + "translate": "attribute.modifier.plus.1", + "with": [ + "0.25", + { + "translate": "attribute.gm4.augmented_armor.armor_recharge", + "fallback": "Armor Recharge Rate" + } + ], + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 1 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.steelheart_2", + "fallback": "to %s", + "with": [ + { + "translate": "attribute.modifier.plus.1", + "with": [ + "0.5", + { + "translate": "attribute.gm4.augmented_armor.armor_recharge", + "fallback": "Armor Recharge Rate" + } + ], + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 2 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.steelheart_2", + "fallback": "to %s", + "with": [ + { + "translate": "attribute.modifier.plus.1", + "with": [ + "0.75", + { + "translate": "attribute.gm4.augmented_armor.armor_recharge", + "fallback": "Armor Recharge Rate" + } + ], + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 3 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.steelheart_2", + "fallback": "to %s", + "with": [ + { + "translate": "attribute.modifier.plus.1", + "with": [ + "1", + { + "translate": "attribute.gm4.augmented_armor.armor_recharge", + "fallback": "Armor Recharge Rate" + } + ], + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 4 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.steelheart_3", + "fallback": "Currently:", + "color": "dark_gray", + "italic": true + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "attribute.modifier.take.1", + "with": [ + "0", + { + "translate": "attribute.gm4.augmented_armor.regen_speed", + "fallback": "Regeneration Speed" + } + ], + "color": "red", + "italic": true + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "attribute.modifier.plus.1", + "with": [ + "0", + { + "translate": "attribute.gm4.augmented_armor.armor_recharge", + "fallback": "Armor Recharge Rate" + } + ], + "color": "blue", + "italic": true + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.steelheart", + "fallback": "Steelheart" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/steelheart/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/steelheart/levels.json new file mode 100644 index 0000000000..191268f2bd --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/steelheart/levels.json @@ -0,0 +1,23 @@ +{ + "pools": [ + { + "rolls": { + "min": 1, + "max": 4 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/sturdy/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/sturdy/components.json new file mode 100644 index 0000000000..98d259a338 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/sturdy/components.json @@ -0,0 +1,140 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{custom_attribute:{armor_recharge:{value:'level_2'}},augment:{name:sturdy,id:13,triggers:{clocked:0,damage_dealt:0,damage_taken:1}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.sturdy", + "fallback": "Sturdy" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.sturdy", + "fallback": "Gain damage reduction based on", + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.sturdy_2", + "fallback": "current %s, up to %s", + "with": [ + { + "translate": "attribute.name.armor" + }, + [ + { + "score": { + "name": "$level_1", + "objective": "gm4_aa_data" + }, + "color": "blue" + }, + "%" + ] + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "attribute.modifier.plus.1", + "with": [ + { + "score": { + "name": "$level_2", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.gm4.augmented_armor.armor_recharge", + "fallback": "Armor Recharge Rate" + } + ], + "color": "blue", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.sturdy", + "fallback": "Sturdy" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/sturdy/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/sturdy/levels.json new file mode 100644 index 0000000000..614f942b9c --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/sturdy/levels.json @@ -0,0 +1,50 @@ +{ + "pools": [ + { + "rolls": { + "min": 5, + "max": 10 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + }, + { + "function": "minecraft:set_count", + "count": 1 + } + ] + } + ] + }, + { + "rolls": { + "min": 1, + "max": 5 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 2" + }, + { + "function": "minecraft:set_count", + "count": 5 + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/sustaining/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/sustaining/components.json new file mode 100644 index 0000000000..9f211708dc --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/sustaining/components.json @@ -0,0 +1,132 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{custom_attribute:{regen_speed:{value:0}},augment:{name:sustaining,id:25,triggers:{clocked:1,damage_dealt:0,damage_taken:1}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.sustaining", + "fallback": "Sustaining" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.sustaining", + "fallback": "Gain %s for every missing Health", + "with": [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + { + "score": { + "name": "$level_1", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.gm4.augmented_armor.regen_speed", + "fallback": "Regeneration Speed" + } + ], + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.sustaining_2", + "fallback": "Currently %s", + "with": [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + "0", + { + "translate": "attribute.gm4.augmented_armor.regen_speed", + "fallback": "Regeneration Speed" + } + ], + "color": "blue", + "italic": true + } + ], + "color": "dark_gray", + "italic": true + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.sustaining", + "fallback": "Sustaining" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/sustaining/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/sustaining/levels.json new file mode 100644 index 0000000000..3dcd1df3b9 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/sustaining/levels.json @@ -0,0 +1,23 @@ +{ + "pools": [ + { + "rolls": { + "min": 1, + "max": 3 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/totemic/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/totemic/components.json new file mode 100644 index 0000000000..a584eccc65 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/totemic/components.json @@ -0,0 +1,536 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{augment:{name:totemic,id:6,triggers:{clocked:1,damage_dealt:0,damage_taken:0}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.totemic", + "fallback": "Totemic" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:sequence", + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.totemic", + "fallback": "On kill spawn a %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.lore.totemic_heal", + "fallback": "Healing Totem", + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 1 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.totemic_heal_2", + "fallback": "Restores 1 health to most damaged", + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 1 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.totemic_heal_3", + "fallback": "player in line of sight", + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 1 + } + ] + } + ] + }, + { + "function": "minecraft:sequence", + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.totemic", + "fallback": "On kill spawn a %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.lore.totemic_haste", + "fallback": "Haste Totem", + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 2 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.totemic_haste_2", + "fallback": "Grants 20%% %s, %s", + "with": [ + { + "translate": "attribute.name.movement_speed" + }, + { + "translate": "attribute.name.attack_speed" + } + ], + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 2 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.totemic_haste_3", + "fallback": "and %s to all players", + "with": [ + { + "translate": "attribute.name.block_break_speed" + } + ], + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 2 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.totemic_haste_4", + "fallback": "in line of sight", + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 2 + } + ] + } + ] + }, + { + "function": "minecraft:sequence", + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.totemic", + "fallback": "On kill spawn a %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.lore.totemic_freeze", + "fallback": "Freezing Totem", + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 3 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.totemic_freeze_2", + "fallback": "Freeze the closest non-frozen", + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 3 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "potion.withDuration", + "with": [ + { + "translate": "item.gm4.augmented_armor.lore.totemic_freeze_3", + "fallback": "entity in line of sight" + }, + "0:03" + ], + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 3 + } + ] + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.player_chilled", + "fallback": "Players are Chilled instead", + "color": "dark_gray", + "italic": true + } + ] + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 3 + } + ] + }, + { + "function": "minecraft:sequence", + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.totemic", + "fallback": "On kill spawn a %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.lore.totemic_strength", + "fallback": "Strength Totem", + "color": "blue", + "italic": false + } + ], + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 4 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.totemic_strength_2", + "fallback": "Grants 1 %s to players in range,", + "with": [ + { + "translate": "attribute.name.attack_damage" + } + ], + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 4 + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.totemic_strength_3", + "fallback": "stacking 4 times. Mobs in range glow", + "with": [ + { + "translate": "attribute.name.attack_damage" + } + ], + "color": "dark_gray", + "italic": false + } + ], + "conditions": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 4 + } + ] + } + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.totemic", + "fallback": "Totemic" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + }, + { + "function": "minecraft:set_components", + "components": { + "minecraft:rarity": "uncommon" + } + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/totemic/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/totemic/levels.json new file mode 100644 index 0000000000..ff4f6a638b --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/totemic/levels.json @@ -0,0 +1,27 @@ +{ + "pools": [ + { + "rolls": { + "min": 1, + "max": 4 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + }, + { + "function": "minecraft:set_count", + "count": 1 + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vampiric/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vampiric/components.json new file mode 100644 index 0000000000..7fc29e0ea4 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vampiric/components.json @@ -0,0 +1,119 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{custom_attribute:{regen_speed:{value:'level_1'}},augment:{name:vampiric,id:26,triggers:{clocked:1,damage_dealt:0,damage_taken:0}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.vampiric", + "fallback": "Vampiric" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.vampiric", + "fallback": "Regenerate %s on kill", + "with": [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + "5", + { + "translate": "attribute.name.max_health" + } + ] + } + ], + "color": "dark_gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "attribute.modifier.equals.1", + "with": [ + { + "score": { + "name": "$level_1", + "objective": "gm4_aa_data" + } + }, + { + "translate": "attribute.gm4.augmented_armor.regen_speed", + "fallback": "Regeneration Speed" + } + ], + "color": "red", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.vampiric", + "fallback": "Vampiric" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vampiric/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vampiric/levels.json new file mode 100644 index 0000000000..01fb0c0f0e --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vampiric/levels.json @@ -0,0 +1,27 @@ +{ + "pools": [ + { + "rolls": { + "min": 3, + "max": 5 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + }, + { + "function": "set_custom_data", + "tag": "{gm4_augmented_armor:{multiplier:-5}}" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vigorous/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vigorous/components.json new file mode 100644 index 0000000000..b2e3366bc8 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vigorous/components.json @@ -0,0 +1,432 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{augment:{name:vigorous,id:5,triggers:{clocked:1,damage_dealt:0,damage_taken:0}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.vigorous", + "fallback": "Vigorous" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.immunity", + "fallback": "%s Immunity", + "with": [ + { + "translate": "effect.minecraft.mining_fatigue" + } + ], + "color": "blue", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 1 + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_2" + }, + "score": "gm4_aa_data" + }, + "range": 1 + } + ] + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.immunity", + "fallback": "%s Immunity", + "with": [ + { + "translate": "effect.minecraft.poison" + } + ], + "color": "blue", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 2 + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_2" + }, + "score": "gm4_aa_data" + }, + "range": 2 + } + ] + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.immunity", + "fallback": "%s Immunity", + "with": [ + { + "translate": "effect.minecraft.weakness" + } + ], + "color": "blue", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 3 + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_2" + }, + "score": "gm4_aa_data" + }, + "range": 3 + } + ] + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.immunity", + "fallback": "%s Immunity", + "with": [ + { + "translate": "effect.minecraft.hunger" + } + ], + "color": "blue", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 4 + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_2" + }, + "score": "gm4_aa_data" + }, + "range": 4 + } + ] + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.immunity", + "fallback": "%s Immunity", + "with": [ + { + "translate": "effect.minecraft.blindness" + } + ], + "color": "blue", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 5 + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_2" + }, + "score": "gm4_aa_data" + }, + "range": 5 + } + ] + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.immunity", + "fallback": "%s Immunity", + "with": [ + { + "translate": "effect.minecraft.nausea" + } + ], + "color": "blue", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 6 + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_2" + }, + "score": "gm4_aa_data" + }, + "range": 6 + } + ] + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.immunity", + "fallback": "%s Immunity", + "with": [ + { + "translate": "effect.minecraft.wither" + } + ], + "color": "blue", + "italic": false + } + ] + ], + "conditions": [ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_1" + }, + "score": "gm4_aa_data" + }, + "range": 7 + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$level_2" + }, + "score": "gm4_aa_data" + }, + "range": 7 + } + ] + } + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.vigorous", + "fallback": "Vigorous" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + }, + { + "function": "minecraft:set_components", + "components": { + "minecraft:rarity": "uncommon" + } + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vigorous/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vigorous/levels.json new file mode 100644 index 0000000000..6737dc9350 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vigorous/levels.json @@ -0,0 +1,450 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 7 + } + }, + { + "function": "minecraft:set_count", + "count": 13 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 7 + } + }, + { + "function": "minecraft:set_count", + "count": 12 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 7 + } + }, + { + "function": "minecraft:set_count", + "count": 11 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 7 + } + }, + { + "function": "minecraft:set_count", + "count": 10 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 7 + } + }, + { + "function": "minecraft:set_count", + "count": 9 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 7 + } + }, + { + "function": "minecraft:set_count", + "count": 8 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 6 + } + }, + { + "function": "minecraft:set_count", + "count": 11 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 6 + } + }, + { + "function": "minecraft:set_count", + "count": 10 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 6 + } + }, + { + "function": "minecraft:set_count", + "count": 9 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 6 + } + }, + { + "function": "minecraft:set_count", + "count": 8 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 6 + } + }, + { + "function": "minecraft:set_count", + "count": 7 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 5 + } + }, + { + "function": "minecraft:set_count", + "count": 9 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 5 + } + }, + { + "function": "minecraft:set_count", + "count": 8 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 5 + } + }, + { + "function": "minecraft:set_count", + "count": 7 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 5 + } + }, + { + "function": "minecraft:set_count", + "count": 6 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 4 + } + }, + { + "function": "minecraft:set_count", + "count": 7 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 4 + } + }, + { + "function": "minecraft:set_count", + "count": 6 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 4 + } + }, + { + "function": "minecraft:set_count", + "count": 5 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 3 + } + }, + { + "function": "minecraft:set_count", + "count": 5 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 3 + } + }, + { + "function": "minecraft:set_count", + "count": 4 + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1 & 2" + }, + { + "function": "set_components", + "components": { + "minecraft:max_stack_size": 2 + } + }, + { + "function": "minecraft:set_count", + "count": 3 + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vorpal/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vorpal/components.json new file mode 100644 index 0000000000..8d29157694 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vorpal/components.json @@ -0,0 +1,90 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{augment:{name:vorpal,id:23,triggers:{clocked:0,damage_dealt:0,damage_taken:1}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.vorpal", + "fallback": "Vorpal" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.vorpal", + "fallback": "When damaged warp to nearyby location", + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.vorpal", + "fallback": "Vorpal" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + }, + { + "function": "minecraft:set_components", + "components": { + "minecraft:rarity": "epic" + } + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vorpal/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vorpal/levels.json new file mode 100644 index 0000000000..86cd056394 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/vorpal/levels.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/wild_magic/components.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/wild_magic/components.json new file mode 100644 index 0000000000..0c9daed972 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/wild_magic/components.json @@ -0,0 +1,90 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/base", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{augment:{name:wild_magic,id:22,triggers:{clocked:0,damage_dealt:0,damage_taken:1}}}}" + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + "" + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.augment", + "fallback": "%s Augment:", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.wild_magic", + "fallback": "Wild Magic" + } + ], + "color": "gray", + "italic": false + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + [ + { + "translate": "item.gm4.augmented_armor.lore.wild_magic", + "fallback": "When damaged gain a random potion effect", + "color": "dark_gray", + "italic": false + } + ] + ] + }, + { + "function": "minecraft:set_name", + "entity": "this", + "target": "item_name", + "name": [ + { + "translate": "item.gm4.augmented_armor.name", + "fallback": "%s %s", + "with": [ + { + "translate": "item.gm4.augmented_armor.augment.wild_magic", + "fallback": "Wild Magic" + }, + { + "nbt": "components.'minecraft:custom_data'.gm4_augmented_armor.name", + "storage": "gm4_augmented_armor:temp", + "interpret": true + } + ] + } + ] + }, + { + "function": "minecraft:set_components", + "components": { + "minecraft:rarity": "epic" + } + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/wild_magic/levels.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/wild_magic/levels.json new file mode 100644 index 0000000000..86cd056394 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/augment/wild_magic/levels.json @@ -0,0 +1,20 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": "GM4 Augmented Armor - 1" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/base.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/base.json new file mode 100644 index 0000000000..38c07f128f --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/base.json @@ -0,0 +1,39 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:wooden_hoe", + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "minecraft:damage": 0, + "minecraft:attribute_modifiers": { + "modifiers": [] + }, + "minecraft:enchantments": {} + } + }, + { + "function": "minecraft:copy_custom_data", + "source": { + "type": "minecraft:storage", + "source": "gm4_augmented_armor:temp" + }, + "ops": [ + { + "source": "augment.levels", + "target": "gm4_augmented_armor.levels", + "op": "replace" + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/common.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/common.json new file mode 100644 index 0000000000..69004e1d61 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/common.json @@ -0,0 +1,19 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{set_augment:vigorous}}" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/random.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/random.json new file mode 100644 index 0000000000..c8d8076e74 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/random.json @@ -0,0 +1,82 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{set_augment:link}}" + } + ], + "conditions": [ + { + "condition": "minecraft:location_check", + "predicate": { + "biomes": "minecraft:deep_dark" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{set_augment:vorpal}}" + } + ], + "conditions": [ + { + "condition": "minecraft:location_check", + "predicate": { + "dimension": "minecraft:the_end" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{set_augment:wild_magic}}" + } + ], + "conditions": [ + { + "condition": "minecraft:location_check", + "predicate": { + "biomes": "minecraft:mushroom_fields" + } + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/common", + "conditions": [ + { + "condition": "random_chance", + "chance": 0.6 + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/identification/rare" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/rare.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/rare.json new file mode 100644 index 0000000000..69004e1d61 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/identification/rare.json @@ -0,0 +1,19 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{set_augment:vigorous}}" + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/chainmail/chest.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/chainmail/chest.json new file mode 100644 index 0000000000..9197006e6a --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/chainmail/chest.json @@ -0,0 +1,83 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:chainmail_chestplate", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.chestplate", + "amount": 5, + "operation": "add_value", + "slot": "chest" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:240,identified:0,armor_clamp:-5,slot:1,material:2,name:'{\"italic\":false,\"translate\":\"item.minecraft.chainmail_chestplate\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.15 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.25 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.2 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/chainmail/feet.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/chainmail/feet.json new file mode 100644 index 0000000000..e0418fc735 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/chainmail/feet.json @@ -0,0 +1,83 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:chainmail_boots", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.boots", + "amount": 1, + "operation": "add_value", + "slot": "feet" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:195,identified:0,armor_clamp:-1,slot:3,material:2,name:'{\"italic\":false,\"translate\":\"item.minecraft.chainmail_boots\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.15 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.25 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.2 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/chainmail/head.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/chainmail/head.json new file mode 100644 index 0000000000..4db1276c3d --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/chainmail/head.json @@ -0,0 +1,83 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:chainmail_helmet", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.helmet", + "amount": 2, + "operation": "add_value", + "slot": "head" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:165,identified:0,armor_clamp:-2,slot:0,material:2,name:'{\"italic\":false,\"translate\":\"item.minecraft.chainmail_helmet\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.15 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.25 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.2 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/chainmail/legs.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/chainmail/legs.json new file mode 100644 index 0000000000..ddd468e22a --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/chainmail/legs.json @@ -0,0 +1,83 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:chainmail_leggings", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.leggings", + "amount": 4, + "operation": "add_value", + "slot": "legs" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:225,identified:0,armor_clamp:-4,slot:2,material:2,name:'{\"italic\":false,\"translate\":\"item.minecraft.chainmail_leggings\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.15 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.25 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.2 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/diamond/chest.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/diamond/chest.json new file mode 100644 index 0000000000..ada0f530e6 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/diamond/chest.json @@ -0,0 +1,97 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:diamond_chestplate", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.chestplate", + "amount": 8, + "operation": "add_value", + "slot": "chest" + }, + { + "attribute": "minecraft:armor_toughness", + "id": "minecraft:armor.chestplate", + "amount": 2, + "operation": "add_value", + "slot": "chest" + }, + { + "attribute": "minecraft:knockback_resistance", + "id": "minecraft:armor.chestplate", + "amount": 0, + "operation": "add_value", + "slot": "chest" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:528,identified:0,armor_clamp:-8,slot:1,material:5,name:'{\"italic\":false,\"translate\":\"item.minecraft.diamond_chestplate\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.15 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.25 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.2 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/diamond/feet.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/diamond/feet.json new file mode 100644 index 0000000000..dd200d2505 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/diamond/feet.json @@ -0,0 +1,97 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:diamond_boots", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.boots", + "amount": 3, + "operation": "add_value", + "slot": "feet" + }, + { + "attribute": "minecraft:armor_toughness", + "id": "minecraft:armor.boots", + "amount": 2, + "operation": "add_value", + "slot": "feet" + }, + { + "attribute": "minecraft:knockback_resistance", + "id": "minecraft:armor.boots", + "amount": 0, + "operation": "add_value", + "slot": "feet" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:429,identified:0,armor_clamp:-3,slot:3,material:5,name:'{\"italic\":false,\"translate\":\"item.minecraft.diamond_boots\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.15 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.25 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.2 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/diamond/head.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/diamond/head.json new file mode 100644 index 0000000000..cc2c9d3162 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/diamond/head.json @@ -0,0 +1,97 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:diamond_helmet", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.helmet", + "amount": 3, + "operation": "add_value", + "slot": "head" + }, + { + "attribute": "minecraft:armor_toughness", + "id": "minecraft:armor.helmet", + "amount": 2, + "operation": "add_value", + "slot": "head" + }, + { + "attribute": "minecraft:knockback_resistance", + "id": "minecraft:armor.helmet", + "amount": 0, + "operation": "add_value", + "slot": "head" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:363,identified:0,armor_clamp:-3,slot:0,material:5,name:'{\"italic\":false,\"translate\":\"item.minecraft.diamond_helmet\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.15 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.25 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.2 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/diamond/legs.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/diamond/legs.json new file mode 100644 index 0000000000..6c41c7ca80 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/diamond/legs.json @@ -0,0 +1,97 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:diamond_leggings", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.leggings", + "amount": 6, + "operation": "add_value", + "slot": "legs" + }, + { + "attribute": "minecraft:armor_toughness", + "id": "minecraft:armor.leggings", + "amount": 2, + "operation": "add_value", + "slot": "legs" + }, + { + "attribute": "minecraft:knockback_resistance", + "id": "minecraft:armor.leggings", + "amount": 0, + "operation": "add_value", + "slot": "legs" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:495,identified:0,armor_clamp:-6,slot:2,material:5,name:'{\"italic\":false,\"translate\":\"item.minecraft.diamond_leggings\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.15 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.25 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.2 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/golden/chest.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/golden/chest.json new file mode 100644 index 0000000000..ca3deafdeb --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/golden/chest.json @@ -0,0 +1,83 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:golden_chestplate", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.chestplate", + "amount": 5, + "operation": "add_value", + "slot": "chest" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:112,identified:0,armor_clamp:-5,slot:1,material:4,name:'{\"italic\":false,\"translate\":\"item.minecraft.golden_chestplate\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.2 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.3 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.2 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/golden/feet.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/golden/feet.json new file mode 100644 index 0000000000..bf466d5780 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/golden/feet.json @@ -0,0 +1,83 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:golden_boots", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.boots", + "amount": 1, + "operation": "add_value", + "slot": "feet" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:91,identified:0,armor_clamp:-1,slot:3,material:4,name:'{\"italic\":false,\"translate\":\"item.minecraft.golden_boots\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.2 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.3 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.2 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/golden/head.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/golden/head.json new file mode 100644 index 0000000000..6f1e37c79a --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/golden/head.json @@ -0,0 +1,83 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:golden_helmet", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.helmet", + "amount": 2, + "operation": "add_value", + "slot": "head" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:77,identified:0,armor_clamp:-2,slot:0,material:4,name:'{\"italic\":false,\"translate\":\"item.minecraft.golden_helmet\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.2 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.3 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.2 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/golden/legs.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/golden/legs.json new file mode 100644 index 0000000000..110b41fe52 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/golden/legs.json @@ -0,0 +1,83 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:golden_leggings", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.leggings", + "amount": 3, + "operation": "add_value", + "slot": "legs" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:105,identified:0,armor_clamp:-3,slot:2,material:4,name:'{\"italic\":false,\"translate\":\"item.minecraft.golden_leggings\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.2 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.3 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.2 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/iron/chest.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/iron/chest.json new file mode 100644 index 0000000000..de72b52c60 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/iron/chest.json @@ -0,0 +1,83 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:iron_chestplate", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.chestplate", + "amount": 6, + "operation": "add_value", + "slot": "chest" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:240,identified:0,armor_clamp:-6,slot:1,material:3,name:'{\"italic\":false,\"translate\":\"item.minecraft.iron_chestplate\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.15 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.25 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.2 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/iron/feet.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/iron/feet.json new file mode 100644 index 0000000000..c1cbc51d25 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/iron/feet.json @@ -0,0 +1,83 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:iron_boots", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.boots", + "amount": 2, + "operation": "add_value", + "slot": "feet" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:195,identified:0,armor_clamp:-2,slot:3,material:3,name:'{\"italic\":false,\"translate\":\"item.minecraft.iron_boots\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.15 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.25 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.2 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/iron/head.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/iron/head.json new file mode 100644 index 0000000000..bba69ced9e --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/iron/head.json @@ -0,0 +1,83 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:iron_helmet", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.helmet", + "amount": 2, + "operation": "add_value", + "slot": "head" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:165,identified:0,armor_clamp:-2,slot:0,material:3,name:'{\"italic\":false,\"translate\":\"item.minecraft.iron_helmet\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.15 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.25 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.2 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/iron/legs.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/iron/legs.json new file mode 100644 index 0000000000..72328ca86b --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/iron/legs.json @@ -0,0 +1,83 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:iron_leggings", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.leggings", + "amount": 5, + "operation": "add_value", + "slot": "legs" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:225,identified:0,armor_clamp:-5,slot:2,material:3,name:'{\"italic\":false,\"translate\":\"item.minecraft.iron_leggings\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.15 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.25 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.2 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/leather/chest.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/leather/chest.json new file mode 100644 index 0000000000..cc26a1021c --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/leather/chest.json @@ -0,0 +1,83 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:leather_chestplate", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.chestplate", + "amount": 3, + "operation": "add_value", + "slot": "chest" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:80,identified:0,armor_clamp:-3,slot:1,material:1,name:'{\"italic\":false,\"translate\":\"item.minecraft.leather_chestplate\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.15 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.25 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.1 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/leather/feet.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/leather/feet.json new file mode 100644 index 0000000000..e2e1a676ab --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/leather/feet.json @@ -0,0 +1,83 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:leather_boots", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.boots", + "amount": 1, + "operation": "add_value", + "slot": "feet" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:65,identified:0,armor_clamp:-1,slot:3,material:1,name:'{\"italic\":false,\"translate\":\"item.minecraft.leather_boots\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.15 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.25 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.1 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/leather/head.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/leather/head.json new file mode 100644 index 0000000000..14da55ea7f --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/leather/head.json @@ -0,0 +1,83 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:leather_helmet", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.helmet", + "amount": 1, + "operation": "add_value", + "slot": "head" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:55,identified:0,armor_clamp:-1,slot:0,material:1,name:'{\"italic\":false,\"translate\":\"item.minecraft.leather_helmet\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.15 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.25 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.1 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/leather/legs.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/leather/legs.json new file mode 100644 index 0000000000..0302ce954d --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/leather/legs.json @@ -0,0 +1,83 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:leather_leggings", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.leggings", + "amount": 2, + "operation": "add_value", + "slot": "legs" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:75,identified:0,armor_clamp:-2,slot:2,material:1,name:'{\"italic\":false,\"translate\":\"item.minecraft.leather_leggings\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.15 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.25 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.1 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/special/turtle_helmet.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/special/turtle_helmet.json new file mode 100644 index 0000000000..657cd0f42e --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/material/special/turtle_helmet.json @@ -0,0 +1,83 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:turtle_helmet", + "functions": [ + { + "function": "minecraft:set_attributes", + "replace": false, + "modifiers": [ + { + "attribute": "minecraft:armor", + "id": "minecraft:armor.helmet", + "amount": 2, + "operation": "add_value", + "slot": "head" + } + ] + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "entity": "this", + "lore": [ + { + "translate": "item.gm4.augmented_armor.lore.unidentified", + "fallback": "%s Unidentified Item - Drop to Identify", + "with": [ + { + "text": "⚠", + "color": "red", + "italic": false + } + ], + "color": "dark_red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_augmented_armor:{durability:275,identified:0,armor_clamp:-2,slot:0,material:-1,name:'{\"italic\":false,\"translate\":\"item.minecraft.turtle_helmet\"}'}}" + }, + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.15 + }, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_aa_data", + "scale": 0.25 + } + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.2 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/stat_randomize/armor.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/stat_randomize/armor.json new file mode 100644 index 0000000000..284931f41e --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/stat_randomize/armor.json @@ -0,0 +1,33 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ] + }, + { + "rolls": { + "type": "minecraft:binomial", + "n": 2, + "p": 0.6 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.5 + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/stat_randomize/atkspeed.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/stat_randomize/atkspeed.json new file mode 100644 index 0000000000..7ed3b138ea --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/stat_randomize/atkspeed.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 10, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ] + }, + { + "rolls": { + "type": "minecraft:binomial", + "n": 15, + "p": 0.3 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/stat_randomize/damage.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/stat_randomize/damage.json new file mode 100644 index 0000000000..c39a9ee4a6 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/stat_randomize/damage.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ] + }, + { + "rolls": { + "type": "minecraft:binomial", + "n": 3, + "p": 0.4 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/stat_randomize/speed.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/stat_randomize/speed.json new file mode 100644 index 0000000000..941bf06e17 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/armor/stat_randomize/speed.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 5, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ] + }, + { + "rolls": { + "type": "minecraft:binomial", + "n": 15, + "p": 0.3 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/generic/chest.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/generic/chest.json new file mode 100644 index 0000000000..b6dc7b14a5 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/generic/chest.json @@ -0,0 +1,115 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/diamond/chest", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/diamond" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 2 + } + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/golden/chest", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/golden" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 1 + } + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/iron/chest", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/iron" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 1 + } + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/chainmail/chest", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/chainmail" + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/leather/chest" + } + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_chance" + }, + "score": "gm4_sr_data", + "scale": 0.05 + } + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/generic/feet.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/generic/feet.json new file mode 100644 index 0000000000..367367f584 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/generic/feet.json @@ -0,0 +1,115 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/diamond/feet", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/diamond" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 2 + } + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/golden/feet", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/golden" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 1 + } + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/iron/feet", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/iron" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 1 + } + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/chainmail/feet", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/chainmail" + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/leather/feet" + } + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_chance" + }, + "score": "gm4_sr_data", + "scale": 0.05 + } + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/generic/head.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/generic/head.json new file mode 100644 index 0000000000..5c30a461ec --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/generic/head.json @@ -0,0 +1,125 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/special/turtle_helmet", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/turtle_helmet" + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/diamond/head", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/diamond" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 2 + } + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/golden/head", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/golden" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 1 + } + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/iron/head", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/iron" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 1 + } + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/chainmail/head", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/chainmail" + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/leather/head" + } + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_chance" + }, + "score": "gm4_sr_data", + "scale": 0.05 + } + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/generic/legs.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/generic/legs.json new file mode 100644 index 0000000000..19e92b6445 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/generic/legs.json @@ -0,0 +1,115 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/diamond/legs", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/diamond" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 2 + } + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/golden/legs", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/golden" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 1 + } + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/iron/legs", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/iron" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 1 + } + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/chainmail/legs", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/chainmail" + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/leather/legs" + } + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_chance" + }, + "score": "gm4_sr_data", + "scale": 0.05 + } + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/piglin/chest.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/piglin/chest.json new file mode 100644 index 0000000000..91c3638352 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/piglin/chest.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/golden/chest", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.5 + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/piglin/feet.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/piglin/feet.json new file mode 100644 index 0000000000..ff0dd8632d --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/piglin/feet.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/golden/feet", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.5 + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/piglin/head.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/piglin/head.json new file mode 100644 index 0000000000..bc560fc4ea --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/piglin/head.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/golden/head", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.5 + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/piglin/legs.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/piglin/legs.json new file mode 100644 index 0000000000..3e9c425ed8 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/piglin/legs.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/golden/legs", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.5 + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/wither_skeleton/chest.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/wither_skeleton/chest.json new file mode 100644 index 0000000000..adf9c7ec0d --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/wither_skeleton/chest.json @@ -0,0 +1,45 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/iron/chest", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/iron" + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/chainmail/chest", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/chainmail" + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4:empty" + } + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.666 + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/wither_skeleton/feet.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/wither_skeleton/feet.json new file mode 100644 index 0000000000..b49be943de --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/wither_skeleton/feet.json @@ -0,0 +1,45 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/iron/feet", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/iron" + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/chainmail/feet", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/chainmail" + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4:empty" + } + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.666 + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/wither_skeleton/head.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/wither_skeleton/head.json new file mode 100644 index 0000000000..10de904e3c --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/wither_skeleton/head.json @@ -0,0 +1,45 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/iron/head", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/iron" + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/chainmail/head", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/chainmail" + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4:empty" + } + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.666 + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/wither_skeleton/legs.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/wither_skeleton/legs.json new file mode 100644 index 0000000000..6c35341fe6 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/mob/wither_skeleton/legs.json @@ -0,0 +1,45 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/iron/legs", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/iron" + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4_augmented_armor:armor/material/chainmail/legs", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/chainmail" + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4:empty" + } + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.666 + } + ] + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/technical/enchant_randomly.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/technical/enchant_randomly.json new file mode 100644 index 0000000000..814bba3177 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/technical/enchant_randomly.json @@ -0,0 +1,23 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:book" + } + ], + "functions": [ + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": 30, + "max": 55 + }, + "options": "#minecraft:non_treasure" + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/technical/roll_damage.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/technical/roll_damage.json new file mode 100644 index 0000000000..22689ea062 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/technical/roll_damage.json @@ -0,0 +1,33 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": { + "type": "minecraft:binomial", + "n": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$damage_opportunities" + }, + "score": "gm4_aa_data" + }, + "p": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$damage_chance" + }, + "score": "gm4_aa_data", + "scale": 0.01 + } + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/technical/wild_magic_level.json b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/technical/wild_magic_level.json new file mode 100644 index 0000000000..8f290c96e6 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/loot_table/technical/wild_magic_level.json @@ -0,0 +1,27 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": { + "min": 0, + "max": { + "min": 0, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$add" + }, + "score": "gm4_aa_data" + } + } + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ] + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/predicate/modified_armor/augment/hearty.json b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/modified_armor/augment/hearty.json new file mode 100644 index 0000000000..2276f90b47 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/modified_armor/augment/hearty.json @@ -0,0 +1,63 @@ +[ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "feet": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{name:hearty}}}" + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "legs": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{name:hearty}}}" + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "chest": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{name:hearty}}}" + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{name:hearty}}}" + } + } + } + } + } + ] + } +] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/predicate/modified_armor/augment/psychic.json b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/modified_armor/augment/psychic.json new file mode 100644 index 0000000000..4d2c4d873e --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/modified_armor/augment/psychic.json @@ -0,0 +1,63 @@ +[ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "feet": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{name:psychic}}}" + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "legs": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{name:psychic}}}" + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "chest": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{name:psychic}}}" + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{name:psychic}}}" + } + } + } + } + } + ] + } +] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/predicate/modified_armor/generic_clocked.json b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/modified_armor/generic_clocked.json new file mode 100644 index 0000000000..02adf6c104 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/modified_armor/generic_clocked.json @@ -0,0 +1,63 @@ +[ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "feet": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{triggers:{clocked:1}}}}" + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "legs": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{triggers:{clocked:1}}}}" + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "chest": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{triggers:{clocked:1}}}}" + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{triggers:{clocked:1}}}}" + } + } + } + } + } + ] + } +] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/predicate/modified_armor/generic_damage_dealt.json b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/modified_armor/generic_damage_dealt.json new file mode 100644 index 0000000000..2692da10de --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/modified_armor/generic_damage_dealt.json @@ -0,0 +1,63 @@ +[ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "feet": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{triggers:{damage_dealt:1}}}}" + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "legs": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{triggers:{damage_dealt:1}}}}" + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "chest": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{triggers:{damage_dealt:1}}}}" + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{triggers:{damage_dealt:1}}}}" + } + } + } + } + } + ] + } +] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/predicate/modified_armor/generic_damage_taken.json b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/modified_armor/generic_damage_taken.json new file mode 100644 index 0000000000..8352d59b9b --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/modified_armor/generic_damage_taken.json @@ -0,0 +1,63 @@ +[ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "feet": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{triggers:{damage_taken:1}}}}" + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "legs": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{triggers:{damage_taken:1}}}}" + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "chest": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{triggers:{damage_taken:1}}}}" + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "items": "#gm4_survival_refightalized:armor", + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{augment:{triggers:{damage_taken:1}}}}" + } + } + } + } + } + ] + } +] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/chance/link_particle.json b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/chance/link_particle.json new file mode 100644 index 0000000000..412ccb23a7 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/chance/link_particle.json @@ -0,0 +1,14 @@ +{ + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:binomial", + "n": 1, + "p": { + "type": "minecraft:score", + "target": "this", + "score": "gm4_aa_data", + "scale": 0.05 + } + }, + "range": 1 +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/convert_netherite/chest.json b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/convert_netherite/chest.json new file mode 100644 index 0000000000..fe278fe9f2 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/convert_netherite/chest.json @@ -0,0 +1,31 @@ +[ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "chest": { + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{netherite:1}}" + } + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "chest": { + "items": [ + "minecraft:netherite_chestplate" + ] + } + } + } + } +] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/convert_netherite/feet.json b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/convert_netherite/feet.json new file mode 100644 index 0000000000..f0d550dad1 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/convert_netherite/feet.json @@ -0,0 +1,31 @@ +[ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "feet": { + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{netherite:1}}" + } + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "feet": { + "items": [ + "minecraft:netherite_boots" + ] + } + } + } + } +] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/convert_netherite/head.json b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/convert_netherite/head.json new file mode 100644 index 0000000000..f8860e2254 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/convert_netherite/head.json @@ -0,0 +1,31 @@ +[ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{netherite:1}}" + } + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "items": [ + "minecraft:netherite_helmet" + ] + } + } + } + } +] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/convert_netherite/legs.json b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/convert_netherite/legs.json new file mode 100644 index 0000000000..1ec8b8a50d --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/convert_netherite/legs.json @@ -0,0 +1,31 @@ +[ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "legs": { + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{netherite:1}}" + } + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "legs": { + "items": [ + "minecraft:netherite_leggings" + ] + } + } + } + } +] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/convert_netherite/weapon.json b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/convert_netherite/weapon.json new file mode 100644 index 0000000000..09859f0613 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/convert_netherite/weapon.json @@ -0,0 +1,34 @@ +[ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "predicates": { + "minecraft:custom_data": "{gm4_augmented_armor:{netherite:1}}" + } + } + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": [ + "minecraft:netherite_axe", + "minecraft:netherite_sword", + "minecraft:netherite_shovel", + "minecraft:netherite_pickaxe" + ] + } + } + } + } +] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/crouching.json b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/crouching.json new file mode 100644 index 0000000000..aab0ccb010 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/crouching.json @@ -0,0 +1,11 @@ +[ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "flags": { + "is_sneaking": true + } + } + } +] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/on_fire.json b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/on_fire.json new file mode 100644 index 0000000000..81903de6b6 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/on_fire.json @@ -0,0 +1,9 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "flags": { + "is_on_fire": true + } + } + } diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/pvp_able.json b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/pvp_able.json new file mode 100644 index 0000000000..6c4806b062 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/pvp_able.json @@ -0,0 +1,33 @@ +{ + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4:hostile" + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4:neutral", + "targeted_entity": { + "type": "minecraft:player" + } + } + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": "this", + "score": "gm4_aa_in_pvp" + }, + "range": { + "min": 1 + } + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/under_negative_effect.json b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/under_negative_effect.json new file mode 100644 index 0000000000..09c97ee55f --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/under_negative_effect.json @@ -0,0 +1,104 @@ +{ + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "effects": { + "minecraft:slowness": {} + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "effects": { + "minecraft:mining_fatigue": {} + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "effects": { + "minecraft:instant_damage": {} + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "effects": { + "minecraft:nausea": {} + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "effects": { + "minecraft:blindness": {} + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "effects": { + "minecraft:hunger": {} + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "effects": { + "minecraft:weakness": {} + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "effects": { + "minecraft:poison": {} + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "effects": { + "minecraft:wither": {} + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "effects": { + "minecraft:darkness": {} + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "flags": { + "is_on_fire": true + } + } + } + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/valid_tp.json b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/valid_tp.json new file mode 100644 index 0000000000..11032fe31d --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/predicate/technical/valid_tp.json @@ -0,0 +1,73 @@ +[ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetY": -1, + "predicate": { + "block": { + "blocks": "#gm4:no_collision" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:location_check", + "offsetY": 1, + "predicate": { + "fluid": { + "fluids": "#minecraft:lava" + } + } + }, + { + "condition": "minecraft:location_check", + "predicate": { + "fluid": { + "fluids": "#minecraft:lava" + } + } + }, + { + "condition": "minecraft:location_check", + "offsetY": 1, + "predicate": { + "fluid": { + "fluids": "#minecraft:water" + } + } + }, + { + "condition": "minecraft:location_check", + "predicate": { + "fluid": { + "fluids": "#minecraft:water" + } + } + } + ] + } + }, + { + "condition": "minecraft:location_check", + "offsetY": 1, + "predicate": { + "block": { + "blocks": "#gm4:no_collision" + } + } + }, + { + "condition": "minecraft:location_check", + "predicate": { + "block": { + "blocks": "#gm4:no_collision" + } + } + } +] diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/tags/block/light_placeable.json b/gm4_augmented_armor/data/gm4_augmented_armor/tags/block/light_placeable.json new file mode 100644 index 0000000000..6ed7f435b4 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/tags/block/light_placeable.json @@ -0,0 +1,6 @@ +{ + "values": [ + "#minecraft:air", + "minecraft:water" + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/arrow.json b/gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/arrow.json new file mode 100644 index 0000000000..2992991bd0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/arrow.json @@ -0,0 +1,6 @@ +{ + "values": [ + "minecraft:arrow", + "minecraft:spectral_arrow" + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/augment_immune.json b/gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/augment_immune.json new file mode 100644 index 0000000000..17af103df0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/augment_immune.json @@ -0,0 +1,6 @@ +{ + "values": [ + "#gm4:non_living", + "minecraft:armor_stand" + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/augment_resist.json b/gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/augment_resist.json new file mode 100644 index 0000000000..07c8f3634e --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/tags/entity_type/augment_resist.json @@ -0,0 +1,7 @@ +{ + "values": [ + "#gm4_augmented_armor:augment_immune", + "#gm4:neutral_passive", + "#gm4:passive" + ] +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/wolf_variant/gm4_aa_canine.json b/gm4_augmented_armor/data/gm4_augmented_armor/wolf_variant/gm4_aa_canine.json new file mode 100644 index 0000000000..d5b674330c --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/wolf_variant/gm4_aa_canine.json @@ -0,0 +1,6 @@ +{ + "angry_texture": "gm4_augmented_armor:entity/wolf/gm4_aa_canine_angry", + "biomes": "minecraft:the_void", + "tame_texture": "gm4_augmented_armor:entity/wolf/gm4_aa_canine_tame", + "wild_texture": "gm4_augmented_armor:entity/wolf/gm4_aa_canine" +} diff --git a/gm4_augmented_armor/data/gm4_augmented_armor/wolf_variant/gm4_aa_canine_alt.json b/gm4_augmented_armor/data/gm4_augmented_armor/wolf_variant/gm4_aa_canine_alt.json new file mode 100644 index 0000000000..2bb4469c44 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_augmented_armor/wolf_variant/gm4_aa_canine_alt.json @@ -0,0 +1,6 @@ +{ + "angry_texture": "gm4_augmented_armor:entity/wolf/gm4_aa_canine_alt_angry", + "biomes": "minecraft:mushroom_fields", + "tame_texture": "gm4_augmented_armor:entity/wolf/gm4_aa_canine_alt_tame", + "wild_texture": "gm4_augmented_armor:entity/wolf/gm4_aa_canine_alt" +} diff --git a/gm4_augmented_armor/data/gm4_survival_refightalized/tags/function/armor_break.json b/gm4_augmented_armor/data/gm4_survival_refightalized/tags/function/armor_break.json new file mode 100644 index 0000000000..b91d2a22e0 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_survival_refightalized/tags/function/armor_break.json @@ -0,0 +1,5 @@ +{ + "values": [ + "gm4_augmented_armor:armor/trigger/armor_break" + ] +} diff --git a/gm4_augmented_armor/data/gm4_survival_refightalized/tags/function/combat_regeneration.json b/gm4_augmented_armor/data/gm4_survival_refightalized/tags/function/combat_regeneration.json new file mode 100644 index 0000000000..6a1a5db7ce --- /dev/null +++ b/gm4_augmented_armor/data/gm4_survival_refightalized/tags/function/combat_regeneration.json @@ -0,0 +1,5 @@ +{ + "values": [ + "gm4_augmented_armor:player/combat_regeneration/on_apply" + ] +} diff --git a/gm4_augmented_armor/data/gm4_survival_refightalized/tags/function/damage_taken.json b/gm4_augmented_armor/data/gm4_survival_refightalized/tags/function/damage_taken.json new file mode 100644 index 0000000000..5681cb79a7 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_survival_refightalized/tags/function/damage_taken.json @@ -0,0 +1,5 @@ +{ + "values": [ + "gm4_augmented_armor:player/damage_taken" + ] +} diff --git a/gm4_augmented_armor/data/gm4_survival_refightalized/tags/function/fired_arrow.json b/gm4_augmented_armor/data/gm4_survival_refightalized/tags/function/fired_arrow.json new file mode 100644 index 0000000000..853185a50c --- /dev/null +++ b/gm4_augmented_armor/data/gm4_survival_refightalized/tags/function/fired_arrow.json @@ -0,0 +1,5 @@ +{ + "values": [ + "gm4_augmented_armor:armor/trigger/fired_arrow" + ] +} diff --git a/gm4_augmented_armor/data/gm4_survival_refightalized/tags/function/main.json b/gm4_augmented_armor/data/gm4_survival_refightalized/tags/function/main.json new file mode 100644 index 0000000000..7f86999a32 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_survival_refightalized/tags/function/main.json @@ -0,0 +1,5 @@ +{ + "values": [ + "gm4_augmented_armor:main" + ] +} diff --git a/gm4_augmented_armor/data/gm4_survival_refightalized/tags/function/player_submain.json b/gm4_augmented_armor/data/gm4_survival_refightalized/tags/function/player_submain.json new file mode 100644 index 0000000000..f2fba60634 --- /dev/null +++ b/gm4_augmented_armor/data/gm4_survival_refightalized/tags/function/player_submain.json @@ -0,0 +1,5 @@ +{ + "values": [ + "gm4_augmented_armor:player/player_submain" + ] +} diff --git a/gm4_augmented_armor/images/augmented_armor.png b/gm4_augmented_armor/images/augmented_armor.png new file mode 100644 index 0000000000..113458931d Binary files /dev/null and b/gm4_augmented_armor/images/augmented_armor.png differ diff --git a/gm4_augmented_armor/pack.svg b/gm4_augmented_armor/pack.svg new file mode 100644 index 0000000000..dbcaa8744a --- /dev/null +++ b/gm4_augmented_armor/pack.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gm4_guidebook/triggers.json b/gm4_guidebook/triggers.json index b4b7ed6745..0a0b858bc5 100644 --- a/gm4_guidebook/triggers.json +++ b/gm4_guidebook/triggers.json @@ -1,6 +1,6 @@ { "__important__": "Generated by generate_guidebooks.py. Don't manually update this", - "__next__": 119, + "__next__": 120, "animi_shamir": 91, "apple_trees": 83, "arborenda_shamir": 20, @@ -66,6 +66,7 @@ "metallurgy": 28, "mob_curing": 38, "moneo_shamir": 18, + "monsters_unbound": 119, "mountaineering": 110, "musical_shamir": 29, "mysterious_midnights": 42, @@ -98,6 +99,7 @@ "standard_crafting": 93, "standard_liquids": 64, "sunken_treasure": 4, + "survival_refightalized": 118, "sweethearts": 33, "teleportation_anchors": 114, "tinker_shamir": 26, diff --git a/gm4_heart_canisters/data/gm4_heart_canisters/test/apply_tier_1.mcfunction b/gm4_heart_canisters/data/gm4_heart_canisters/test/apply_tier_1.mcfunction index 03caa6701d..fe4ca3e6e9 100644 --- a/gm4_heart_canisters/data/gm4_heart_canisters/test/apply_tier_1.mcfunction +++ b/gm4_heart_canisters/data/gm4_heart_canisters/test/apply_tier_1.mcfunction @@ -1,5 +1,8 @@ # @dummy +# Give regeneration so this test does not rely on naturalRegeneration gamerule +effect give @s minecraft:regeneration infinite 100 + loot give @s loot gm4_heart_canisters:items/tier_1_heart_canister await delay 1s diff --git a/gm4_heart_canisters/data/gm4_heart_canisters/test/apply_tier_2.mcfunction b/gm4_heart_canisters/data/gm4_heart_canisters/test/apply_tier_2.mcfunction index f81328ed4d..9e31bf7f0b 100644 --- a/gm4_heart_canisters/data/gm4_heart_canisters/test/apply_tier_2.mcfunction +++ b/gm4_heart_canisters/data/gm4_heart_canisters/test/apply_tier_2.mcfunction @@ -1,5 +1,8 @@ # @dummy +# Give regeneration so this test does not rely on naturalRegeneration gamerule +effect give @s minecraft:regeneration infinite 100 + loot give @s loot gm4_heart_canisters:items/tier_1_heart_canister loot give @s loot gm4_heart_canisters:items/tier_1_heart_canister loot give @s loot gm4_heart_canisters:items/tier_1_heart_canister diff --git a/gm4_monsters_unbound/README.md b/gm4_monsters_unbound/README.md new file mode 100644 index 0000000000..58c390c479 --- /dev/null +++ b/gm4_monsters_unbound/README.md @@ -0,0 +1,14 @@ +# Monsters Unbound + +Use special weapon and armour modifiers to defend against mobs that grow ever stronger! + +Spore Zombies in Lush Caves + +### Features +- The longer you stay alive the stronger mobs will become. +- Different biomes grant special buffs to mobs that spawn in them, creating bigger Slimes or Spore Zombies that keep regrowing! +- Weaker Phantoms that take damage if they try to fly into water, as they deserve. +- Mobs will drop new Modified armour and weapons. These come with special attributes that allow you to customize your gear! +- Modifiers range from a ramping speed boost to a loyal immortal dog to fight by your side. Or a piece of armour that teleports you randomly, if that's what you like. + +A full list of all modifiers to mobs, weapons and armor can be found at the [Wiki](https://wiki.gm4.co/Monsters_Unbound). diff --git a/gm4_monsters_unbound/assets/gm4_monsters_unbound/models/item/elite_headwear/glacial.json b/gm4_monsters_unbound/assets/gm4_monsters_unbound/models/item/elite_headwear/glacial.json new file mode 100644 index 0000000000..2d792a5ee7 --- /dev/null +++ b/gm4_monsters_unbound/assets/gm4_monsters_unbound/models/item/elite_headwear/glacial.json @@ -0,0 +1,278 @@ +{ + "textures": { + "0": "gm4_monsters_unbound:item/elite_headwear/glacial", + "particle": "gm4_monsters_unbound:item/elite_headwear/glacial" + }, + "elements": [ + { + "from": [3, 1, 8], + "to": [8, 15, 8], + "rotation": {"angle": 45, "axis": "z", "origin": [5.5, 4, 8]}, + "faces": { + "north": {"uv": [0, 0, 5, 14], "texture": "#0"}, + "south": {"uv": [0, 0, 5, 14], "texture": "#0"} + } + }, + { + "from": [8.5, 1.5, 7], + "to": [8.5, 6.5, 21], + "rotation": {"angle": -22.5, "axis": "x", "origin": [8.5, 4, 10]}, + "faces": { + "east": {"uv": [0, 0, 5, 14], "rotation": 270, "texture": "#0"}, + "west": {"uv": [0, 0, 5, 14], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [6, 4, 7], + "to": [11, 4, 21], + "rotation": {"angle": -22.5, "axis": "x", "origin": [8.5, 4, 10]}, + "faces": { + "up": {"uv": [0, 0, 5, 14], "rotation": 180, "texture": "#0"}, + "down": {"uv": [0, 0, 5, 14], "texture": "#0"} + } + }, + { + "from": [9.5, 4, 2.5], + "to": [9.5, 18, 7.5], + "rotation": {"angle": -22.5, "axis": "z", "origin": [9.5, 7, 5]}, + "faces": { + "east": {"uv": [0, 0, 5, 14], "texture": "#0"}, + "west": {"uv": [0, 0, 5, 14], "texture": "#0"} + } + }, + { + "from": [7, 4, 5], + "to": [12, 18, 5], + "rotation": {"angle": -22.5, "axis": "z", "origin": [9.5, 7, 5]}, + "faces": { + "north": {"uv": [0, 0, 5, 14], "texture": "#0"}, + "south": {"uv": [0, 0, 5, 14], "texture": "#0"} + } + }, + { + "from": [7, 2, -3.675], + "to": [12, 2, 10.325], + "rotation": {"angle": -22.5, "axis": "y", "origin": [9.5, 2, 7.325]}, + "faces": { + "up": {"uv": [0, 0, 5, 14], "texture": "#0"}, + "down": {"uv": [0, 0, 5, 14], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [9.5, -0.5, -3.675], + "to": [9.5, 4.5, 10.325], + "rotation": {"angle": -22.5, "axis": "y", "origin": [9.5, 2, 7.325]}, + "faces": { + "east": {"uv": [0, 0, 5, 14], "rotation": 90, "texture": "#0"}, + "west": {"uv": [0, 0, 5, 14], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [5.5, 1, 5.5], + "to": [5.5, 15, 10.5], + "rotation": {"angle": 45, "axis": "z", "origin": [5.5, 4, 8]}, + "faces": { + "east": {"uv": [0, 0, 5, 14], "texture": "#0"}, + "west": {"uv": [0, 0, 5, 14], "texture": "#0"} + } + }, + { + "from": [8.75, 5, -2.75], + "to": [11.75, 5, 6.25], + "rotation": {"angle": 22.5, "axis": "x", "origin": [10.25, 5, 4.25]}, + "faces": { + "up": {"uv": [5, 0, 8, 9], "texture": "#0"}, + "down": {"uv": [5, 0, 8, 9], "rotation": 180, "texture": "#0"} + } + }, + { + "from": [-2.75, 1.5, 7.25], + "to": [6.25, 4.5, 7.25], + "rotation": {"angle": -22.5, "axis": "y", "origin": [4.25, 3, 7.25]}, + "faces": { + "north": {"uv": [5, 0, 8, 9], "rotation": 90, "texture": "#0"}, + "south": {"uv": [5, 0, 8, 9], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [-2.75, 3, 5.75], + "to": [6.25, 3, 8.75], + "rotation": {"angle": -22.5, "axis": "y", "origin": [4.25, 3, 7.25]}, + "faces": { + "up": {"uv": [5, 0, 8, 9], "rotation": 270, "texture": "#0"}, + "down": {"uv": [5, 0, 8, 9], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [9.25, 3, 5.75], + "to": [18.25, 3, 8.75], + "rotation": {"angle": -22.5, "axis": "z", "origin": [11.25, 3, 7.25]}, + "faces": { + "up": {"uv": [5, 0, 8, 9], "rotation": 90, "texture": "#0"}, + "down": {"uv": [5, 0, 8, 9], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [9.25, 0.5, 7.25], + "to": [18.25, 3.5, 7.25], + "rotation": {"angle": -22.5, "axis": "z", "origin": [11.25, 2, 7.25]}, + "faces": { + "north": {"uv": [5, 0, 8, 9], "rotation": 270, "texture": "#0"}, + "south": {"uv": [5, 0, 8, 9], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [3.75, 2, 10.25], + "to": [6.75, 2, 19.25], + "rotation": {"angle": -45, "axis": "y", "origin": [5.25, 2, 12.25]}, + "faces": { + "up": {"uv": [5, 0, 8, 9], "rotation": 180, "texture": "#0"}, + "down": {"uv": [5, 0, 8, 9], "texture": "#0"} + } + }, + { + "from": [5.25, 0.5, 10.25], + "to": [5.25, 3.5, 19.25], + "rotation": {"angle": -45, "axis": "y", "origin": [5.25, 2, 12.25]}, + "faces": { + "east": {"uv": [5, 0, 8, 9], "rotation": 270, "texture": "#0"}, + "west": {"uv": [5, 0, 8, 9], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [10.75, 2, 7.25], + "to": [13.75, 2, 16.25], + "rotation": {"angle": 45, "axis": "y", "origin": [12.25, 2, 9.25]}, + "faces": { + "up": {"uv": [5, 0, 8, 9], "rotation": 180, "texture": "#0"}, + "down": {"uv": [5, 0, 8, 9], "texture": "#0"} + } + }, + { + "from": [12.25, 0.5, 7.25], + "to": [12.25, 3.5, 16.25], + "rotation": {"angle": 45, "axis": "y", "origin": [12.25, 2, 9.25]}, + "faces": { + "east": {"uv": [5, 0, 8, 9], "rotation": 270, "texture": "#0"}, + "west": {"uv": [5, 0, 8, 9], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [10.25, 3.5, -2.75], + "to": [10.25, 6.5, 6.25], + "rotation": {"angle": 22.5, "axis": "x", "origin": [10.25, 5, 4.25]}, + "faces": { + "east": {"uv": [5, 0, 8, 9], "rotation": 90, "texture": "#0"}, + "west": {"uv": [5, 0, 8, 9], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [8.25, 4, 8.75], + "to": [23.25, 4, 11.75], + "rotation": {"angle": 22.5, "axis": "z", "origin": [12.25, 4, 10.25]}, + "faces": { + "up": {"uv": [9, 0, 12, 15], "rotation": 90, "texture": "#0"}, + "down": {"uv": [9, 0, 12, 15], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [4.75, 5, 9.25], + "to": [7.75, 20, 9.25], + "rotation": {"angle": 22.5, "axis": "z", "origin": [6.25, 9, 9.25]}, + "faces": { + "north": {"uv": [9, 0, 12, 15], "texture": "#0"}, + "south": {"uv": [5, 0, 8, 9], "texture": "#0"} + } + }, + { + "from": [6.25, 5, 7.75], + "to": [6.25, 20, 10.75], + "rotation": {"angle": 22.5, "axis": "z", "origin": [6.25, 9, 9.25]}, + "faces": { + "east": {"uv": [9, 0, 12, 15], "texture": "#0"}, + "west": {"uv": [9, 0, 12, 15], "texture": "#0"} + } + }, + { + "from": [8.75, 3, 10.25], + "to": [11.75, 18, 10.25], + "rotation": {"angle": -45, "axis": "z", "origin": [10.25, 7, 10.25]}, + "faces": { + "north": {"uv": [9, 0, 12, 15], "texture": "#0"}, + "south": {"uv": [5, 0, 8, 9], "texture": "#0"} + } + }, + { + "from": [10.25, 3, 8.75], + "to": [10.25, 18, 11.75], + "rotation": {"angle": -45, "axis": "z", "origin": [10.25, 7, 10.25]}, + "faces": { + "east": {"uv": [9, 0, 12, 15], "texture": "#0"}, + "west": {"uv": [9, 0, 12, 15], "texture": "#0"} + } + }, + { + "from": [8.25, 2.5, 10.25], + "to": [23.25, 5.5, 10.25], + "rotation": {"angle": 22.5, "axis": "z", "origin": [12.25, 4, 10.25]}, + "faces": { + "north": {"uv": [9, 0, 12, 15], "rotation": 270, "texture": "#0"}, + "south": {"uv": [5, 0, 8, 9], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [8.75, 2, 6.25], + "to": [11.75, 2, 21.25], + "rotation": {"angle": 22.5, "axis": "x", "origin": [10.25, 2, 10.25]}, + "faces": { + "up": {"uv": [9, 0, 12, 15], "rotation": 180, "texture": "#0"}, + "down": {"uv": [9, 0, 12, 15], "texture": "#0"} + } + }, + { + "from": [10.25, 0.5, 6.25], + "to": [10.25, 3.5, 21.25], + "rotation": {"angle": 22.5, "axis": "x", "origin": [10.25, 2, 10.25]}, + "faces": { + "east": {"uv": [9, 0, 12, 15], "rotation": 270, "texture": "#0"}, + "west": {"uv": [5, 0, 8, 9], "rotation": 90, "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "thirdperson_lefthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_lefthand": { + "rotation": [0, 225, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 3, 0], + "scale": [0.25, 0.25, 0.25] + }, + "gui": { + "rotation": [30, 225, 0], + "scale": [0.625, 0.625, 0.625] + }, + "head": { + "rotation": [0, -22.5, 0], + "translation": [0, 6.45, 0], + "scale": [1.61, 1.61, 1.61] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + } + } +} diff --git a/gm4_monsters_unbound/assets/gm4_monsters_unbound/models/item/elite_headwear/mending.json b/gm4_monsters_unbound/assets/gm4_monsters_unbound/models/item/elite_headwear/mending.json new file mode 100644 index 0000000000..46f78b1029 --- /dev/null +++ b/gm4_monsters_unbound/assets/gm4_monsters_unbound/models/item/elite_headwear/mending.json @@ -0,0 +1,251 @@ +{ + "textures": { + "0": "gm4_monsters_unbound:item/elite_headwear/mending", + "particle": "gm4_monsters_unbound:item/elite_headwear/mending" + }, + "elements": [ + { + "from": [4, 0, 3.5], + "to": [12, 8, 3.5], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 0, 3.5]}, + "faces": { + "north": {"uv": [0, 0, 4, 4], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "south": {"uv": [0, 0, 4, 4], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "up": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "down": {"uv": [4, 0, 0, 0], "texture": "#0"} + } + }, + { + "from": [4, 7, 7], + "to": [6, 12, 8], + "rotation": {"angle": 22.5, "axis": "z", "origin": [4, 8, 7]}, + "faces": { + "north": {"uv": [1, 5.5, 2, 8], "texture": "#0"}, + "east": {"uv": [1, 5.5, 1.5, 8], "texture": "#0"}, + "south": {"uv": [1, 5.5, 2, 8], "texture": "#0"}, + "west": {"uv": [1, 5.5, 1.5, 8], "texture": "#0"}, + "up": {"uv": [4, 4.5, 3, 4], "texture": "#0"}, + "down": {"uv": [6, 2.5, 5, 3], "texture": "#0"} + } + }, + { + "from": [11.60685, 14.31283, 7], + "to": [12.60685, 16.31283, 8], + "rotation": {"angle": 22.5, "axis": "z", "origin": [11.60685, 14.31283, 7]}, + "faces": { + "north": {"uv": [0.5, 4, 1, 5], "texture": "#0"}, + "east": {"uv": [0.5, 4, 1, 5], "texture": "#0"}, + "south": {"uv": [0.5, 4, 1, 5], "texture": "#0"}, + "west": {"uv": [0.5, 4, 1, 5], "texture": "#0"}, + "up": {"uv": [3.5, 5, 3, 4.5], "texture": "#0"}, + "down": {"uv": [4.5, 2.5, 4, 3], "texture": "#0"} + } + }, + { + "from": [11.53073, 11.69552, 7], + "to": [12.53073, 14.69552, 8], + "rotation": {"angle": 0, "axis": "y", "origin": [11.53073, 11.69552, 7]}, + "faces": { + "north": {"uv": [0.5, 4.5, 1, 6], "texture": "#0"}, + "east": {"uv": [0.5, 4.5, 1, 6], "texture": "#0"}, + "south": {"uv": [0.5, 4.5, 1, 6], "texture": "#0"}, + "west": {"uv": [0.5, 4.5, 1, 6], "texture": "#0"}, + "up": {"uv": [3, 5.5, 2.5, 5], "texture": "#0"}, + "down": {"uv": [5.5, 3, 5, 3.5], "texture": "#0"} + } + }, + { + "from": [10, 7, 7], + "to": [12, 12, 8], + "rotation": {"angle": -22.5, "axis": "z", "origin": [12, 8, 7]}, + "faces": { + "north": {"uv": [0, 5.5, 1, 8], "texture": "#0"}, + "east": {"uv": [0.5, 5.5, 1, 8], "texture": "#0"}, + "south": {"uv": [0, 5.5, 1, 8], "texture": "#0"}, + "west": {"uv": [0.5, 5.5, 1, 8], "texture": "#0"}, + "up": {"uv": [3, 4.5, 2, 4], "texture": "#0"}, + "down": {"uv": [5, 3, 4, 3.5], "texture": "#0"} + } + }, + { + "from": [3.46927, 11.69552, 7], + "to": [4.46927, 14.69552, 8], + "rotation": {"angle": 0, "axis": "z", "origin": [4.46927, 11.69552, 7]}, + "faces": { + "north": {"uv": [1, 4.5, 1.5, 6], "texture": "#0"}, + "east": {"uv": [1, 4.5, 1.5, 6], "texture": "#0"}, + "south": {"uv": [1, 4.5, 1.5, 6], "texture": "#0"}, + "west": {"uv": [1, 4.5, 1.5, 6], "texture": "#0"}, + "up": {"uv": [3.5, 5.5, 3, 5], "texture": "#0"}, + "down": {"uv": [6, 3, 5.5, 3.5], "texture": "#0"} + } + }, + { + "from": [3.39315, 14.31283, 7], + "to": [4.39315, 16.31283, 8], + "rotation": {"angle": -22.5, "axis": "z", "origin": [4.39315, 14.31283, 7]}, + "faces": { + "north": {"uv": [1, 4, 1.5, 5], "texture": "#0"}, + "east": {"uv": [1, 4, 1.5, 5], "texture": "#0"}, + "south": {"uv": [1, 4, 1.5, 5], "texture": "#0"}, + "west": {"uv": [1, 4, 1.5, 5], "texture": "#0"}, + "up": {"uv": [3, 5, 2.5, 4.5], "texture": "#0"}, + "down": {"uv": [5, 2.5, 4.5, 3], "texture": "#0"} + } + }, + { + "from": [6.5, 8, 6.5], + "to": [9.5, 13, 7.5], + "rotation": {"angle": 0, "axis": "y", "origin": [7.5, 8, 6.5]}, + "faces": { + "north": {"uv": [4, 0, 5.5, 2.5], "texture": "#0"}, + "east": {"uv": [4, 0, 4.5, 2.5], "texture": "#0"}, + "south": {"uv": [4, 0, 5.5, 2.5], "texture": "#0"}, + "west": {"uv": [5, 0, 5.5, 2.5], "texture": "#0"}, + "up": {"uv": [5.5, 0.5, 4, 0], "texture": "#0"}, + "down": {"uv": [5.5, 2, 4, 2.5], "texture": "#0"} + } + }, + { + "from": [4, 10.5, 7.25], + "to": [5, 14.5, 7.25], + "rotation": {"angle": 45, "axis": "z", "origin": [4, 14.5, 7.25]}, + "faces": { + "north": {"uv": [4.5, 3.5, 5, 5.5], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "south": {"uv": [4.5, 3.5, 5, 5.5], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "up": {"uv": [0, 0, 0.5, 0], "texture": "#0"}, + "down": {"uv": [0, 0, 0.5, 0], "texture": "#0"} + } + }, + { + "from": [11, 10.5, 7.25], + "to": [12, 14.5, 7.25], + "rotation": {"angle": -45, "axis": "z", "origin": [12, 14.5, 7.25]}, + "faces": { + "north": {"uv": [5.5, 3.5, 5, 5.5], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "south": {"uv": [5.5, 3.5, 5, 5.5], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "up": {"uv": [0.5, 0, 0, 0], "texture": "#0"}, + "down": {"uv": [0.5, 0, 0, 0], "texture": "#0"} + } + }, + { + "from": [8, 10.5, 7.25], + "to": [12, 11.5, 7.25], + "rotation": {"angle": 0, "axis": "z", "origin": [12, 10.5, 7.25]}, + "faces": { + "north": {"uv": [3, 5.5, 3.5, 7.5], "rotation": 270, "texture": "#0"}, + "east": {"uv": [0.5, 0, 1, 0], "rotation": 90, "texture": "#0"}, + "south": {"uv": [3, 5.5, 3.5, 7.5], "rotation": 90, "texture": "#0"}, + "west": {"uv": [0.5, 0, 1, 0], "rotation": 90, "texture": "#0"}, + "up": {"uv": [0, 0, 0, 2], "rotation": 90, "texture": "#0"}, + "down": {"uv": [0, 0, 0, 2], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [4, 10.5, 7.25], + "to": [8, 11.5, 7.25], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 10.5, 7.25]}, + "faces": { + "north": {"uv": [2.5, 7.5, 3, 5.5], "rotation": 270, "texture": "#0"}, + "east": {"uv": [0.5, 0, 1, 0], "rotation": 90, "texture": "#0"}, + "south": {"uv": [2.5, 7.5, 3, 5.5], "rotation": 90, "texture": "#0"}, + "west": {"uv": [0.5, 0, 1, 0], "rotation": 90, "texture": "#0"}, + "up": {"uv": [0, 2, 0, 0], "rotation": 90, "texture": "#0"}, + "down": {"uv": [0, 2, 0, 0], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [3.15224, 1, 4.26537], + "to": [4.15224, 2, 4.26537], + "rotation": {"angle": 22.5, "axis": "y", "origin": [2.15224, 1, 4.26537]}, + "faces": { + "north": {"uv": [3, 2.5, 3.5, 3], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 1], "texture": "#0"}, + "south": {"uv": [2.5, 2.5, 3, 3], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 1], "texture": "#0"}, + "up": {"uv": [0, 0, 1, 0], "texture": "#0"}, + "down": {"uv": [0, 0, 1, 0], "texture": "#0"} + } + }, + { + "from": [11.84776, 4, 4.26537], + "to": [12.84776, 5, 4.26537], + "rotation": {"angle": -22.5, "axis": "y", "origin": [13.84776, 4, 4.26537]}, + "faces": { + "north": {"uv": [3.5, 2.5, 3, 3], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 1], "texture": "#0"}, + "south": {"uv": [3, 2.5, 2.5, 3], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 1], "texture": "#0"}, + "up": {"uv": [1, 0, 0, 0], "texture": "#0"}, + "down": {"uv": [1, 0, 0, 0], "texture": "#0"} + } + }, + { + "from": [1.66191, 1, 5.2969], + "to": [3.66191, 3, 5.2969], + "rotation": {"angle": 45, "axis": "y", "origin": [1.66191, 1, 5.2969]}, + "faces": { + "north": {"uv": [3.5, 5.5, 4.5, 6.5], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "south": {"uv": [4.5, 5.5, 5.5, 6.5], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "up": {"uv": [0, 0, 2, 0], "texture": "#0"}, + "down": {"uv": [0, 0, 2, 0], "texture": "#0"} + } + }, + { + "from": [12.33809, 4, 5.2969], + "to": [14.33809, 6, 5.2969], + "rotation": {"angle": -45, "axis": "y", "origin": [14.33809, 4, 5.2969]}, + "faces": { + "north": {"uv": [4.5, 5.5, 3.5, 6.5], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "south": {"uv": [5.5, 5.5, 4.5, 6.5], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "up": {"uv": [2, 0, 0, 0], "texture": "#0"}, + "down": {"uv": [2, 0, 0, 0], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "thirdperson_lefthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_lefthand": { + "rotation": [0, 225, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 3, 0], + "scale": [0.25, 0.25, 0.25] + }, + "gui": { + "rotation": [30, 225, 0], + "scale": [0.625, 0.625, 0.625] + }, + "head": { + "translation": [0, 6.45, 0], + "scale": [1.61, 1.61, 1.61] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + } + } +} diff --git a/gm4_monsters_unbound/assets/gm4_monsters_unbound/models/item/elite_headwear/pearlescent.json b/gm4_monsters_unbound/assets/gm4_monsters_unbound/models/item/elite_headwear/pearlescent.json new file mode 100644 index 0000000000..d837ccdd68 --- /dev/null +++ b/gm4_monsters_unbound/assets/gm4_monsters_unbound/models/item/elite_headwear/pearlescent.json @@ -0,0 +1,139 @@ +{ + "textures": { + "0": "gm4_monsters_unbound:item/elite_headwear/pearlescent", + "particle": "gm4_monsters_unbound:item/elite_headwear/pearlescent" + }, + "elements": [ + { + "from": [8.5, 2, 3], + "to": [11.5, 5, 4], + "rotation": {"angle": 0, "axis": "y", "origin": [3.5, -3, -4]}, + "faces": { + "north": {"uv": [2, 2, 5, 5], "texture": "#0"}, + "east": {"uv": [0, 2, 2, 5], "texture": "#0"}, + "south": {"uv": [12, 2, 15, 5], "texture": "#0"}, + "west": {"uv": [5, 2, 7, 5], "texture": "#0"}, + "up": {"uv": [5, 2, 2, 0], "texture": "#0"}, + "down": {"uv": [5, 7, 2, 5], "texture": "#0"} + } + }, + { + "from": [8.25, 1.75, 2.475], + "to": [11.75, 5.25, 3.475], + "rotation": {"angle": 0, "axis": "y", "origin": [3.5, -3, -4.525]}, + "faces": { + "east": {"uv": [7, 2, 8, 5], "texture": "#0"}, + "south": {"uv": [11, 2, 8, 5], "texture": "#0"}, + "west": {"uv": [11, 2, 12, 5], "texture": "#0"}, + "up": {"uv": [11, 1, 8, 2], "texture": "#0"}, + "down": {"uv": [11, 5, 8, 6], "texture": "#0"} + } + }, + { + "from": [11.75, 5.25, 3.475], + "to": [8.25, 1.75, 2.475], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, -3.025]}, + "faces": { + "north": {"uv": [11, 5, 8, 2], "texture": "#0"}, + "east": {"uv": [11, 5, 12, 2], "texture": "#0"}, + "west": {"uv": [7, 5, 8, 2], "texture": "#0"}, + "up": {"uv": [8, 5, 11, 6], "texture": "#0"}, + "down": {"uv": [8, 1, 11, 2], "texture": "#0"} + } + }, + { + "from": [3.5, 2.5, 3.5], + "to": [12.5, 4.5, 12.5], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 3, 4]}, + "faces": { + "north": {"uv": [0, 7, 8, 9], "texture": "#0"}, + "east": {"uv": [8, 9, 0, 11], "texture": "#0"}, + "south": {"uv": [0, 11, 8, 13], "texture": "#0"}, + "west": {"uv": [0, 9, 8, 11], "texture": "#0"} + } + }, + { + "from": [12.5, 4.5, 12.5], + "to": [3.5, 2.5, 3.5], + "rotation": {"angle": 0, "axis": "y", "origin": [12, 4, 12]}, + "faces": { + "north": {"uv": [8, 13, 0, 11], "texture": "#0"}, + "east": {"uv": [8, 11, 0, 9], "texture": "#0"}, + "south": {"uv": [8, 9, 0, 7], "texture": "#0"}, + "west": {"uv": [8, 11, 0, 9], "texture": "#0"} + } + }, + { + "from": [4.5, 2, 3], + "to": [7.5, 5, 4], + "rotation": {"angle": 0, "axis": "y", "origin": [12.5, -3, -4]}, + "faces": { + "north": {"uv": [5, 2, 2, 5], "texture": "#0"}, + "east": {"uv": [7, 2, 5, 5], "texture": "#0"}, + "south": {"uv": [15, 2, 12, 5], "texture": "#0"}, + "west": {"uv": [2, 2, 0, 5], "texture": "#0"}, + "up": {"uv": [2, 2, 5, 0], "texture": "#0"}, + "down": {"uv": [2, 7, 5, 5], "texture": "#0"} + } + }, + { + "from": [7.75, 5.25, 3.475], + "to": [4.25, 1.75, 2.475], + "rotation": {"angle": 0, "axis": "y", "origin": [9, 0.5, -3.025]}, + "faces": { + "north": {"uv": [8, 5, 11, 2], "texture": "#0"}, + "east": {"uv": [8, 5, 7, 2], "texture": "#0"}, + "west": {"uv": [12, 5, 11, 2], "texture": "#0"}, + "up": {"uv": [11, 5, 8, 6], "texture": "#0"}, + "down": {"uv": [11, 1, 8, 2], "texture": "#0"} + } + }, + { + "from": [4.25, 1.75, 2.475], + "to": [7.75, 5.25, 3.475], + "rotation": {"angle": 0, "axis": "y", "origin": [12.5, -3, -4.525]}, + "faces": { + "east": {"uv": [12, 2, 11, 5], "texture": "#0"}, + "south": {"uv": [8, 2, 11, 5], "texture": "#0"}, + "west": {"uv": [8, 2, 7, 5], "texture": "#0"}, + "up": {"uv": [8, 1, 11, 2], "texture": "#0"}, + "down": {"uv": [8, 5, 11, 6], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "thirdperson_lefthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_lefthand": { + "rotation": [0, 225, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 3, 0], + "scale": [0.25, 0.25, 0.25] + }, + "gui": { + "rotation": [30, 225, 0], + "scale": [0.625, 0.625, 0.625] + }, + "head": { + "translation": [0, 6.45, 0], + "scale": [1.61, 1.61, 1.61] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + } + } +} diff --git a/gm4_monsters_unbound/assets/gm4_monsters_unbound/models/item/spore/cherry.json b/gm4_monsters_unbound/assets/gm4_monsters_unbound/models/item/spore/cherry.json new file mode 100644 index 0000000000..9cd3170d59 --- /dev/null +++ b/gm4_monsters_unbound/assets/gm4_monsters_unbound/models/item/spore/cherry.json @@ -0,0 +1,90 @@ +{ + "textures": { + "1": "gm4_monsters_unbound:item/spore/cherry" + }, + "elements": [ + { + "from": [3.5, -0.5, 3.5], + "to": [12.5, 8.5, 12.5], + "rotation": {"angle": 0, "axis": "y", "origin": [5, 6, 5]}, + "faces": { + "north": {"uv": [4, 4, 8, 8], "texture": "#1"}, + "east": {"uv": [0, 4, 4, 8], "texture": "#1"}, + "south": {"uv": [12, 4, 16, 8], "texture": "#1"}, + "west": {"uv": [8, 4, 12, 8], "texture": "#1"}, + "up": {"uv": [4, 0, 8, 4], "texture": "#1"} + } + }, + { + "from": [12.5, 8.5, 12.5], + "to": [3.5, -0.5, 3.5], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 14, 13]}, + "faces": { + "north": {"uv": [12, 8, 16, 4], "texture": "#1"}, + "east": {"uv": [8, 8, 12, 4], "texture": "#1"}, + "south": {"uv": [4, 8, 8, 4], "texture": "#1"}, + "west": {"uv": [0, 8, 4, 4], "texture": "#1"}, + "down": {"uv": [8, 4, 4, 0], "texture": "#1"} + } + }, + { + "from": [3, -1, 3], + "to": [13, 9, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [5, 6, 5]}, + "faces": { + "north": {"uv": [4, 12, 8, 16], "texture": "#1"}, + "east": {"uv": [0, 12, 4, 16], "texture": "#1"}, + "south": {"uv": [12, 12, 16, 16], "texture": "#1"}, + "west": {"uv": [8, 12, 12, 16], "texture": "#1"}, + "up": {"uv": [4, 8, 8, 12], "texture": "#1"} + } + }, + { + "from": [13, 9, 13], + "to": [3, -1, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 14, 13]}, + "faces": { + "north": {"uv": [12, 16, 16, 12], "texture": "#1"}, + "east": {"uv": [8, 16, 12, 12], "texture": "#1"}, + "south": {"uv": [4, 16, 8, 12], "texture": "#1"}, + "west": {"uv": [0, 16, 4, 12], "texture": "#1"}, + "down": {"uv": [8, 12, 4, 8], "texture": "#1"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "thirdperson_lefthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_lefthand": { + "rotation": [0, 225, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 3, 0], + "scale": [0.25, 0.25, 0.25] + }, + "gui": { + "rotation": [30, 225, 0], + "scale": [0.625, 0.625, 0.625] + }, + "head": { + "translation": [0, 6.45, 0], + "scale": [1.61, 1.61, 1.61] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + } + } +} diff --git a/gm4_monsters_unbound/assets/gm4_monsters_unbound/models/item/spore/default.json b/gm4_monsters_unbound/assets/gm4_monsters_unbound/models/item/spore/default.json new file mode 100644 index 0000000000..c1b2d877f8 --- /dev/null +++ b/gm4_monsters_unbound/assets/gm4_monsters_unbound/models/item/spore/default.json @@ -0,0 +1,90 @@ +{ + "textures": { + "1": "gm4_monsters_unbound:item/spore/default" + }, + "elements": [ + { + "from": [3.5, -0.5, 3.5], + "to": [12.5, 8.5, 12.5], + "rotation": {"angle": 0, "axis": "y", "origin": [5, 6, 5]}, + "faces": { + "north": {"uv": [4, 4, 8, 8], "texture": "#1"}, + "east": {"uv": [0, 4, 4, 8], "texture": "#1"}, + "south": {"uv": [12, 4, 16, 8], "texture": "#1"}, + "west": {"uv": [8, 4, 12, 8], "texture": "#1"}, + "up": {"uv": [4, 0, 8, 4], "texture": "#1"} + } + }, + { + "from": [12.5, 8.5, 12.5], + "to": [3.5, -0.5, 3.5], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 14, 13]}, + "faces": { + "north": {"uv": [12, 8, 16, 4], "texture": "#1"}, + "east": {"uv": [8, 8, 12, 4], "texture": "#1"}, + "south": {"uv": [4, 8, 8, 4], "texture": "#1"}, + "west": {"uv": [0, 8, 4, 4], "texture": "#1"}, + "down": {"uv": [8, 4, 4, 0], "texture": "#1"} + } + }, + { + "from": [3, -1, 3], + "to": [13, 9, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [5, 6, 5]}, + "faces": { + "north": {"uv": [4, 12, 8, 16], "texture": "#1"}, + "east": {"uv": [0, 12, 4, 16], "texture": "#1"}, + "south": {"uv": [12, 12, 16, 16], "texture": "#1"}, + "west": {"uv": [8, 12, 12, 16], "texture": "#1"}, + "up": {"uv": [4, 8, 8, 12], "texture": "#1"} + } + }, + { + "from": [13, 9, 13], + "to": [3, -1, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 14, 13]}, + "faces": { + "north": {"uv": [12, 16, 16, 12], "texture": "#1"}, + "east": {"uv": [8, 16, 12, 12], "texture": "#1"}, + "south": {"uv": [4, 16, 8, 12], "texture": "#1"}, + "west": {"uv": [0, 16, 4, 12], "texture": "#1"}, + "down": {"uv": [8, 12, 4, 8], "texture": "#1"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "thirdperson_lefthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_lefthand": { + "rotation": [0, 225, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 3, 0], + "scale": [0.25, 0.25, 0.25] + }, + "gui": { + "rotation": [30, 225, 0], + "scale": [0.625, 0.625, 0.625] + }, + "head": { + "translation": [0, 6.45, 0], + "scale": [1.61, 1.61, 1.61] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + } + } +} diff --git a/gm4_monsters_unbound/assets/gm4_monsters_unbound/models/item/spore/flowering.json b/gm4_monsters_unbound/assets/gm4_monsters_unbound/models/item/spore/flowering.json new file mode 100644 index 0000000000..575da0e580 --- /dev/null +++ b/gm4_monsters_unbound/assets/gm4_monsters_unbound/models/item/spore/flowering.json @@ -0,0 +1,90 @@ +{ + "textures": { + "1": "gm4_monsters_unbound:item/spore/flowering" + }, + "elements": [ + { + "from": [3.5, -0.5, 3.5], + "to": [12.5, 8.5, 12.5], + "rotation": {"angle": 0, "axis": "y", "origin": [5, 6, 5]}, + "faces": { + "north": {"uv": [4, 4, 8, 8], "texture": "#1"}, + "east": {"uv": [0, 4, 4, 8], "texture": "#1"}, + "south": {"uv": [12, 4, 16, 8], "texture": "#1"}, + "west": {"uv": [8, 4, 12, 8], "texture": "#1"}, + "up": {"uv": [4, 0, 8, 4], "texture": "#1"} + } + }, + { + "from": [12.5, 8.5, 12.5], + "to": [3.5, -0.5, 3.5], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 14, 13]}, + "faces": { + "north": {"uv": [12, 8, 16, 4], "texture": "#1"}, + "east": {"uv": [8, 8, 12, 4], "texture": "#1"}, + "south": {"uv": [4, 8, 8, 4], "texture": "#1"}, + "west": {"uv": [0, 8, 4, 4], "texture": "#1"}, + "down": {"uv": [8, 4, 4, 0], "texture": "#1"} + } + }, + { + "from": [3, -1, 3], + "to": [13, 9, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [5, 6, 5]}, + "faces": { + "north": {"uv": [4, 12, 8, 16], "texture": "#1"}, + "east": {"uv": [0, 12, 4, 16], "texture": "#1"}, + "south": {"uv": [12, 12, 16, 16], "texture": "#1"}, + "west": {"uv": [8, 12, 12, 16], "texture": "#1"}, + "up": {"uv": [4, 8, 8, 12], "texture": "#1"} + } + }, + { + "from": [13, 9, 13], + "to": [3, -1, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 14, 13]}, + "faces": { + "north": {"uv": [12, 16, 16, 12], "texture": "#1"}, + "east": {"uv": [8, 16, 12, 12], "texture": "#1"}, + "south": {"uv": [4, 16, 8, 12], "texture": "#1"}, + "west": {"uv": [0, 16, 4, 12], "texture": "#1"}, + "down": {"uv": [8, 12, 4, 8], "texture": "#1"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "thirdperson_lefthand": { + "rotation": [75, 45, 0], + "translation": [0, 2.5, 0], + "scale": [0.375, 0.375, 0.375] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "scale": [0.4, 0.4, 0.4] + }, + "firstperson_lefthand": { + "rotation": [0, 225, 0], + "scale": [0.4, 0.4, 0.4] + }, + "ground": { + "translation": [0, 3, 0], + "scale": [0.25, 0.25, 0.25] + }, + "gui": { + "rotation": [30, 225, 0], + "scale": [0.625, 0.625, 0.625] + }, + "head": { + "translation": [0, 6.45, 0], + "scale": [1.61, 1.61, 1.61] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + } + } +} diff --git a/gm4_monsters_unbound/assets/gm4_monsters_unbound/textures/item/elite_headwear/glacial.png b/gm4_monsters_unbound/assets/gm4_monsters_unbound/textures/item/elite_headwear/glacial.png new file mode 100644 index 0000000000..128bb844a5 Binary files /dev/null and b/gm4_monsters_unbound/assets/gm4_monsters_unbound/textures/item/elite_headwear/glacial.png differ diff --git a/gm4_monsters_unbound/assets/gm4_monsters_unbound/textures/item/elite_headwear/mending.png b/gm4_monsters_unbound/assets/gm4_monsters_unbound/textures/item/elite_headwear/mending.png new file mode 100644 index 0000000000..14eb641d30 Binary files /dev/null and b/gm4_monsters_unbound/assets/gm4_monsters_unbound/textures/item/elite_headwear/mending.png differ diff --git a/gm4_monsters_unbound/assets/gm4_monsters_unbound/textures/item/elite_headwear/pearlescent.png b/gm4_monsters_unbound/assets/gm4_monsters_unbound/textures/item/elite_headwear/pearlescent.png new file mode 100644 index 0000000000..f2f65039eb Binary files /dev/null and b/gm4_monsters_unbound/assets/gm4_monsters_unbound/textures/item/elite_headwear/pearlescent.png differ diff --git a/gm4_monsters_unbound/assets/gm4_monsters_unbound/textures/item/spore/cherry.png b/gm4_monsters_unbound/assets/gm4_monsters_unbound/textures/item/spore/cherry.png new file mode 100644 index 0000000000..068b0bbdc7 Binary files /dev/null and b/gm4_monsters_unbound/assets/gm4_monsters_unbound/textures/item/spore/cherry.png differ diff --git a/gm4_monsters_unbound/assets/gm4_monsters_unbound/textures/item/spore/default.png b/gm4_monsters_unbound/assets/gm4_monsters_unbound/textures/item/spore/default.png new file mode 100644 index 0000000000..1155c9bca2 Binary files /dev/null and b/gm4_monsters_unbound/assets/gm4_monsters_unbound/textures/item/spore/default.png differ diff --git a/gm4_monsters_unbound/assets/gm4_monsters_unbound/textures/item/spore/flowering.png b/gm4_monsters_unbound/assets/gm4_monsters_unbound/textures/item/spore/flowering.png new file mode 100644 index 0000000000..f754f40b72 Binary files /dev/null and b/gm4_monsters_unbound/assets/gm4_monsters_unbound/textures/item/spore/flowering.png differ diff --git a/gm4_monsters_unbound/assets/model_data.yaml b/gm4_monsters_unbound/assets/model_data.yaml new file mode 100644 index 0000000000..c20d40d302 --- /dev/null +++ b/gm4_monsters_unbound/assets/model_data.yaml @@ -0,0 +1,13 @@ +model_data: + - item: pearlescent_froglight + reference: item/elite_headwear/pearlescent + - item: lime_glazed_terracotta + reference: item/elite_headwear/mending + - item: packed_ice + reference: item/elite_headwear/glacial + - item: azalea_leaves + reference: item/spore/default + - item: flowering_azalea_leaves + reference: item/spore/flowering + - item: cherry_leaves + reference: item/spore/cherry diff --git a/gm4_monsters_unbound/beet.yaml b/gm4_monsters_unbound/beet.yaml new file mode 100644 index 0000000000..712caf3128 --- /dev/null +++ b/gm4_monsters_unbound/beet.yaml @@ -0,0 +1,40 @@ +id: gm4_monsters_unbound +name: Monsters Unbound +version: 1.0.X + +data_pack: + load: . + +resource_pack: + load: . + +pipeline: + - gm4.plugins.extend.module + - gm4.plugins.include.lib_forceload + - gm4.plugins.include.lib_lore + +meta: + gm4: + versioning: + required: + lib_forceload: 1.3.0 + lib_lore: 1.1.0 + gm4_survival_refightalized: 1.0.0 + schedule_loops: + - tick + - main + - slow_clock + website: + description: Use special armor and weapon modifiers to defend against mobs that grow ever stronger. + recommended: + - gm4_augmented_armor + video: null + wiki: https://wiki.gm4.co/wiki/Monsters_Unbound + credits: + Creator: + - Thanathor + Icon Design: + - Hozz + Textures: + - Kyrius + - rednls diff --git a/gm4_monsters_unbound/data/gm4/advancement/monsters_unbound_elite_kill.json b/gm4_monsters_unbound/data/gm4/advancement/monsters_unbound_elite_kill.json new file mode 100644 index 0000000000..9f6fb2f878 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4/advancement/monsters_unbound_elite_kill.json @@ -0,0 +1,34 @@ +{ + "display": { + "icon": { + "id": "minecraft:iron_axe" + }, + "title": { + "translate": "advancement.gm4.monsters_unbound.elite_kill.title", + "fallback": "Elite Hunter" + }, + "description": { + "translate": "advancement.gm4.monsters_unbound.elite_kill.description", + "fallback": "Kill any Elite monster", + "color": "gray" + }, + "frame": "task" + }, + "parent": "gm4:survival_refightalized_armor_damage", + "criteria": { + "kill_elite": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite\"]}" + } + } + ] + } + } + } +} diff --git a/gm4_monsters_unbound/data/gm4/advancement/monsters_unbound_elite_kill_all.json b/gm4_monsters_unbound/data/gm4/advancement/monsters_unbound_elite_kill_all.json new file mode 100644 index 0000000000..47814434c8 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4/advancement/monsters_unbound_elite_kill_all.json @@ -0,0 +1,178 @@ +{ + "display": { + "icon": { + "id": "minecraft:diamond_axe" + }, + "title": { + "translate": "advancement.gm4.monsters_unbound.elite_kill_all.title", + "fallback": "Elites Hunted" + }, + "description": { + "translate": "advancement.gm4.monsters_unbound.elite_kill_all.description", + "fallback": "Kill one of every Elite monster", + "color": "gray" + }, + "frame": "challenge" + }, + "parent": "gm4:monsters_unbound_elite_kill", + "criteria": { + "blazing": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.blazing\"]}" + } + } + ] + } + }, + "gargantuan": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.gargantuan\"]}" + } + } + ] + } + }, + "glacial": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.glacial\"]}" + } + } + ] + } + }, + "mending": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.mending\"]}" + } + } + ] + } + }, + "pearlescent": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.pearlescent\"]}" + } + } + ] + } + }, + "splitting": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.splitting\"]}" + } + } + ] + } + }, + "volatile": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.volatile\"]}" + } + } + ] + } + }, + "vorpal": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.vorpal\"]}" + } + } + ] + } + }, + "zephyr": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.zephyr\"]}" + } + } + ] + } + } + }, + "requirements": [ + [ + "blazing" + ], + [ + "gargantuan" + ], + [ + "glacial" + ], + [ + "mending" + ], + [ + "pearlescent" + ], + [ + "splitting" + ], + [ + "volatile" + ], + [ + "vorpal" + ], + [ + "zephyr" + ] + ], + "rewards": { + "experience": 100 + } +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/advancement/damaged/attack_effect/charging.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/advancement/damaged/attack_effect/charging.json new file mode 100644 index 0000000000..cdfb40abcf --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/advancement/damaged/attack_effect/charging.json @@ -0,0 +1,17 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:entity_hurt_player", + "conditions": { + "damage": { + "source_entity": { + "nbt": "{Tags:[\"gm4_mu_charging_attack\"]}" + } + } + } + } + }, + "rewards": { + "function": "gm4_monsters_unbound:mob/process/attack_effect/charging_attack" + } +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/advancement/damaged/attack_effect/slowing.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/advancement/damaged/attack_effect/slowing.json new file mode 100644 index 0000000000..774b625a6c --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/advancement/damaged/attack_effect/slowing.json @@ -0,0 +1,30 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:entity_hurt_player", + "conditions": { + "player": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_frozen\"]}" + } + } + } + ], + "damage": { + "blocked": false, + "source_entity": { + "nbt": "{Tags:[\"gm4_mu_slowing_attack\"]}" + } + } + } + } + }, + "rewards": { + "function": "gm4_monsters_unbound:mob/process/attack_effect/slowing_attack" + } +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/advancement/damaged/attack_effect/toxic.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/advancement/damaged/attack_effect/toxic.json new file mode 100644 index 0000000000..6af221acf6 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/advancement/damaged/attack_effect/toxic.json @@ -0,0 +1,18 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:entity_hurt_player", + "conditions": { + "damage": { + "blocked": false, + "source_entity": { + "nbt": "{Tags:[\"gm4_mu_toxic_attack\"]}" + } + } + } + } + }, + "rewards": { + "function": "gm4_monsters_unbound:mob/process/attack_effect/toxic_attack" + } +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/advancement/damaged/attack_effect/weakness.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/advancement/damaged/attack_effect/weakness.json new file mode 100644 index 0000000000..08e7460766 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/advancement/damaged/attack_effect/weakness.json @@ -0,0 +1,19 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:entity_hurt_player", + "conditions": { + "damage": { + "blocked": false, + "source_entity": { + "nbt": "{Tags:[\"gm4_mu_weakness_attack\"]}" + } + } + } + } + }, + "rewards": { + "function": "gm4_monsters_unbound:mob/process/attack_effect/weakness_attack" + } +} + \ No newline at end of file diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/advancement/elite/on_hit.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/advancement/elite/on_hit.json new file mode 100644 index 0000000000..e1ffca6508 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/advancement/elite/on_hit.json @@ -0,0 +1,21 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:player_hurt_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.on_hit\"]}" + } + } + ] + } + } + }, + "rewards": { + "function": "gm4_monsters_unbound:mob/process/elite/on_hit/run" + } +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/check_item.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/check_item.mcfunction new file mode 100644 index 0000000000..ba34635580 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/check_item.mcfunction @@ -0,0 +1,14 @@ +# check items on ground for Survival Refightalized items +# @s = item +# at unspecified +# run from tick + +# tag item as checked and try to process +tag @s add gm4_mu_item_checked +scoreboard players set $item_processed gm4_mu_data 0 + +# check for spores +execute if items entity @s contents *[custom_data~{gm4_mu_spore:{}}] run function gm4_monsters_unbound:mob/process/spore/initialise + +# check for elite death markers +execute if items entity @s contents *[custom_data~{gm4_mu_elite_on_death:{}}] at @s run function gm4_monsters_unbound:mob/process/elite/on_death/run diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/effect/fear.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/effect/fear.mcfunction new file mode 100644 index 0000000000..739518c259 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/effect/fear.mcfunction @@ -0,0 +1,10 @@ +# temporary clock for fear effect +# @s = unspecified +# at unspecified +# schedule from here +# schedule from effect/fear/apply + +scoreboard players set $keep_tick.feared_entity gm4_mu_keep_tick 0 +execute as @a[tag=gm4_mu_feared] at @s run function gm4_monsters_unbound:effect/fear/tick + +execute if score $keep_tick.feared_entity gm4_mu_keep_tick matches 1 run schedule function gm4_monsters_unbound:clocks/effect/fear 5t diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/effect/freeze.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/effect/freeze.mcfunction new file mode 100644 index 0000000000..ff17e282b9 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/effect/freeze.mcfunction @@ -0,0 +1,10 @@ +# temporary clock for freeze effect +# @s = unspecified +# at unspecified +# schedule from here +# schedule from effect/freeze/apply + +scoreboard players set $keep_tick.frozen_entity gm4_mu_keep_tick 0 +execute as @e[tag=gm4_mu_frozen] at @s run function gm4_monsters_unbound:effect/freeze/tick + +execute if score $keep_tick.frozen_entity gm4_mu_keep_tick matches 1 run schedule function gm4_monsters_unbound:clocks/effect/freeze 5t diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/elite/blazing_flare.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/elite/blazing_flare.mcfunction new file mode 100644 index 0000000000..13e62a8cee --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/elite/blazing_flare.mcfunction @@ -0,0 +1,10 @@ +# temporary clock for blazing elite flare +# @s = unspecified +# at unspecified +# schedule from here +# schedule from mob/process/elite/blazing/init_flare + +scoreboard players set $keep_tick.elite_process_flare gm4_mu_keep_tick 0 +execute as @e[type=block_display,tag=gm4_mu_elite_flare] at @s run function gm4_monsters_unbound:mob/process/elite/blazing/process_flare + +execute if score $keep_tick.elite_process_flare gm4_mu_keep_tick matches 1 run schedule function gm4_monsters_unbound:clocks/elite/blazing_flare 1t diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/elite/glacial_death.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/elite/glacial_death.mcfunction new file mode 100644 index 0000000000..da8019f60a --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/elite/glacial_death.mcfunction @@ -0,0 +1,10 @@ +# temporary clock for glacial elite death +# @s = unspecified +# at unspecified +# schedule from here +# schedule from mob/process/elite/glacial/death + +scoreboard players set $keep_tick.elite_glacial_death gm4_mu_keep_tick 0 +execute as @e[type=marker,tag=gm4_mu_elite.glacial_processing] at @s run function gm4_monsters_unbound:mob/process/elite/glacial/process_explosion + +execute if score $keep_tick.elite_glacial_death gm4_mu_keep_tick matches 1 run schedule function gm4_monsters_unbound:clocks/elite/glacial_death 2t diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/elite/volatile_pillar.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/elite/volatile_pillar.mcfunction new file mode 100644 index 0000000000..85ea19c7da --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/elite/volatile_pillar.mcfunction @@ -0,0 +1,10 @@ +# temporary clock for volatile elite pillars +# @s = unspecified +# at unspecified +# schedule from here +# schedule from mob/process/elite/volatile/pillar_location + +scoreboard players set $keep_tick.elite_pillar_volatile gm4_mu_keep_tick 0 +execute as @e[type=marker,tag=gm4_mu_elite.volatile_pillar] at @s run function gm4_monsters_unbound:mob/process/elite/volatile/pillar_process + +execute if score $keep_tick.elite_pillar_volatile gm4_mu_keep_tick matches 1 run schedule function gm4_monsters_unbound:clocks/elite/volatile_pillar 1t diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/elite/vorpal_death.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/elite/vorpal_death.mcfunction new file mode 100644 index 0000000000..10153daf94 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/elite/vorpal_death.mcfunction @@ -0,0 +1,10 @@ +# temporary clock for vorpal elite death skull +# @s = unspecified +# at unspecified +# schedule from here +# schedule from mob/process/elite/vorpal/init_fear_cloud + +scoreboard players set $keep_tick.elite_death_vorpal gm4_mu_keep_tick 0 +execute as @e[type=item_display,tag=gm4_mu_elite.fear_cloud] at @s run function gm4_monsters_unbound:mob/process/elite/vorpal/process_fear_cloud + +execute if score $keep_tick.elite_death_vorpal gm4_mu_keep_tick matches 1 run schedule function gm4_monsters_unbound:clocks/elite/vorpal_death 1t diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/elite/zephyr_process.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/elite/zephyr_process.mcfunction new file mode 100644 index 0000000000..7f5dd785bc --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/clocks/elite/zephyr_process.mcfunction @@ -0,0 +1,10 @@ +# temporary clock for skeleton zephyr elite charging +# @s = unspecified +# at unspecified +# schedule from here +# schedule from mob/process/elite/zephyr/skeleton/start + +scoreboard players set $keep_tick.elite_process_zephyr gm4_mu_keep_tick 0 +execute as @e[type=#gm4_survival_refightalized:skeleton_types,tag=gm4_mu_elite.zephyr_skeleton_burst] at @s run function gm4_monsters_unbound:mob/process/elite/zephyr/skeleton/arrow_burst + +execute if score $keep_tick.elite_process_zephyr gm4_mu_keep_tick matches 1 run schedule function gm4_monsters_unbound:clocks/elite/zephyr_process 3t diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/blazing/skeleton.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/blazing/skeleton.mcfunction new file mode 100644 index 0000000000..10d06d2cb7 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/blazing/skeleton.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set $prepicked_elite gm4_mu_data 46 +summon skeleton ~ ~ ~ {Tags:["gm4_mu_elite","gm4_mu_debug_mob"]} +execute as @n[tag=gm4_mu_debug_mob] run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/blazing/zombie.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/blazing/zombie.mcfunction new file mode 100644 index 0000000000..aef515b4cc --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/blazing/zombie.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set $prepicked_elite gm4_mu_data 46 +summon zombie ~ ~ ~ {Tags:["gm4_sr_was_baby","gm4_mu_debug_mob"]} +execute as @n[tag=gm4_mu_debug_mob] run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/gargantuan/skeleton.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/gargantuan/skeleton.mcfunction new file mode 100644 index 0000000000..b3cfb44401 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/gargantuan/skeleton.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set $prepicked_elite gm4_mu_data 56 +summon skeleton ~ ~ ~ {Tags:["gm4_mu_elite","gm4_mu_debug_mob"]} +execute as @n[tag=gm4_mu_debug_mob] run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/gargantuan/zombie.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/gargantuan/zombie.mcfunction new file mode 100644 index 0000000000..608f70da6d --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/gargantuan/zombie.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set $prepicked_elite gm4_mu_data 56 +summon zombie ~ ~ ~ {Tags:["gm4_sr_was_baby","gm4_mu_debug_mob"]} +execute as @n[tag=gm4_mu_debug_mob] run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/glacial/skeleton.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/glacial/skeleton.mcfunction new file mode 100644 index 0000000000..0ee9e2dbfc --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/glacial/skeleton.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set $prepicked_elite gm4_mu_data 1 +summon skeleton ~ ~ ~ {Tags:["gm4_mu_elite","gm4_mu_debug_mob"]} +execute as @n[tag=gm4_mu_debug_mob] run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/glacial/zombie.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/glacial/zombie.mcfunction new file mode 100644 index 0000000000..82ff3e7eef --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/glacial/zombie.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set $prepicked_elite gm4_mu_data 1 +summon zombie ~ ~ ~ {Tags:["gm4_sr_was_baby","gm4_mu_debug_mob"]} +execute as @n[tag=gm4_mu_debug_mob] run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/mending/skeleton.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/mending/skeleton.mcfunction new file mode 100644 index 0000000000..fe90e407c5 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/mending/skeleton.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set $prepicked_elite gm4_mu_data 16 +summon skeleton ~ ~ ~ {Tags:["gm4_mu_elite","gm4_mu_debug_mob"]} +execute as @n[tag=gm4_mu_debug_mob] run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/mending/zombie.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/mending/zombie.mcfunction new file mode 100644 index 0000000000..a2cbac1ceb --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/mending/zombie.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set $prepicked_elite gm4_mu_data 16 +summon zombie ~ ~ ~ {Tags:["gm4_sr_was_baby","gm4_mu_debug_mob"]} +execute as @n[tag=gm4_mu_debug_mob] run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/pearlescent/skeleton.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/pearlescent/skeleton.mcfunction new file mode 100644 index 0000000000..b48d5715dd --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/pearlescent/skeleton.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set $prepicked_elite gm4_mu_data 91 +summon skeleton ~ ~ ~ {Tags:["gm4_mu_elite","gm4_mu_debug_mob"]} +execute as @n[tag=gm4_mu_debug_mob] run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/pearlescent/zombie.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/pearlescent/zombie.mcfunction new file mode 100644 index 0000000000..ab6b162c33 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/pearlescent/zombie.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set $prepicked_elite gm4_mu_data 91 +summon zombie ~ ~ ~ {Tags:["gm4_sr_was_baby","gm4_mu_debug_mob"]} +execute as @n[tag=gm4_mu_debug_mob] run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/splitting/skeleton.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/splitting/skeleton.mcfunction new file mode 100644 index 0000000000..50b5b7feea --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/splitting/skeleton.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set $prepicked_elite gm4_mu_data 71 +summon skeleton ~ ~ ~ {Tags:["gm4_mu_elite","gm4_mu_debug_mob"]} +execute as @n[tag=gm4_mu_debug_mob] run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/splitting/zombie.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/splitting/zombie.mcfunction new file mode 100644 index 0000000000..236b3f1ceb --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/splitting/zombie.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set $prepicked_elite gm4_mu_data 71 +summon zombie ~ ~ ~ {Tags:["gm4_sr_was_baby","gm4_mu_debug_mob"]} +execute as @n[tag=gm4_mu_debug_mob] run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/volatile/skeleton.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/volatile/skeleton.mcfunction new file mode 100644 index 0000000000..acc7ef7ce8 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/volatile/skeleton.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set $prepicked_elite gm4_mu_data 81 +summon skeleton ~ ~ ~ {Tags:["gm4_mu_elite","gm4_mu_debug_mob"]} +execute as @n[tag=gm4_mu_debug_mob] run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/volatile/zombie.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/volatile/zombie.mcfunction new file mode 100644 index 0000000000..9b0094343f --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/volatile/zombie.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set $prepicked_elite gm4_mu_data 81 +summon zombie ~ ~ ~ {Tags:["gm4_sr_was_baby","gm4_mu_debug_mob"]} +execute as @n[tag=gm4_mu_debug_mob] run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/vorpal/skeleton.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/vorpal/skeleton.mcfunction new file mode 100644 index 0000000000..c5120605da --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/vorpal/skeleton.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set $prepicked_elite gm4_mu_data 61 +summon skeleton ~ ~ ~ {Tags:["gm4_mu_elite","gm4_mu_debug_mob"]} +execute as @n[tag=gm4_mu_debug_mob] run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/vorpal/zombie.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/vorpal/zombie.mcfunction new file mode 100644 index 0000000000..1bca91b8f5 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/vorpal/zombie.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set $prepicked_elite gm4_mu_data 61 +summon zombie ~ ~ ~ {Tags:["gm4_sr_was_baby","gm4_mu_debug_mob"]} +execute as @n[tag=gm4_mu_debug_mob] run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/zephyr/skeleton.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/zephyr/skeleton.mcfunction new file mode 100644 index 0000000000..25a76b60ad --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/zephyr/skeleton.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set $prepicked_elite gm4_mu_data 31 +summon skeleton ~ ~ ~ {Tags:["gm4_mu_elite","gm4_mu_debug_mob"]} +execute as @n[tag=gm4_mu_debug_mob] run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/zephyr/zombie.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/zephyr/zombie.mcfunction new file mode 100644 index 0000000000..70dd38c0e4 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/debug/spawn_elite/zephyr/zombie.mcfunction @@ -0,0 +1,4 @@ + +scoreboard players set $prepicked_elite gm4_mu_data 31 +summon zombie ~ ~ ~ {Tags:["gm4_sr_was_baby","gm4_mu_debug_mob"]} +execute as @n[tag=gm4_mu_debug_mob] run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/fear/apply.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/fear/apply.mcfunction new file mode 100644 index 0000000000..fb77d62c56 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/fear/apply.mcfunction @@ -0,0 +1,32 @@ +# apply fear to this player +# @s = player to hit with fear +# at @s +# run from mob/process/elite/vorpal/fear_hit + +# failsafe - don't fear spectators +execute if entity @s[gamemode=spectator] run return 0 + +# particles and sound +particle dust{color:[0.000,0.000,0.000],scale:1} ~ ~ ~ 0.0666 0.0666 0.0666 2 6 normal +playsound minecraft:entity.witch.celebrate hostile @s ~ ~ ~ 1 2 +playsound minecraft:entity.witch.death hostile @s ~ ~ ~ 1 0.666 + +# set timer +scoreboard players operation $add_fear_time gm4_mu_data = $fear_seconds gm4_mu_data +scoreboard players operation $add_fear_time gm4_mu_data *= #4 gm4_mu_data + +# effects +effect give @s blindness 3 0 true +effect give @s darkness 3 0 true +effect give @s nausea 3 0 true +effect give @s wither 1 0 true + +# apply attributes +attribute @s minecraft:attack_damage modifier add gm4_monsters_unbound:feared -0.5 add_multiplied_total +attribute @s minecraft:attack_speed modifier add gm4_monsters_unbound:feared -0.5 add_multiplied_total +attribute @s minecraft:block_break_speed modifier add gm4_monsters_unbound:feared -0.5 add_multiplied_total + +# apply fear +scoreboard players operation @s gm4_mu_feared_time += $add_fear_time gm4_mu_data +tag @s add gm4_mu_feared +execute unless score $keep_tick.feared_entity gm4_mu_keep_tick matches 1 run schedule function gm4_monsters_unbound:clocks/effect/fear 5t diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/fear/playsound.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/fear/playsound.mcfunction new file mode 100644 index 0000000000..10540b9452 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/fear/playsound.mcfunction @@ -0,0 +1,12 @@ + +execute store result score $picksound gm4_mu_data run random value 1..11 + +execute if score $picksound gm4_mu_data matches 1..2 run playsound entity.creeper.primed hostile @s ^1 ^ ^-1 1 1 +execute if score $picksound gm4_mu_data matches 3..4 run playsound entity.creeper.primed hostile @s ^-1 ^ ^-1 1 1 +execute if score $picksound gm4_mu_data matches 5 run playsound entity.zombie.ambient hostile @s ^2 ^ ^-3 1 1 +execute if score $picksound gm4_mu_data matches 6 run playsound entity.zombie.ambient hostile @s ^-2 ^ ^-3 1 1 +execute if score $picksound gm4_mu_data matches 7 run playsound entity.skeleton.ambient hostile @s ^2 ^ ^-3 1 1 +execute if score $picksound gm4_mu_data matches 8 run playsound entity.skeleton.ambient hostile @s ^-2 ^ ^-3 1 1 +execute if score $picksound gm4_mu_data matches 9 run playsound entity.spider.ambient hostile @s ^2 ^ ^-3 1 1 +execute if score $picksound gm4_mu_data matches 10 run playsound entity.spider.ambient hostile @s ^-2 ^ ^-3 1 1 +execute if score $picksound gm4_mu_data matches 11 run playsound entity.witch.ambient hostile @s ^2 ^ ^-3 1 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/fear/remove.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/fear/remove.mcfunction new file mode 100644 index 0000000000..1050f55aea --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/fear/remove.mcfunction @@ -0,0 +1,10 @@ +# remove fear from this player +# @s = player with fear effect +# at @s +# run from effect/fear/tick + +attribute @s minecraft:attack_damage modifier remove gm4_monsters_unbound:feared +attribute @s minecraft:attack_speed modifier remove gm4_monsters_unbound:feared +attribute @s minecraft:block_break_speed modifier remove gm4_monsters_unbound:feared + +tag @s remove gm4_mu_feared diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/fear/tick.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/fear/tick.mcfunction new file mode 100644 index 0000000000..8e81f7a85b --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/fear/tick.mcfunction @@ -0,0 +1,26 @@ +# tick fear effect for this player +# @s = player with fear effect +# at @s +# run from clocks/effect/fear + +# tick down effect, remove if it reaches 0 +scoreboard players remove @s gm4_mu_feared_time 1 +execute if score @s gm4_mu_feared_time matches ..0 run return run function gm4_monsters_unbound:effect/fear/remove + +# re-apply effects +effect give @s[scores={gm4_mu_feared_time=9..}] blindness 3 0 true +effect give @s[scores={gm4_mu_feared_time=9..}] darkness 3 0 true +effect give @s[scores={gm4_mu_feared_time=9..}] nausea 3 0 true +effect give @s wither 1 0 true + +# sounds +scoreboard players operation $playsound gm4_mu_data = @s gm4_mu_feared_time +scoreboard players operation $playsound gm4_mu_data %= #4 gm4_mu_data +execute if score $playsound gm4_mu_data matches 0 if predicate {condition:"random_chance",chance:0.666} run function gm4_monsters_unbound:effect/fear/playsound + +# particles +execute anchored eyes run particle dust{color:[0.000,0.000,0.000],scale:4} ^ ^ ^0.15 0.2 0.2 0.2 2 6 force @s +execute anchored eyes run particle dust{color:[0.000,0.000,0.000],scale:4} ^ ^ ^0.75 0.4 0.4 0.4 2 18 force @s + +# keep clock running +scoreboard players set $keep_tick.feared_entity gm4_mu_keep_tick 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/apply.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/apply.mcfunction new file mode 100644 index 0000000000..6094c5d129 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/apply.mcfunction @@ -0,0 +1,25 @@ +# apply freeze to this entity +# @s = entity to freeze +# at @s +# run from effect/freeze/apply_from_slow +# run from mob/process/elite/glacial/explode + +# don't freeze spectators +execute if entity @s[gamemode=spectator] run return 0 + +# take tiny fraction of damage for show +damage @s 0.01 freeze + +# set timer +scoreboard players operation $add_freeze_time gm4_mu_data = $freeze_seconds gm4_mu_data +scoreboard players operation $add_freeze_time gm4_mu_data *= #4 gm4_mu_data +scoreboard players reset $freeze_seconds gm4_mu_data + +# set attributes based on entity type +execute if entity @s[type=player] run function gm4_monsters_unbound:effect/freeze/apply_player +execute if entity @s[type=!player] run function gm4_monsters_unbound:effect/freeze/apply_entity + +# apply freeze +scoreboard players operation @s gm4_mu_frozen_time += $add_freeze_time gm4_mu_data +tag @s add gm4_mu_frozen +execute unless score $keep_tick.frozen_entity gm4_mu_keep_tick matches 1 run schedule function gm4_monsters_unbound:clocks/effect/freeze 5t diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/apply_chill.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/apply_chill.mcfunction new file mode 100644 index 0000000000..bf380c4d99 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/apply_chill.mcfunction @@ -0,0 +1,11 @@ + +execute if entity @s[tag=gm4_mu_immune_slowness] run return 0 + +scoreboard players set $slowness_level gm4_mu_data -1 +execute if data entity @s active_effects[{id:"minecraft:slowness"}] store result score $slowness_level gm4_mu_data run data get entity @s active_effects[{id:"minecraft:slowness"}].amplifier +execute store result storage gm4_monsters_unbound:temp slowness.level int 1 run scoreboard players add $slowness_level gm4_mu_data 1 + +execute unless score $slowness_level gm4_mu_data matches 6.. run function gm4_monsters_unbound:effect/freeze/stack_slow with storage gm4_monsters_unbound:temp slowness +execute if score $slowness_level gm4_mu_data matches 6.. run function gm4_monsters_unbound:effect/freeze/apply_from_slow + +data remove storage gm4_monsters_unbound:temp slowness diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/apply_entity.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/apply_entity.mcfunction new file mode 100644 index 0000000000..ea4e87d330 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/apply_entity.mcfunction @@ -0,0 +1,11 @@ +# apply freeze to this non-player entity +# @s = non-player entity to freeze +# at @s +# run from effect/freeze/apply + +# apply attributes +attribute @s minecraft:movement_speed modifier add gm4_monsters_unbound:frozen -1 add_multiplied_total +attribute @s minecraft:follow_range modifier add gm4_monsters_unbound:frozen -1 add_multiplied_total +attribute @s minecraft:jump_strength modifier add gm4_monsters_unbound:frozen -1 add_multiplied_total +attribute @s minecraft:attack_damage modifier add gm4_monsters_unbound:frozen -1 add_multiplied_total +attribute @s minecraft:knockback_resistance modifier add gm4_monsters_unbound:frozen 1 add_value diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/apply_from_slow.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/apply_from_slow.mcfunction new file mode 100644 index 0000000000..520bcccb80 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/apply_from_slow.mcfunction @@ -0,0 +1,8 @@ +# apply freeze from Chill slow +# @s = entity with 7 stacks of Chill +# at @s +# run from mob/process/attack_effect/slowing_attack + +effect clear @s slowness +execute unless score $freeze_seconds gm4_mu_data matches 1.. run scoreboard players set $freeze_seconds gm4_mu_data 3 +function gm4_monsters_unbound:effect/freeze/apply diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/apply_player.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/apply_player.mcfunction new file mode 100644 index 0000000000..f3f6d8dde1 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/apply_player.mcfunction @@ -0,0 +1,12 @@ +# apply freeze to this player +# @s = player to freeze +# at @s +# run from effect/freeze/apply + +# apply attributes +attribute @s minecraft:movement_speed modifier add gm4_monsters_unbound:frozen -1 add_multiplied_total +attribute @s minecraft:attack_speed modifier add gm4_monsters_unbound:frozen -1 add_multiplied_total +attribute @s minecraft:jump_strength modifier add gm4_monsters_unbound:frozen -1 add_multiplied_total +attribute @s minecraft:knockback_resistance modifier add gm4_monsters_unbound:frozen 1 add_multiplied_total +attribute @s minecraft:entity_interaction_range modifier add gm4_monsters_unbound:frozen -1 add_multiplied_total +attribute @s minecraft:block_interaction_range modifier add gm4_monsters_unbound:frozen -1 add_multiplied_total diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/stack_slow.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/stack_slow.mcfunction new file mode 100644 index 0000000000..4f63a8e3e1 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/stack_slow.mcfunction @@ -0,0 +1,6 @@ +# stack slowness level on multiple Chill hits +# @s = entity with slowness effect +# at @s +# run from mob/process/attack_effect/slowing_attack + +$effect give @s slowness 15 $(level) diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/thaw_entity.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/thaw_entity.mcfunction new file mode 100644 index 0000000000..168421fdb7 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/thaw_entity.mcfunction @@ -0,0 +1,14 @@ +# thaw entity +# @s = entity with freeze effect +# at @s +# run from effect/freeze/tick + +attribute @s minecraft:movement_speed modifier remove gm4_monsters_unbound:frozen +attribute @s minecraft:follow_range modifier remove gm4_monsters_unbound:frozen +attribute @s minecraft:jump_strength modifier remove gm4_monsters_unbound:frozen +attribute @s minecraft:attack_damage modifier remove gm4_monsters_unbound:frozen +attribute @s minecraft:knockback_resistance modifier remove gm4_monsters_unbound:frozen + +playsound minecraft:block.snow.break player @a ~ ~ ~ 1.5 1.25 + +tag @s remove gm4_mu_frozen diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/thaw_player.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/thaw_player.mcfunction new file mode 100644 index 0000000000..187ebb4d8d --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/thaw_player.mcfunction @@ -0,0 +1,15 @@ +# thaw player +# @s = player with freeze effect +# at @s +# run from effect/freeze/tick + +attribute @s minecraft:movement_speed modifier remove gm4_monsters_unbound:frozen +attribute @s minecraft:attack_speed modifier remove gm4_monsters_unbound:frozen +attribute @s minecraft:jump_strength modifier remove gm4_monsters_unbound:frozen +attribute @s minecraft:knockback_resistance modifier remove gm4_monsters_unbound:frozen +attribute @s minecraft:entity_interaction_range modifier remove gm4_monsters_unbound:frozen +attribute @s minecraft:block_interaction_range modifier remove gm4_monsters_unbound:frozen + +playsound minecraft:block.snow.break player @a ~ ~ ~ 1.5 1.25 + +tag @s remove gm4_mu_frozen diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/tick.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/tick.mcfunction new file mode 100644 index 0000000000..0dc72e83f2 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/effect/freeze/tick.mcfunction @@ -0,0 +1,13 @@ +# tick freeze effect for this entity +# @s = entity with freeze effect +# at @s +# run from clocks/effect/freeze + +scoreboard players remove @s gm4_mu_frozen_time 1 +execute if score @s[type=player] gm4_mu_frozen_time matches ..0 run return run function gm4_monsters_unbound:effect/freeze/thaw_player +execute if score @s[type=!player] gm4_mu_frozen_time matches ..0 run return run function gm4_monsters_unbound:effect/freeze/thaw_entity + +particle dust{color:[0.725,0.910,0.918],scale:2} ~ ~0.9 ~ 0.3 0.65 0.3 0 1 normal +particle snowflake ~ ~0.9 ~ 0.3 0.65 0.3 0 6 normal + +scoreboard players set $keep_tick.frozen_entity gm4_mu_keep_tick 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/init.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/init.mcfunction new file mode 100644 index 0000000000..785b9a9585 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/init.mcfunction @@ -0,0 +1,58 @@ +execute unless score monsters_unbound gm4_modules matches 1 run data modify storage gm4:log queue append value {type:"install",module:"Monsters Unbound"} +execute unless score monsters_unbound gm4_earliest_version < monsters_unbound gm4_modules run scoreboard players operation monsters_unbound gm4_earliest_version = monsters_unbound gm4_modules +scoreboard players set monsters_unbound gm4_modules 1 + +# scoreboards +scoreboard objectives add gm4_mu_data dummy +scoreboard objectives add gm4_mu_timer dummy +scoreboard objectives add gm4_mu_generation dummy +scoreboard objectives add gm4_mu_frozen_time dummy +scoreboard objectives add gm4_mu_feared_time dummy +scoreboard objectives add gm4_mu_keep_tick dummy + + +# configs +execute unless score $spawn_phantoms gm4_sr_config matches -2147483648..2147483647 run scoreboard players set $spawn_phantoms gm4_sr_config 1 + +# disable natural phantom spawning +execute unless score $phantoms_disabled gm4_mu_data matches 1 run gamerule doInsomnia false +execute unless score $phantoms_disabled gm4_mu_data matches 1 run data modify storage gm4:log queue append value {type:"text",message:'{"text":"[INFO] Monsters Unbound changed gamerule doInsomnia to false"}'} +scoreboard players set $phantoms_disabled gm4_mu_data 1 +execute store result score $doinsomnia gm4_mu_data run gamerule doInsomnia +execute if score $spawn_phantoms gm4_sr_config matches 1 if score $doinsomnia gm4_mu_data matches 1 run data modify storage gm4:log queue append value {type:"text",message:'[{"text":"[WARN]","color":"red"},{"text":" Monsters Unbound requires doInsomnia to be false, but it is true. ","color":"white"},{"text":"click here to fix","color":"red","clickEvent":{"action":"suggest_command","value":"/gamerule doInsomnia false"}}]'} + +# mob caps +execute unless score $mob_limit.husk_army gm4_sr_config matches -2147483648..2147483647 run scoreboard players set $mob_limit.husk_army gm4_sr_config 128 +execute unless score $mob_limit.spore_zombie gm4_sr_config matches -2147483648..2147483647 run scoreboard players set $mob_limit.spore_zombie gm4_sr_config 128 +execute unless score $mob_limit.phantom gm4_sr_config matches -2147483648..2147483647 run scoreboard players set $mob_limit.phantom gm4_sr_config 48 + +# elite teams +team add gm4_mu_elite.glacial +team modify gm4_mu_elite.glacial prefix {"text":"Glacial "} +team add gm4_mu_elite.mending +team modify gm4_mu_elite.mending prefix {"text":"Slate "} +team add gm4_mu_elite.blazing +team modify gm4_mu_elite.blazing prefix {"text":"Blazing "} +team add gm4_mu_elite.zephyr +team modify gm4_mu_elite.zephyr prefix {"text":"Zephyr "} +team add gm4_mu_elite.gargantuan +team modify gm4_mu_elite.gargantuan prefix {"text":"Gargantuan "} +team add gm4_mu_elite.vorpal +team modify gm4_mu_elite.vorpal prefix {"text":"Vorpal "} +team add gm4_mu_elite.splitting +team modify gm4_mu_elite.splitting prefix {"text":"Splitting "} +team add gm4_mu_elite.split +team modify gm4_mu_elite.split prefix {"text":"Split "} +team add gm4_mu_elite.volatile +team modify gm4_mu_elite.volatile prefix {"text":"Volatile "} +team add gm4_mu_elite.pearlescent +team modify gm4_mu_elite.pearlescent prefix {"text":"Pearlescent "} + +# constants +scoreboard players set #2 gm4_mu_data 2 +scoreboard players set #4 gm4_mu_data 4 + +# start clocks +schedule function gm4_monsters_unbound:tick 1t +schedule function gm4_monsters_unbound:main 1t +schedule function gm4_monsters_unbound:slow_clock 1t diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/main.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/main.mcfunction new file mode 100644 index 0000000000..b27146cac6 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/main.mcfunction @@ -0,0 +1,15 @@ +schedule function gm4_monsters_unbound:main 16t + +# process cloaked creepers +execute as @e[type=creeper,tag=gm4_mu_cloaked_creeper] at @s if entity @a[gamemode=!spectator,gamemode=!creative,distance=..3.1] run function gm4_monsters_unbound:mob/process/cloaked_creeper + +# zombie spores +execute as @e[type=item,tag=gm4_mu_spore] at @s run function gm4_monsters_unbound:mob/process/spore/advance +item replace entity @e[type=#gm4_survival_refightalized:zombie_types,tag=gm4_mu_spore_zombie,predicate=gm4_monsters_unbound:technical/on_fire] armor.head with air + +# traps +execute as @e[type=marker,tag=gm4_mu_snowy_trap] at @s if entity @a[gamemode=!spectator,distance=..8] run function gm4_monsters_unbound:mob/process/reveal_snowy_trap +execute as @e[type=marker,tag=gm4_mu_dripstone_trap] at @s positioned ~-3.5 ~-34 ~-3.5 if entity @a[gamemode=!spectator,dx=6,dy=28,dz=6] at @s run function gm4_monsters_unbound:mob/process/reveal_dripstone_trap + +# elites +execute as @e[type=#gm4_monsters_unbound:elite_types,tag=gm4_mu_elite.process] at @s run function gm4_monsters_unbound:mob/process/elite/check_type diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/pick.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/pick.mcfunction new file mode 100644 index 0000000000..83c3683f9d --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/pick.mcfunction @@ -0,0 +1,78 @@ +# pick elite type to spawn +# @s = zombie / skeleton types +# at @s +# run from mob/init/mob_type/skeleton/base +# run from mob/init/mob_type/zombie/base + +tag @s add gm4_mu_elite + +# zombie villagers are not replaced +execute if entity @s[type=zombie_villager] run return 0 + +# don't allow elites to be jockeys +ride @s dismount + +# don't allow entities from splits to be elites +execute if entity @s[tag=gm4_mu_split_entity] run return 0 + +# pick a random elite, or use prepicked if set +execute store result score $elite_pick gm4_mu_data run random value 1..100 +execute if score $prepicked_elite gm4_mu_data matches 1..100 run scoreboard players operation $elite_pick gm4_mu_data = $prepicked_elite gm4_mu_data +scoreboard players reset $prepicked_elite gm4_mu_data + +# do not allow Gargantuan Elite if there is no space +execute if score $elite_pick gm4_mu_data matches 96.. unless block ~ ~1 ~ #gm4:no_collision store result score $elite_pick gm4_mu_data run random value 1..95 + +# GLACIAL 15% +# 3.5x health, 45% KB resist +# attacks apply chill (15 sec stacking slowness, applies freeze at 7 stacks) +# explode in a ball of frost on death, exploding after a delay to freeze entities inside for 3 seconds +# frozen entities cannot act +execute if score $elite_pick gm4_mu_data matches ..15 run return run function gm4_monsters_unbound:mob/init/elite/type/glacial + +# MENDING 15% +# 2.5x health, -25% speed +# heals undead in LoS, restoring 24 health and granting them resistance II for 1 second +# explode in a healing orb on death, heals nearby mobs, can be destroyed to grant everything in radius regeneration +execute if score $elite_pick gm4_mu_data matches 16..30 run return run function gm4_monsters_unbound:mob/init/elite/type/mending + +# ZEPHYR 15% +# 3x health, +15% speed, +0.5 attack knockback, immune to fall damage +# after spotting a player stand still to charge for ~4 seconds, then activate: +# zombie: charge at the player, dealing 25% increased damage +# skeleton: fire up to 16 arrows in rapid succession that deal 0.5 arrow damage, then gain a speed boost +execute if score $elite_pick gm4_mu_data matches 31..45 run return run function gm4_monsters_unbound:mob/init/elite/type/zephyr + +# BLAZING 10% +# 3.5x health, -45% speed, -99% damage, can't burn +# fire aspect II / flame II +# occasionally stops to shoot homing fireballs at the closest player, exploding when they hit terrain / a player to deal 5 explosion damage +execute if score $elite_pick gm4_mu_data matches 46..55 run return run function gm4_monsters_unbound:mob/init/elite/type/blazing + +# VORPAL 10% +# 3.5x health +# can teleports up to 8 blocks away when hit, 65% chance +# On Death shoot a black cloud tracking the closest player, causing them to go blind, obscuring their vision and removing sounds +execute if score $elite_pick gm4_mu_data matches 56..65 run return run function gm4_monsters_unbound:mob/init/elite/type/vorpal + +# SPLITTING 10% +# 3.5x health +# on death splits into 5 miniature versions of the entity, with -50% in scale and reduced stats +execute if score $elite_pick gm4_mu_data matches 66..75 run return run function gm4_monsters_unbound:mob/init/elite/type/splitting + +# VOLATILE 10% +# 3.5x health, +20% movement speed, +25% attack damage, arrow delay set to 0 +# calls down pillars of energy that explode after 4 seconds, leaving a dragon_fireball +execute if score $elite_pick gm4_mu_data matches 76..85 run return run function gm4_monsters_unbound:mob/init/elite/type/volatile + +# PEARLESCENT 10% +# 3.5x health +# occasionally slow to shoot a beam of light at a player, damaging them over time +execute if score $elite_pick gm4_mu_data matches 86..95 run return run function gm4_monsters_unbound:mob/init/elite/type/pearlescent + +# GARGANTUAN 5% +# 6.5x health (4.5x for skeleton), +50% size, +35% attack damage, 1.75 attack knockback, 85% movement efficiency, -35% speed +# projectile protection 4, skeletons have punch II and power I on bow +# based on missing health gain up to 150% speed, 50% attack damage and from 85-100% knockback resistance +# Occasionally charges up a stomp attack that slows and deals 75% damage to players within 7 blocks +execute if score $elite_pick gm4_mu_data matches 96.. run return run function gm4_monsters_unbound:mob/init/elite/type/gargantuan diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/blazing.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/blazing.mcfunction new file mode 100644 index 0000000000..8f0e7b111c --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/blazing.mcfunction @@ -0,0 +1,23 @@ +# pick this elite type to spawn +# @s = zombie / skeleton types +# at @s +# run from mob/init/elite/pick + +tag @s add gm4_mu_elite.process +tag @s add gm4_mu_elite.blazing + +attribute @s minecraft:max_health modifier add gm4_monsters_unbound:elite_buff.fire 2.5 add_multiplied_total +attribute @s minecraft:attack_damage modifier add gm4_monsters_unbound:elite_buff.fire -0.99 add_multiplied_total +attribute @s minecraft:movement_speed modifier add gm4_monsters_unbound:elite_buff.fire -0.45 add_multiplied_total +attribute @s minecraft:burning_time modifier add gm4_monsters_unbound:elite_buff.fire -1 add_multiplied_total + +enchant @s[type=#gm4_survival_refightalized:skeleton_types] flame +scoreboard players set @s[type=#gm4_survival_refightalized:skeleton_types] gm4_sr_arrow.damage_change -18 +scoreboard players add @s[type=#gm4_survival_refightalized:skeleton_types] gm4_sr_arrow.fire_delay 2 +item replace entity @s[type=!#gm4_survival_refightalized:skeleton_types] weapon.mainhand with blaze_rod[enchantments={fire_aspect:2}] +data modify entity @s HandDropChances[0] set value -327.670F + +item replace entity @s armor.head with magma_block +data modify entity @s ArmorDropChances[3] set value -327.670F + +team join gm4_mu_elite.blazing diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/gargantuan.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/gargantuan.mcfunction new file mode 100644 index 0000000000..963be96260 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/gargantuan.mcfunction @@ -0,0 +1,27 @@ +# pick this elite type to spawn +# @s = zombie / skeleton types +# at @s +# run from mob/init/elite/pick + +tag @s add gm4_mu_elite.gargantuan +tag @s add gm4_mu_elite.process + +attribute @s minecraft:max_health modifier add gm4_monsters_unbound:elite_buff.giant 5.5 add_multiplied_total +attribute @s minecraft:gravity modifier add gm4_monsters_unbound:elite_buff.giant 0.5 add_multiplied_total +attribute @s minecraft:jump_strength modifier add gm4_monsters_unbound:elite_buff.giant 0.5 add_multiplied_total +attribute @s minecraft:attack_knockback modifier add gm4_monsters_unbound:elite_buff.giant 1.75 add_value +attribute @s minecraft:water_movement_efficiency modifier add gm4_monsters_unbound:elite_buff.giant 0.85 add_value +attribute @s minecraft:movement_speed modifier add gm4_monsters_unbound:elite_buff.giant -0.35 add_multiplied_total + +attribute @s[type=#gm4_survival_refightalized:skeleton_types] minecraft:scale modifier add gm4_monsters_unbound:elite_buff.giant_size 0.507537 add_multiplied_total +attribute @s[type=!#gm4_survival_refightalized:skeleton_types] minecraft:scale modifier add gm4_monsters_unbound:elite_buff.giant_size 0.538461 add_multiplied_total + +enchant @s[type=#gm4_survival_refightalized:skeleton_types] punch 2 +enchant @s[type=#gm4_survival_refightalized:skeleton_types] power 1 + +scoreboard players set @s[type=#gm4_survival_refightalized:skeleton_types] gm4_sr_arrow.fire_delay 7 + +item replace entity @s armor.head with cobblestone[enchantment_glint_override=false,minecraft:enchantments={"projectile_protection":5}] 1 +data modify entity @s ArmorDropChances[3] set value -327.670F + +team join gm4_mu_elite.gargantuan diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/glacial.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/glacial.mcfunction new file mode 100644 index 0000000000..945aa81dc5 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/glacial.mcfunction @@ -0,0 +1,15 @@ +# pick this elite type to spawn +# @s = zombie / skeleton types +# at @s +# run from mob/init/elite/pick + +tag @s add gm4_mu_slowing_attack +tag @s add gm4_mu_elite.glacial + +attribute @s minecraft:max_health modifier add gm4_monsters_unbound:elite_buff.frost 2.5 add_multiplied_total +attribute @s minecraft:knockback_resistance modifier add gm4_monsters_unbound:elite_buff.frost 0.45 add_value + +loot replace entity @s armor.head loot gm4_monsters_unbound:elite/glacial +data modify entity @s ArmorDropChances[3] set value 1F + +team join gm4_mu_elite.glacial diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/mending.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/mending.mcfunction new file mode 100644 index 0000000000..e9e1e4e39b --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/mending.mcfunction @@ -0,0 +1,15 @@ +# pick this elite type to spawn +# @s = zombie / skeleton types +# at @s +# run from mob/init/elite/pick + +tag @s add gm4_mu_elite.process +tag @s add gm4_mu_elite.mending + +attribute @s minecraft:max_health modifier add gm4_monsters_unbound:elite_buff.heal 1.5 add_multiplied_total +attribute @s minecraft:movement_speed modifier add gm4_monsters_unbound:elite_buff.heal -0.25 add_multiplied_total + +loot replace entity @s armor.head loot gm4_monsters_unbound:elite/mending +data modify entity @s ArmorDropChances[3] set value -327.670F + +team join gm4_mu_elite.mending diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/pearlescent.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/pearlescent.mcfunction new file mode 100644 index 0000000000..30749cfb15 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/pearlescent.mcfunction @@ -0,0 +1,16 @@ +# pick this elite type to spawn +# @s = zombie / skeleton types +# at @s +# run from mob/init/elite/pick + +tag @s add gm4_mu_elite.process +tag @s add gm4_mu_elite.pearlescent + +attribute @s minecraft:max_health modifier add gm4_monsters_unbound:elite_buff.pearlescent 2.5 add_multiplied_total +attribute @s minecraft:movement_speed modifier add gm4_monsters_unbound:elite_buff.pearlescent 0.2 add_multiplied_total + +item replace entity @s weapon.mainhand with air +loot replace entity @s armor.head loot gm4_monsters_unbound:elite/pearlescent +data modify entity @s ArmorDropChances[3] set value -327.670F + +team join gm4_mu_elite.pearlescent diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/splitting.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/splitting.mcfunction new file mode 100644 index 0000000000..8e50054636 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/splitting.mcfunction @@ -0,0 +1,15 @@ +# pick this elite type to spawn +# @s = zombie / skeleton types +# at @s +# run from mob/init/elite/pick + +tag @s add gm4_mu_elite.process +tag @s add gm4_mu_elite.splitting + +attribute @s minecraft:max_health modifier add gm4_monsters_unbound:elite_buff.vorpal 2.5 add_multiplied_total + +loot replace entity @s[type=!#gm4_survival_refightalized:skeleton_types] armor.head loot gm4_monsters_unbound:elite/splitting_zombie +loot replace entity @s[type=#gm4_survival_refightalized:skeleton_types] armor.head loot gm4_monsters_unbound:elite/splitting_skeleton +data modify entity @s ArmorDropChances[3] set value 1F + +team join gm4_mu_elite.splitting diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/volatile.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/volatile.mcfunction new file mode 100644 index 0000000000..5e154fa082 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/volatile.mcfunction @@ -0,0 +1,17 @@ +# pick this elite type to spawn +# @s = zombie / skeleton types +# at @s +# run from mob/init/elite/pick + +tag @s add gm4_mu_elite.process +tag @s add gm4_mu_elite.volatile + +attribute @s minecraft:max_health modifier add gm4_monsters_unbound:elite_buff.volatile 2.5 add_multiplied_total + +loot replace entity @s armor.head loot gm4_monsters_unbound:elite/volatile +data modify entity @s ArmorDropChances[3] set value 1F + +team join gm4_mu_elite.volatile + +scoreboard players set @s gm4_sr_arrow.fire_delay 0 +scoreboard players set @s gm4_sr_arrow.damage_change -10 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/vorpal.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/vorpal.mcfunction new file mode 100644 index 0000000000..0b782f9094 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/vorpal.mcfunction @@ -0,0 +1,17 @@ +# pick this elite type to spawn +# @s = zombie / skeleton types +# at @s +# run from mob/init/elite/pick + +tag @s add gm4_mu_elite.vorpal +tag @s add gm4_mu_elite.on_hit + +attribute @s minecraft:max_health modifier add gm4_monsters_unbound:elite_buff.vorpal 2.5 add_multiplied_total +attribute @s minecraft:attack_damage modifier add gm4_monsters_unbound:elite_buff.vorpal 0.25 add_multiplied_total + +loot replace entity @s armor.head loot gm4_monsters_unbound:elite/vorpal +data modify entity @s ArmorDropChances[3] set value 1F + +scoreboard players add @s gm4_sr_arrow.damage_change 5 + +team join gm4_mu_elite.vorpal diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/zephyr.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/zephyr.mcfunction new file mode 100644 index 0000000000..15067aad0e --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/elite/type/zephyr.mcfunction @@ -0,0 +1,22 @@ +# pick this elite type to spawn +# @s = zombie / skeleton types +# at @s +# run from mob/init/elite/pick + +tag @s add gm4_mu_elite.process +tag @s add gm4_mu_elite.zephyr + +effect give @s wind_charged infinite 0 true + +attribute @s minecraft:max_health modifier add gm4_monsters_unbound:elite_buff.speed 2.5 add_multiplied_total +attribute @s minecraft:movement_speed modifier add gm4_monsters_unbound:elite_buff.speed 0.15 add_multiplied_total +attribute @s minecraft:attack_knockback modifier add gm4_monsters_unbound:elite_buff.speed 0.5 add_value +attribute @s minecraft:fall_damage_multiplier modifier add gm4_monsters_unbound:elite_buff.speed -1 add_multiplied_total + +item replace entity @s armor.head with white_wool +data modify entity @s ArmorDropChances[3] set value -327.670F + +team join gm4_mu_elite.zephyr + +scoreboard players set @s gm4_sr_arrow.fire_delay 0 +scoreboard players set @s gm4_sr_arrow.damage_change -15 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type.mcfunction new file mode 100644 index 0000000000..cb80d56d63 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type.mcfunction @@ -0,0 +1,13 @@ +# check what mob is being processed +# @s = mobs that can be buffed +# at @s +# run from function call gm4_survival_refightalized:init_mob, from gm4_survival_refightalized:mob/init/initiate + +# zombie, zombie_villager, husk, drowned +execute if entity @s[type=#gm4_survival_refightalized:zombie_types] run return run function gm4_monsters_unbound:mob/init/mob_type/zombie/base +# skeleton, bogged, stray +execute if entity @s[type=#gm4_survival_refightalized:skeleton_types,type=!wither_skeleton] run return run function gm4_monsters_unbound:mob/init/mob_type/skeleton/base +execute if entity @s[type=spider] run return run function gm4_monsters_unbound:mob/init/mob_type/spider/spider +execute if entity @s[type=creeper] run return run function gm4_monsters_unbound:mob/init/mob_type/creeper/base +execute if entity @s[type=cave_spider] run return run function gm4_monsters_unbound:mob/init/mob_type/spider/cave_spider +execute if entity @s[type=enderman] run return run function gm4_monsters_unbound:mob/init/mob_type/enderman/base diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/creeper/base.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/creeper/base.mcfunction new file mode 100644 index 0000000000..ebb31255f4 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/creeper/base.mcfunction @@ -0,0 +1,23 @@ +# calculate modifiers for newly spawned creeper +# @s = creeper +# at @s +# run from mob/init/mob_type + +# | Biome Modifiers +# snowy +execute if entity @s[tag=!gm4_sr_extra_mob,predicate=gm4_monsters_unbound:biome/snowy] run function gm4_monsters_unbound:mob/init/mob_type/creeper/snowy +# mountainous +execute if predicate {condition:"minecraft:all_of",terms:[{condition:"minecraft:random_chance",chance:0.30},{condition:"minecraft:reference",name:"gm4_monsters_unbound:biome/mountainous"}]} run function gm4_monsters_unbound:mob/init/mob_type/creeper/mountainous +# burned +execute if predicate gm4_monsters_unbound:biome/burned store result entity @s Fuse int 0.75 run data get entity @s Fuse +# flowering +execute if predicate gm4_monsters_unbound:biome/flowering run function gm4_monsters_unbound:mob/init/mob_type/creeper/flowering +# toxic +tag @s[predicate=gm4_monsters_unbound:biome/toxic] add gm4_mu_toxic_creeper +execute if entity @s[tag=gm4_mu_toxic_creeper] run function gm4_monsters_unbound:mob/process/toxic_creeper +# growth +attribute @s[predicate=gm4_monsters_unbound:biome/growth] minecraft:movement_speed modifier add gm4_monsters_unbound:stat_change.growth 0.2 add_multiplied_base +# underground +data modify entity @s[predicate=gm4_survival_refightalized:mob/underground] ExplosionRadius set value 4s +# dripstone caves +execute if biome ~ ~ ~ dripstone_caves if block ~.875 ~ ~.875 #gm4:no_collision if block ~.875 ~ ~-.875 #gm4:no_collision if block ~-.875 ~ ~.875 #gm4:no_collision if block ~-.875 ~ ~-.875 #gm4:no_collision run function gm4_monsters_unbound:mob/init/mob_type/creeper/dripstone_caves diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/creeper/dripstone_caves.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/creeper/dripstone_caves.mcfunction new file mode 100644 index 0000000000..7188cd542a --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/creeper/dripstone_caves.mcfunction @@ -0,0 +1,7 @@ + + +summon spider ~ ~ ~ {Tags:["gm4_sr_extra_mob"]} +tp @s ~ ~-2050 ~ +kill @s +scoreboard players set $mob_extras gm4_sr_data 1 +scoreboard players set $removed_mob gm4_sr_data 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/creeper/flowering.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/creeper/flowering.mcfunction new file mode 100644 index 0000000000..0228c6d9a9 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/creeper/flowering.mcfunction @@ -0,0 +1,8 @@ +# apply invisibility to creeper +# @s = creeper +# at @s +# run from mob/init/mob_type/creeper/base + +tag @s add gm4_mu_cloaked_creeper +effect give @s invisibility 35 0 +data modify entity @s ExplosionRadius set value 2s diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/creeper/mountainous.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/creeper/mountainous.mcfunction new file mode 100644 index 0000000000..e15a891037 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/creeper/mountainous.mcfunction @@ -0,0 +1,7 @@ +# make this creeper stronger +# @s = creeper +# at @s +# run from mob/init/mob_type/creeper/base + +attribute @s minecraft:knockback_resistance modifier add gm4_monsters_unbound:stat_change.gargantuan 0.4 add_value +attribute @s minecraft:max_health modifier add gm4_monsters_unbound:stat_change.gargantuan 0.25 add_multiplied_total diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/creeper/snowy.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/creeper/snowy.mcfunction new file mode 100644 index 0000000000..f8bc45e553 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/creeper/snowy.mcfunction @@ -0,0 +1,15 @@ +# replace creeper with a snowy trap or zombie/stray +# @s = creeper +# at @s +# run from mob/init/mob_type/creeper/base + +tp @s ~ ~-2050 ~ +kill @s +scoreboard players set $removed_mob gm4_sr_data 1 + +execute if block ~ ~ ~ snow run return run summon marker ~ ~ ~ {Tags:["gm4_mu_trap","gm4_mu_snowy_trap"],CustomName:'{"text":"GM4 Monsters Unbound - Snow Trap"}'} + +execute store result score $pick_entity gm4_mu_data run random value 1..2 +scoreboard players set $mob_extras gm4_sr_data 1 +execute if score $pick_entity gm4_mu_data matches 1 run summon zombie ~ ~ ~ {Tags:["gm4_sr_extra_mob"]} +execute if score $pick_entity gm4_mu_data matches 2 run summon stray ~ ~ ~ {Tags:["gm4_sr_extra_mob"]} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/base.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/base.mcfunction new file mode 100644 index 0000000000..ab0bb045ed --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/base.mcfunction @@ -0,0 +1,27 @@ +# calculate modifiers for newly spawned enderman +# @s = enderman +# at @s +# run from mob/init/mob_type + +# | Biome Modifiers +# flowering +execute if predicate gm4_monsters_unbound:biome/flowering if predicate {condition:"minecraft:random_chance",chance:0.50} run function gm4_monsters_unbound:mob/init/mob_type/enderman/flowering +# toxic +execute if predicate gm4_monsters_unbound:biome/toxic if predicate {condition:"minecraft:random_chance",chance:0.50} run function gm4_monsters_unbound:mob/init/mob_type/enderman/toxic +# burned +execute if entity @s[tag=!gm4_sr_extra_mob,predicate=gm4_monsters_unbound:biome/burned] store success score $mob_extras gm4_sr_data run summon enderman ~.05 ~ ~ {Tags:["gm4_sr_extra_mob"]} +execute if entity @s[tag=!gm4_sr_extra_mob,predicate=gm4_monsters_unbound:biome/burned] store success score $mob_extras gm4_sr_data run summon enderman ~-.05 ~ ~.05 {Tags:["gm4_sr_extra_mob"]} +# growth +execute if predicate gm4_monsters_unbound:biome/growth run function gm4_monsters_unbound:mob/init/mob_type/enderman/growth +# underground +execute if entity @s[tag=!gm4_sr_extra_mob,predicate=gm4_survival_refightalized:mob/underground] if predicate {condition:"minecraft:random_chance",chance:0.15} run function gm4_monsters_unbound:mob/init/mob_type/enderman/underground +# dripstone caves +execute if biome ~ ~ ~ dripstone_caves if block ~.875 ~ ~.875 #gm4:no_collision if block ~.875 ~ ~-.875 #gm4:no_collision if block ~-.875 ~ ~.875 #gm4:no_collision if block ~-.875 ~ ~-.875 #gm4:no_collision run function gm4_monsters_unbound:mob/init/mob_type/enderman/dripstone_caves + +# the end +execute if dimension the_end run attribute @s minecraft:attack_damage modifier add gm4_monsters_unbound:stat_change.the_end 0.2 add_multiplied_base +execute if dimension the_end run attribute @s minecraft:movement_speed modifier add gm4_monsters_unbound:stat_change.the_end 0.15 add_multiplied_base +# nether wastes +execute if biome ~ ~ ~ nether_wastes if predicate {condition:"minecraft:random_chance",chance:0.95} run function gm4_monsters_unbound:mob/init/mob_type/enderman/nether_wastes +# soul sand valley +execute if biome ~ ~ ~ soul_sand_valley if predicate {condition:"minecraft:random_chance",chance:0.95} run function gm4_monsters_unbound:mob/init/mob_type/enderman/soul_sand_valley diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/dripstone_caves.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/dripstone_caves.mcfunction new file mode 100644 index 0000000000..7188cd542a --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/dripstone_caves.mcfunction @@ -0,0 +1,7 @@ + + +summon spider ~ ~ ~ {Tags:["gm4_sr_extra_mob"]} +tp @s ~ ~-2050 ~ +kill @s +scoreboard players set $mob_extras gm4_sr_data 1 +scoreboard players set $removed_mob gm4_sr_data 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/flowering.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/flowering.mcfunction new file mode 100644 index 0000000000..ca42ad871e --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/flowering.mcfunction @@ -0,0 +1,10 @@ +# replace enderman with a slime +# @s = enderman +# at @s +# run from mob/init/mob_type/enderman/base + +summon slime ~ ~ ~ {Tags:["gm4_sr_extra_mob"],Size:2} +tp @s ~ ~-2050 ~ +kill @s +scoreboard players set $mob_extras gm4_sr_data 1 +scoreboard players set $removed_mob gm4_sr_data 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/growth.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/growth.mcfunction new file mode 100644 index 0000000000..2fe8f8ae38 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/growth.mcfunction @@ -0,0 +1,11 @@ +# replace enderman with a 3 skeletons +# @s = enderman +# at @s +# run from mob/init/mob_type/enderman/base + +execute if biome ~ ~ ~ mangrove_swamp run summon bogged ~.05 ~ ~ {Tags:["gm4_sr_extra_mob"]} +execute if biome ~ ~ ~ snowy_taiga run summon stray ~.05 ~ ~ {Tags:["gm4_sr_extra_mob"]} +execute unless biome ~ ~ ~ mangrove_swamp unless biome ~ ~ ~ snowy_taiga run summon skeleton ~.05 ~ ~ {Tags:["gm4_sr_extra_mob"]} +summon skeleton ~0.15 ~ ~-0.15 {Tags:["gm4_sr_extra_mob"]} +summon skeleton ~-0.15 ~ ~0.15 {Tags:["gm4_sr_extra_mob"]} +scoreboard players set $mob_extras gm4_sr_data 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/nether_wastes.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/nether_wastes.mcfunction new file mode 100644 index 0000000000..e986d98263 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/nether_wastes.mcfunction @@ -0,0 +1,10 @@ +# replace enderman with blaze +# @s = enderman +# at @s +# run from mob/init/mob_type/enderman/base + +summon blaze ~ ~0.3 ~ {Tags:["gm4_sr_extra_mob"]} +tp @s ~ ~-2050 ~ +kill @s +scoreboard players set $mob_extras gm4_sr_data 1 +scoreboard players set $removed_mob gm4_sr_data 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/soul_sand_valley.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/soul_sand_valley.mcfunction new file mode 100644 index 0000000000..649ef8378e --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/soul_sand_valley.mcfunction @@ -0,0 +1,10 @@ +# replace enderman with wither skeleton +# @s = enderman +# at @s +# run from mob/init/mob_type/enderman/base + +summon wither_skeleton ~ ~ ~ {Tags:["gm4_sr_extra_mob"]} +tp @s ~ ~-2050 ~ +kill @s +scoreboard players set $mob_extras gm4_sr_data 1 +scoreboard players set $removed_mob gm4_sr_data 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/toxic.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/toxic.mcfunction new file mode 100644 index 0000000000..928781af95 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/toxic.mcfunction @@ -0,0 +1,10 @@ +# replace enderman with a witch +# @s = enderman +# at @s +# run from mob/init/mob_type/enderman/base + +summon witch ~ ~ ~ {Tags:["gm4_sr_extra_mob"]} +tp @s ~ ~-2050 ~ +kill @s +scoreboard players set $mob_extras gm4_sr_data 1 +scoreboard players set $removed_mob gm4_sr_data 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/underground.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/underground.mcfunction new file mode 100644 index 0000000000..7973d0bbe8 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/enderman/underground.mcfunction @@ -0,0 +1,11 @@ +# spawn 5 more enderman +# @s = enderman +# at @s +# run from mob/init/mob_type/enderman/base + +summon enderman ~0.15 ~ ~0.15 {Tags:["gm4_sr_extra_mob"]} +summon enderman ~0.15 ~ ~-0.15 {Tags:["gm4_sr_extra_mob"]} +summon enderman ~-0.15 ~ ~0.15 {Tags:["gm4_sr_extra_mob"]} +summon enderman ~0.15 ~ ~ {Tags:["gm4_sr_extra_mob"]} +summon enderman ~ ~ ~0.15 {Tags:["gm4_sr_extra_mob"]} +scoreboard players set $mob_extras gm4_sr_data 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/skeleton/base.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/skeleton/base.mcfunction new file mode 100644 index 0000000000..4380185678 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/skeleton/base.mcfunction @@ -0,0 +1,33 @@ +# calculate modifiers for newly spawned skeleton / stray +# @s = skeleton types +# at @s +# run from mob/init/mob_type + +# elites - don't get other modifiers - 5% of spawns +execute store result score $nearby_elites gm4_mu_data if entity @e[type=#gm4_monsters_unbound:elite_types,tag=gm4_mu_elite,distance=..32] +execute if score $nearby_elites gm4_mu_data matches ..2 if predicate {condition:"minecraft:random_chance",chance:0.05} run tag @s[tag=!gm4_sr_extra_mob] add gm4_mu_elite +execute if entity @s[tag=gm4_mu_elite] run return run function gm4_monsters_unbound:mob/init/elite/pick + +# | Biome Modifiers +# snowy +execute if entity @s[type=stray,predicate=gm4_monsters_unbound:biome/snowy,predicate=!gm4_monsters_unbound:biome/growth] run loot replace entity @s weapon.offhand loot gm4_monsters_unbound:mob/equip_arrow/stray_snowy +# mountainous +execute if predicate gm4_monsters_unbound:biome/mountainous positioned ~ ~35 ~ store result score $phantom_count gm4_mu_data if entity @e[type=phantom,distance=..32] +execute if score $spawn_phantoms gm4_sr_config matches 1 if score $phantom_count gm4_mu_data < $mob_limit.phantom gm4_sr_config if predicate gm4_monsters_unbound:chance/spawn_phantom run function gm4_monsters_unbound:mob/init/mob_type/zombie/spawn_phantoms +# flowering +execute if predicate {condition:"minecraft:all_of",terms:[{condition:"minecraft:random_chance",chance:0.85},{condition:"minecraft:reference",name:"gm4_monsters_unbound:biome/flowering"}]} run function gm4_monsters_unbound:mob/init/mob_type/skeleton/flowering +# toxic +tag @s add gm4_mu_self +execute if entity @s[type=bogged,predicate=gm4_monsters_unbound:biome/toxic] if predicate {condition:"minecraft:random_chance",chance:0.15} summon spider run function gm4_monsters_unbound:mob/init/mob_type/skeleton/toxic +tag @s remove gm4_mu_self +# burning +execute if predicate {condition:"minecraft:all_of",terms:[{condition:"minecraft:random_chance",chance:0.15},{condition:"minecraft:reference",name:"gm4_monsters_unbound:biome/burned"}]} run enchant @s flame 1 +# growth +execute if entity @s[type=!bogged,predicate=gm4_monsters_unbound:biome/growth] run function gm4_monsters_unbound:mob/init/mob_type/skeleton/growth +# dripstone caves +execute if predicate {condition:"minecraft:all_of",terms:[{condition:"location_check",predicate:{biomes:"dripstone_caves"}},{condition:"random_chance",chance:0.6}]} run item replace entity @s weapon.mainhand with stone_pickaxe +# underground +execute if predicate gm4_survival_refightalized:mob/underground if predicate {condition:"minecraft:random_chance",chance:0.4} run function gm4_monsters_unbound:mob/init/mob_type/skeleton/underground + +# soul sand valley +execute if biome ~ ~ ~ soul_sand_valley run effect give @s fire_resistance infinite 0 true diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/skeleton/flowering.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/skeleton/flowering.mcfunction new file mode 100644 index 0000000000..0f3d349c39 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/skeleton/flowering.mcfunction @@ -0,0 +1,10 @@ +# replace skeleton with zombie +# @s = skeleton +# at @s +# run from mob/init/mob_type/skeleton/base + +summon zombie ~.1 ~ ~ {Tags:["gm4_sr_extra_mob"]} +scoreboard players set $mob_extras gm4_sr_data 1 +tp @s ~ ~-2050 ~ +kill @s +scoreboard players set $removed_mob gm4_sr_data 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/skeleton/growth.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/skeleton/growth.mcfunction new file mode 100644 index 0000000000..b6881d2514 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/skeleton/growth.mcfunction @@ -0,0 +1,8 @@ +# apply growth effects to skeleton +# @s = skeleton +# at @s +# run from mob/init/mob_type/skeleton/base + +item replace entity @s weapon.mainhand with air +attribute @s minecraft:max_health modifier add gm4_monsters_unbound:stat_change.growth 4 add_value +attribute @s minecraft:movement_speed modifier add gm4_monsters_unbound:stat_change.growth 0.25 add_multiplied_base diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/skeleton/toxic.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/skeleton/toxic.mcfunction new file mode 100644 index 0000000000..65f21455d7 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/skeleton/toxic.mcfunction @@ -0,0 +1,7 @@ +# make the bogged ride a spider +# @s = bogged +# at @s +# run from mob/init/mob_type/skeleton/base + +tag @s add gm4_sr_extra_mob +ride @n[tag=gm4_mu_self] mount @s diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/skeleton/underground.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/skeleton/underground.mcfunction new file mode 100644 index 0000000000..efeed6cb16 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/skeleton/underground.mcfunction @@ -0,0 +1,11 @@ +# apply an underground buff +# @s = skeleton +# at @s +# run from mob/init/mob_type/skeleton/base + +execute store result score $buff_picked gm4_mu_data run random value 1..4 + +execute if score $buff_picked gm4_mu_data matches 1 run effect give @s regeneration infinite 0 +execute if score $buff_picked gm4_mu_data matches 2 run scoreboard players add @s[tag=!gm4_mu_elite.split_entity] gm4_sr_arrow.damage_change 4 +execute if score $buff_picked gm4_mu_data matches 3 run scoreboard players remove @s gm4_sr_arrow.fire_delay 1 +execute if score $buff_picked gm4_mu_data matches 4 run item replace entity @s weapon.mainhand with stone_sword diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/cave_spider.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/cave_spider.mcfunction new file mode 100644 index 0000000000..81d9766f34 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/cave_spider.mcfunction @@ -0,0 +1,17 @@ +# calculate modifiers for newly spawned cave spider +# @s = cave spider +# at @s +# run from mob/init/mob_type + +# | Biome Modifiers +# mountainous +execute if predicate {condition:"minecraft:all_of",terms:[{condition:"minecraft:random_chance",chance:0.40},{condition:"minecraft:reference",name:"gm4_monsters_unbound:biome/mountainous"}]} run effect give @s speed infinite 0 +# burned +execute if predicate {condition:"minecraft:all_of",terms:[{condition:"minecraft:random_chance",chance:0.50},{condition:"minecraft:reference",name:"gm4_monsters_unbound:biome/burned"}]} run effect give @s fire_resistance infinite 0 +# toxic +tag @s[predicate=gm4_monsters_unbound:biome/toxic] add gm4_mu_toxic_attack +# growth +execute if entity @s[tag=!gm4_sr_extra_mob,predicate=gm4_monsters_unbound:biome/growth] store success score $mob_extras gm4_sr_data run summon cave_spider ~ ~ ~ {Tags:["gm4_sr_extra_mob"]} +execute if entity @s[tag=!gm4_sr_extra_mob,predicate=gm4_monsters_unbound:biome/growth] if predicate {condition:"minecraft:random_chance",chance:0.60} store success score $mob_extras gm4_sr_data run summon cave_spider ~ ~ ~ {Tags:["gm4_sr_extra_mob"]} +# dripstone caves +execute if biome ~ ~ ~ dripstone_caves run attribute @s minecraft:max_health modifier add gm4_monsters_unbound:stat_change.dripstone_caves 1 add_multiplied_total diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/gargantuan.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/gargantuan.mcfunction new file mode 100644 index 0000000000..a32dd705f5 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/gargantuan.mcfunction @@ -0,0 +1,13 @@ +# make spider gargantuan +# @s = spider +# at @s +# run from mob/init/mob_type/spider/spider +# run from mob/init/mob_type/spider/underground/pick + +attribute @s minecraft:movement_speed modifier add gm4_monsters_unbound:stat_change.gargantuan 0.25 add_multiplied_total +attribute @s minecraft:scale modifier add gm4_monsters_unbound:stat_change.gargantuan 0.25 add_multiplied_total +attribute @s minecraft:max_health modifier add gm4_monsters_unbound:stat_change.gargantuan 0.75 add_multiplied_total +effect give @s weaving infinite 0 +team join gm4_mu_elite.gargantuan +tag @s add gm4_mu_elite +tag @s add gm4_mu_elite.gargantuan diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/lush_caves.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/lush_caves.mcfunction new file mode 100644 index 0000000000..6d7d20fad6 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/lush_caves.mcfunction @@ -0,0 +1,13 @@ +# replace spider with 4 silverfish +# @s = spider +# at @s +# run from mob/init/mob_type/spider/spider + +summon silverfish ~0.15 ~ ~0.15 {Tags:["gm4_sr_extra_mob"]} +summon silverfish ~0.15 ~ ~-0.15 {Tags:["gm4_sr_extra_mob"]} +summon silverfish ~-0.15 ~ ~0.15 {Tags:["gm4_sr_extra_mob"]} +summon silverfish ~-0.15 ~ ~-0.15 {Tags:["gm4_sr_extra_mob"]} +tp @s ~ ~-2050 ~ +kill @s +scoreboard players set $mob_extras gm4_sr_data 1 +scoreboard players set $removed_mob gm4_sr_data 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/spider.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/spider.mcfunction new file mode 100644 index 0000000000..f70f7f3520 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/spider.mcfunction @@ -0,0 +1,23 @@ +# calculate modifiers for newly spawned spider +# @s = spider +# at @s +# run from mob/init/mob_type + +# | Biome Modifiers +# snowy +execute if predicate {condition:"minecraft:all_of",terms:[{condition:"minecraft:random_chance",chance:0.15},{condition:"minecraft:reference",name:"gm4_monsters_unbound:biome/snowy"}]} run function gm4_monsters_unbound:mob/init/mob_type/spider/gargantuan +# mountainous +execute if predicate {condition:"minecraft:all_of",terms:[{condition:"minecraft:random_chance",chance:0.40},{condition:"minecraft:reference",name:"gm4_monsters_unbound:biome/mountainous"}]} run effect give @s speed infinite 0 +# burned +execute if predicate {condition:"minecraft:all_of",terms:[{condition:"minecraft:random_chance",chance:0.50},{condition:"minecraft:reference",name:"gm4_monsters_unbound:biome/burned"}]} run effect give @s fire_resistance infinite 0 +# flowering +execute if biome ~ ~ ~ lush_caves if predicate {condition:"minecraft:random_chance",chance:0.50} run function gm4_monsters_unbound:mob/init/mob_type/spider/lush_caves +# toxic +execute if entity @s[tag=!gm4_sr_extra_mob,predicate=gm4_monsters_unbound:biome/toxic] run function gm4_monsters_unbound:mob/init/mob_type/spider/toxic +# growth +execute if entity @s[tag=!gm4_sr_extra_mob,predicate=gm4_monsters_unbound:biome/growth] store success score $mob_extras gm4_sr_data run summon spider ~ ~ ~ {Tags:["gm4_sr_extra_mob"]} +execute if entity @s[tag=!gm4_sr_extra_mob,predicate=gm4_monsters_unbound:biome/growth] if predicate {condition:"minecraft:random_chance",chance:0.60} store success score $mob_extras gm4_sr_data run summon spider ~ ~ ~ {Tags:["gm4_sr_extra_mob"]} +# dripstone caves +execute if predicate {condition:"minecraft:all_of",terms:[{condition:"minecraft:random_chance",chance:0.1},{condition:"minecraft:location_check",predicate:{biomes:"dripstone_caves"}}]} run function gm4_monsters_unbound:mob/init/mob_type/spider/gargantuan +# underground +execute if predicate {condition:"minecraft:all_of",terms:[{condition:"minecraft:random_chance",chance:0.25},{condition:"minecraft:reference",name:"gm4_survival_refightalized:mob/underground"}]} run function gm4_monsters_unbound:mob/init/mob_type/spider/underground/pick diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/toxic.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/toxic.mcfunction new file mode 100644 index 0000000000..645f368dc5 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/toxic.mcfunction @@ -0,0 +1,9 @@ +# summon 3 cave spiders +# @s = spider +# at @s +# run from mob/init/mob_type/spider/spider + +summon cave_spider ~ ~ ~0.15 {Tags:["gm4_sr_extra_mob"],attributes:[{id:"minecraft:max_health",base:9}]} +summon cave_spider ~0.15 ~ ~-0.15 {Tags:["gm4_sr_extra_mob"],attributes:[{id:"minecraft:max_health",base:9}]} +summon cave_spider ~-0.15 ~ ~-0.15 {Tags:["gm4_sr_extra_mob"],attributes:[{id:"minecraft:max_health",base:9}]} +scoreboard players set $mob_extras gm4_sr_data 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/underground/pick.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/underground/pick.mcfunction new file mode 100644 index 0000000000..b5c06764ac --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/underground/pick.mcfunction @@ -0,0 +1,10 @@ +# pick underground buff +# @s = spider +# at @s +# run from mob/init/mob_type/spider/spider + +execute store result score $buff_picked gm4_mu_data run random value 1..3 + +execute if score $buff_picked gm4_mu_data matches 1 run effect give @s invisibility infinite 0 +execute if score $buff_picked gm4_mu_data matches 2 run function gm4_monsters_unbound:mob/init/mob_type/spider/gargantuan +execute if score $buff_picked gm4_mu_data matches 3 run function gm4_monsters_unbound:mob/init/mob_type/spider/underground/replace_with_cave_spider diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/underground/replace_with_cave_spider.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/underground/replace_with_cave_spider.mcfunction new file mode 100644 index 0000000000..8a1195aaff --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/spider/underground/replace_with_cave_spider.mcfunction @@ -0,0 +1,10 @@ +# replace with cave spider +# @s = spider +# at @s +# run from mob/init/mob_type/spider/underground/pick + +summon cave_spider ~.1 ~ ~ {Tags:["gm4_sr_extra_mob"]} +scoreboard players set $mob_extras gm4_sr_data 1 +tp @s ~ ~-2050 ~ +kill @s +scoreboard players set $removed_mob gm4_sr_data 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/base.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/base.mcfunction new file mode 100644 index 0000000000..81ad4e26ba --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/base.mcfunction @@ -0,0 +1,31 @@ +# calculate modifiers for newly spawned zombie / zombie villager +# @s = zombie types +# at @s +# run from mob/init/mob_type + +# elites - don't get other modifiers - 5% of spawns (replaces baby zombies) +execute if entity @s[tag=gm4_sr_was_baby] store result score $nearby_elites gm4_mu_data if entity @e[type=#gm4_monsters_unbound:elite_types,tag=gm4_mu_elite,distance=..32] +execute if entity @s[tag=gm4_sr_was_baby] if score $nearby_elites gm4_mu_data matches ..2 run return run function gm4_monsters_unbound:mob/init/elite/pick + +# | Biome Modifiers +# snowy +execute if predicate gm4_monsters_unbound:biome/snowy run function gm4_monsters_unbound:mob/init/mob_type/zombie/snowy +tag @s[predicate=gm4_monsters_unbound:biome/snowy] add gm4_mu_slowing_attack +# mountainous +execute if predicate gm4_monsters_unbound:biome/mountainous run function gm4_monsters_unbound:mob/init/mob_type/zombie/mountainous +# burned +execute if entity @s[type=husk,predicate=gm4_monsters_unbound:biome/burned] run function gm4_monsters_unbound:mob/init/mob_type/zombie/burned_husk +# flowering +execute if predicate gm4_monsters_unbound:biome/flowering run tag @s add gm4_mu_spore_zombie +execute if entity @s[tag=gm4_mu_spore_zombie] run function gm4_monsters_unbound:mob/init/mob_type/zombie/flowering +# toxic +tag @s[predicate=gm4_monsters_unbound:biome/toxic] add gm4_mu_weakness_attack +effect give @s[predicate=gm4_monsters_unbound:biome/toxic] infested infinite 0 +# reef +execute if entity @s[type=drowned,predicate=gm4_monsters_unbound:biome/reef] run function gm4_monsters_unbound:mob/init/mob_type/zombie/reef_drowned +# growth +execute if entity @s[type=!zombie_villager,tag=!gm4_mu_spore_zombie,predicate=gm4_monsters_unbound:biome/growth] run function gm4_monsters_unbound:mob/init/mob_type/zombie/growth +# dripstone caves +execute if entity @s[tag=!gm4_sr_extra_mob] if biome ~ ~ ~ dripstone_caves run function gm4_monsters_unbound:mob/init/mob_type/zombie/dripstone_caves/try +# underground (not dripstone caves) +execute if predicate {condition:"all_of",terms:[{condition:"reference",name:"gm4_survival_refightalized:mob/underground"},{condition:"inverted",term:{condition:"location_check",predicate:{"biomes":"dripstone_caves"}}},{condition:"random_chance",chance:0.5}]} run function gm4_monsters_unbound:mob/init/mob_type/zombie/underground/pick diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/burned_husk.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/burned_husk.mcfunction new file mode 100644 index 0000000000..2b82605d37 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/burned_husk.mcfunction @@ -0,0 +1,9 @@ +# apply burned husk effects +# @s = husk +# at @s +# run from mob/init/mob_type/zombie/base + +attribute @s minecraft:max_health modifier add gm4_monsters_unbound:stat_change.burned_husk -0.65 add_multiplied_total +attribute @s minecraft:attack_damage modifier add gm4_monsters_unbound:stat_change.burned_husk -0.25 add_multiplied_total +execute at @p[gamemode=!spectator] store result score $husk_count gm4_mu_data if entity @e[type=husk,distance=..128] +execute if entity @s[tag=!gm4_sr_extra_mob] unless score $husk_count gm4_mu_data > $mob_limit.husk_army gm4_sr_config run function gm4_monsters_unbound:mob/init/mob_type/zombie/burned_husk_army diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/burned_husk_army.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/burned_husk_army.mcfunction new file mode 100644 index 0000000000..df79b1b483 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/burned_husk_army.mcfunction @@ -0,0 +1,18 @@ +# spawn up to 11 extra husks +# @s = husk +# at @s +# run from mob/init/mob_type/zombie/burned_husk + +execute if block ~1 ~ ~ #gm4:no_collision if block ~1 ~1 ~ #gm4:no_collision run summon husk ~1 ~ ~ {Tags:["gm4_sr_extra_mob"]} +execute if block ~-1 ~ ~ #gm4:no_collision if block ~-1 ~1 ~ #gm4:no_collision run summon husk ~-1 ~ ~ {Tags:["gm4_sr_extra_mob"]} +execute if block ~ ~ ~1 #gm4:no_collision if block ~ ~1 ~1 #gm4:no_collision run summon husk ~ ~ ~1 {Tags:["gm4_sr_extra_mob"]} +execute if block ~ ~ ~-1 #gm4:no_collision if block ~ ~1 ~-1 #gm4:no_collision run summon husk ~ ~ ~-1 {Tags:["gm4_sr_extra_mob"]} +execute if predicate {condition:"minecraft:random_chance",chance:0.5} if block ~1 ~ ~1 #gm4:no_collision if block ~1 ~1 ~1 #gm4:no_collision run summon husk ~1 ~ ~1 {Tags:["gm4_sr_extra_mob"]} +execute if predicate {condition:"minecraft:random_chance",chance:0.5} if block ~-1 ~ ~-1 #gm4:no_collision if block ~-1 ~1 ~-1 #gm4:no_collision run summon husk ~-1 ~ ~-1 {Tags:["gm4_sr_extra_mob"]} +execute if predicate {condition:"minecraft:random_chance",chance:0.5} if block ~1 ~ ~-1 #gm4:no_collision if block ~1 ~1 ~-1 #gm4:no_collision run summon husk ~1 ~ ~-1 {Tags:["gm4_sr_extra_mob"]} +execute if predicate {condition:"minecraft:random_chance",chance:0.25} if block ~-1 ~ ~1 #gm4:no_collision if block ~-1 ~1 ~1 #gm4:no_collision run summon husk ~-1 ~ ~1 {Tags:["gm4_sr_extra_mob"]} +execute if predicate {condition:"minecraft:random_chance",chance:0.25} if block ~2 ~ ~-1 #gm4:no_collision if block ~2 ~1 ~-1 #gm4:no_collision run summon husk ~2 ~ ~-1 {Tags:["gm4_sr_extra_mob"]} +execute if predicate {condition:"minecraft:random_chance",chance:0.25} if block ~-1 ~ ~2 #gm4:no_collision if block ~-1 ~1 ~2 #gm4:no_collision run summon husk ~-1 ~ ~2 {Tags:["gm4_sr_extra_mob"]} +execute if predicate {condition:"minecraft:random_chance",chance:0.25} if block ~2 ~ ~2 #gm4:no_collision if block ~2 ~1 ~2 #gm4:no_collision run summon husk ~2 ~ ~2 {Tags:["gm4_sr_extra_mob"]} + +scoreboard players set $mob_extras gm4_sr_data 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/dripstone_caves/place.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/dripstone_caves/place.mcfunction new file mode 100644 index 0000000000..a520fce947 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/dripstone_caves/place.mcfunction @@ -0,0 +1,8 @@ + +tp @s ~ ~-2050 ~ +kill @s +scoreboard players set $removed_mob gm4_sr_data 1 + +scoreboard players set $raycast_limit gm4_mu_data -1 + +execute align y run summon marker ~ ~ ~ {Tags:["gm4_mu_trap","gm4_mu_dripstone_trap"],CustomName:'{"text":"GM4 Monsters Unbound - Dripstone Trap"}'} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/dripstone_caves/raycast.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/dripstone_caves/raycast.mcfunction new file mode 100644 index 0000000000..fb7dcf4b8b --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/dripstone_caves/raycast.mcfunction @@ -0,0 +1,5 @@ + +execute if block ~ ~1 ~ #gm4_monsters_unbound:dripstone run return run function gm4_monsters_unbound:mob/init/mob_type/zombie/dripstone_caves/place + +scoreboard players remove $raycast_limit gm4_mu_data 1 +execute if score $raycast_limit gm4_mu_data matches 1.. positioned ~ ~1 ~ if block ~ ~ ~ #gm4:no_collision run function gm4_monsters_unbound:mob/init/mob_type/zombie/dripstone_caves/raycast diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/dripstone_caves/try.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/dripstone_caves/try.mcfunction new file mode 100644 index 0000000000..f4bacfac66 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/dripstone_caves/try.mcfunction @@ -0,0 +1,15 @@ + +tp @s ~ ~-2050 ~ +kill @s +scoreboard players set $removed_mob gm4_sr_data 1 + +scoreboard players set $raycast_limit gm4_mu_data 32 +execute positioned ~ ~1 ~ run function gm4_monsters_unbound:mob/init/mob_type/zombie/dripstone_caves/raycast + +# stop if the raycast was succesful +execute if score $raycast_limit gm4_mu_data matches -1 run return 0 + +scoreboard players set $spawned_mob gm4_mu_data 0 +execute if block ~.875 ~ ~.875 #gm4:no_collision if block ~.875 ~ ~-.875 #gm4:no_collision if block ~-.875 ~ ~.875 #gm4:no_collision if block ~-.875 ~ ~-.875 #gm4:no_collision store success score $spawned_mob gm4_mu_data run summon spider ~ ~ ~ {Tags:["gm4_sr_extra_mob"]} +execute if score $spawned_mob gm4_mu_data matches 0 run summon skeleton ~ ~ ~ {Tags:["gm4_sr_extra_mob"]} +scoreboard players set $mob_extras gm4_sr_data 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/equip_shield.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/equip_shield.mcfunction new file mode 100644 index 0000000000..54b14b49cb --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/equip_shield.mcfunction @@ -0,0 +1,12 @@ +# give the zombie a shield and bonus stats +# @s = zombie +# at @s +# run from mob/init/mob_type/zombie/underground/pick +# run from mob/init/mob_type/zombie/mountainous +# run from mob/init/mob_type/zombie/snowy + +tag @s add gm4_mu_shielded_zombie +item replace entity @s weapon.offhand with shield +attribute @s minecraft:knockback_resistance modifier add gm4_monsters_unbound:stat_change.shield 0.9 add_value +attribute @s minecraft:armor modifier add gm4_monsters_unbound:stat_change.shield 20 add_value +attribute @s minecraft:armor_toughness modifier add gm4_monsters_unbound:stat_change.shield 10 add_value diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/flowering.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/flowering.mcfunction new file mode 100644 index 0000000000..6f75f6b721 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/flowering.mcfunction @@ -0,0 +1,23 @@ +# set flowering zombie stats +# @s = zombie +# at @s +# run from mob/init/mob_type/zombie/base + +# in cherry grove use cherry leaves +execute if biome ~ ~ ~ cherry_grove run tag @s add gm4_mu_spore_zombie.cherry + +# lower max health +attribute @s minecraft:max_health modifier add gm4_monsters_unbound:stat_change.spore_zombie -0.2 add_multiplied_total + +# put spore on head and store generation +loot replace entity @s armor.head loot gm4_monsters_unbound:mob/equip_armor/spore +execute store result entity @s ArmorItems[3].components."minecraft:custom_data".gm4_mu_spore.generation int 1 run scoreboard players add @s gm4_mu_generation 1 + +# let generation determine dropchance of spore +scoreboard players set $spore_dropchange gm4_mu_data 11 +execute store result entity @s ArmorDropChances[3] float 0.1 run scoreboard players operation $spore_dropchange gm4_mu_data -= @s gm4_mu_generation + +# remove any possible elite triggers +data remove entity @s attributes[{id:"minecraft:max_health"}].modifiers[{id:"minecraft:leader_zombie_bonus"}] +data modify entity @s IsBaby set value 0b +tag @s remove gm4_sr_was_baby diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/growth.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/growth.mcfunction new file mode 100644 index 0000000000..a3271fa7a3 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/growth.mcfunction @@ -0,0 +1,15 @@ +# apply growth effects to zombie +# @s = zombie +# at @s +# run from mob/init/mob_type/zombie/base + + +execute if biome ~ ~ ~ mangrove_swamp run summon bogged ~.05 ~ ~ {Tags:["gm4_sr_extra_mob"]} +execute if biome ~ ~ ~ snowy_taiga run summon stray ~.05 ~ ~ {Tags:["gm4_sr_extra_mob"]} +execute unless biome ~ ~ ~ mangrove_swamp unless biome ~ ~ ~ snowy_taiga run summon skeleton ~.05 ~ ~ {Tags:["gm4_sr_extra_mob"]} +summon skeleton ~ ~ ~ {Tags:["gm4_sr_extra_mob"]} +summon skeleton ~-.05 ~ ~.05 {Tags:["gm4_sr_extra_mob"]} +tp @s ~ ~-2050 ~ +kill @s +scoreboard players set $mob_extras gm4_sr_data 1 +scoreboard players set $removed_mob gm4_sr_data 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/mountainous.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/mountainous.mcfunction new file mode 100644 index 0000000000..0e12585127 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/mountainous.mcfunction @@ -0,0 +1,11 @@ +# set mountain zombie stats +# @s = zombie +# at @s +# run from mob/init/mob_type/zombie/base + +execute positioned ~ ~35 ~ store result score $phantom_count gm4_mu_data if entity @e[type=phantom,distance=..32] +execute if score $spawn_phantoms gm4_sr_config matches 1 if score $phantom_count gm4_mu_data < $mob_limit.phantom gm4_sr_config if predicate gm4_monsters_unbound:chance/spawn_phantom run function gm4_monsters_unbound:mob/init/mob_type/zombie/spawn_phantoms +attribute @s minecraft:attack_knockback modifier add gm4_monsters_unbound:stat_change.mountainous 1 add_value +attribute @s minecraft:attack_damage modifier add gm4_monsters_unbound:stat_change.mountainous 1 add_value + +execute if predicate {condition:"minecraft:random_chance",chance:0.15} run function gm4_monsters_unbound:mob/init/mob_type/zombie/equip_shield diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/reef_drowned.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/reef_drowned.mcfunction new file mode 100644 index 0000000000..0ccc159b6b --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/reef_drowned.mcfunction @@ -0,0 +1,17 @@ +# apply reef effects to drowned +# @s = drowned +# at @s +# run from mob/init/mob_type/zombie/base + +attribute @s minecraft:movement_speed modifier add gm4_monsters_unbound:stat_change.reef 1 add_multiplied_base +attribute @s minecraft:attack_damage modifier add gm4_monsters_unbound:stat_change.reef 2 add_value + +execute if predicate {condition:"minecraft:random_chance",chance:0.6} if entity @s[tag=!gm4_sr_extra_mob] store success score $mob_extras gm4_sr_data run summon drowned ~ ~ ~ {Tags:["gm4_sr_extra_mob"]} +execute if predicate {condition:"minecraft:random_chance",chance:0.6} if entity @s[tag=!gm4_sr_extra_mob] store success score $mob_extras gm4_sr_data run summon drowned ~ ~ ~ {Tags:["gm4_sr_extra_mob"]} +execute if predicate {condition:"minecraft:random_chance",chance:0.45} if entity @s[tag=!gm4_sr_extra_mob] store success score $mob_extras gm4_sr_data run summon guardian ~ ~ ~ +execute if predicate {condition:"minecraft:random_chance",chance:0.45} if entity @s[tag=!gm4_sr_extra_mob] store success score $mob_extras gm4_sr_data run summon guardian ~ ~ ~ +execute if predicate {condition:"minecraft:random_chance",chance:0.45} if entity @s[tag=!gm4_sr_extra_mob] store success score $mob_extras gm4_sr_data run summon guardian ~ ~ ~ + +execute if predicate {condition:"minecraft:random_chance",chance:0.33} run item replace entity @s[tag=!gm4_sr_extra_mob] weapon.mainhand with trident + +scoreboard players set @s gm4_sr_arrow.fire_delay 0 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/snowy.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/snowy.mcfunction new file mode 100644 index 0000000000..8263ab1961 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/snowy.mcfunction @@ -0,0 +1,9 @@ +# set snowy zombie stats +# @s = zombie +# at @s +# run from mob/init/mob_type/zombie/base + +attribute @s minecraft:movement_speed modifier add gm4_monsters_unbound:stat_change.snowy -0.15 add_multiplied_total +attribute @s minecraft:max_health modifier add gm4_monsters_unbound:stat_change.snowy 0.2 add_multiplied_total + +execute if predicate {condition:"minecraft:random_chance",chance:0.05} run function gm4_monsters_unbound:mob/init/mob_type/zombie/equip_shield diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/spawn_phantoms.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/spawn_phantoms.mcfunction new file mode 100644 index 0000000000..7c158f1665 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/spawn_phantoms.mcfunction @@ -0,0 +1,12 @@ +# spawn phantoms +# @s = zombie / skeleton +# at @s +# run from mob/init/mob_type/zombie/base +# run from mob/init/mob_type/skeleton/base + +execute if block ~ ~35 ~ #gm4:no_collision store success score $mob_extras gm4_sr_data run summon phantom ~ ~35 ~ {Tags:["gm4_sr_extra_mob","gm4_mu_phantom"]} +execute if block ~2 ~35 ~ #gm4:no_collision store success score $mob_extras gm4_sr_data run summon phantom ~2 ~35 ~ {Tags:["gm4_sr_extra_mob","gm4_mu_phantom"]} +execute if block ~-1 ~35 ~2 #gm4:no_collision store success score $mob_extras gm4_sr_data run summon phantom ~-1 ~35 ~2 {Tags:["gm4_sr_extra_mob","gm4_mu_phantom"]} +execute if predicate {condition:"random_chance",chance:0.5} if block ~-2 ~35 ~-1 #gm4:no_collision store success score $mob_extras gm4_sr_data run summon phantom ~-2 ~35 ~-1 {Tags:["gm4_sr_extra_mob","gm4_mu_phantom"]} +execute if predicate {condition:"random_chance",chance:0.5} if block ~2 ~35 ~-2 #gm4:no_collision store success score $mob_extras gm4_sr_data run summon phantom ~2 ~35 ~-2 {Tags:["gm4_sr_extra_mob","gm4_mu_phantom"]} +execute if predicate {condition:"random_chance",chance:0.5} if block ~-2 ~35 ~2 #gm4:no_collision store success score $mob_extras gm4_sr_data run summon phantom ~-2 ~35 ~2 {Tags:["gm4_sr_extra_mob","gm4_mu_phantom"]} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/underground/offhand_weapon.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/underground/offhand_weapon.mcfunction new file mode 100644 index 0000000000..1cf2ab899a --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/underground/offhand_weapon.mcfunction @@ -0,0 +1,8 @@ +# give the zombie an offhand weapon and bonus stats +# @s = zombie +# at @s +# run from mob/init/mob_type/zombie/underground/pick + +tag @s add gm4_mu_offhanding_zombie +item replace entity @s weapon.offhand with stone_sword +attribute @s minecraft:attack_damage modifier add gm4_monsters_unbound:stat_change.offhand_weapon 1.5 add_value diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/underground/pick.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/underground/pick.mcfunction new file mode 100644 index 0000000000..8ef7a0d93a --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/underground/pick.mcfunction @@ -0,0 +1,13 @@ +# pick underground buff +# @s = zombie +# at @s +# run from mob/init/mob_type/zombie/base + +execute store result score $buff_picked gm4_mu_data run random value 1..6 + +execute if score $buff_picked gm4_mu_data matches 1 run effect give @s resistance infinite 0 +execute if score $buff_picked gm4_mu_data matches 2 run effect give @s speed infinite 0 +execute if score $buff_picked gm4_mu_data matches 3 run effect give @s regeneration infinite 0 +execute if score $buff_picked gm4_mu_data matches 4 run function gm4_monsters_unbound:mob/init/mob_type/zombie/underground/offhand_weapon +execute if score $buff_picked gm4_mu_data matches 5 run function gm4_monsters_unbound:mob/init/mob_type/zombie/equip_shield +execute if score $buff_picked gm4_mu_data matches 6 run function gm4_monsters_unbound:mob/init/mob_type/zombie/underground/replace_with_skeleton diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/underground/replace_with_skeleton.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/underground/replace_with_skeleton.mcfunction new file mode 100644 index 0000000000..54d1390260 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/init/mob_type/zombie/underground/replace_with_skeleton.mcfunction @@ -0,0 +1,11 @@ +# replace with 2 melee skeletons +# @s = zombie +# at @s +# run from mob/init/mob_type/zombie/underground/pick + +summon skeleton ~.05 ~ ~ {Tags:["gm4_sr_extra_mob","gm4_sr_melee_skeleton"],HandItems:[{},{}]} +summon skeleton ~ ~ ~ {Tags:["gm4_sr_extra_mob","gm4_sr_melee_skeleton"],HandItems:[{},{}]} +tp @s ~ ~-2050 ~ +kill @s +scoreboard players set $mob_extras gm4_sr_data 1 +scoreboard players set $removed_mob gm4_sr_data 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/attack_effect/charging_attack.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/attack_effect/charging_attack.mcfunction new file mode 100644 index 0000000000..55cc04cf58 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/attack_effect/charging_attack.mcfunction @@ -0,0 +1,10 @@ +# damage players hit by charging attacks +# @s = player that was hit +# at unspecified +advancement revoke @s only gm4_monsters_unbound:damaged/attack_effect/charging + +execute as @e[type=#gm4_monsters_unbound:elite_types,tag=gm4_mu_charging_attack,limit=1,sort=nearest] run function gm4_monsters_unbound:mob/process/elite/zephyr/charge_complete + +effect give @s slowness 1 3 true +effect give @s nausea 4 0 false +summon breeze_wind_charge ~ ~ ~ {Motion:[0.0d,-1.0d,0.0d]} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/attack_effect/slowing_attack.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/attack_effect/slowing_attack.mcfunction new file mode 100644 index 0000000000..28fdb9afde --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/attack_effect/slowing_attack.mcfunction @@ -0,0 +1,7 @@ +# slow players hit with slowing attack +# @s = player that was hit +# at unspecified +advancement revoke @s only gm4_monsters_unbound:damaged/attack_effect/slowing + +scoreboard players set $freeze_seconds gm4_mu_data 3 +function gm4_monsters_unbound:effect/freeze/apply_chill diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/attack_effect/toxic_attack.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/attack_effect/toxic_attack.mcfunction new file mode 100644 index 0000000000..6a125ce058 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/attack_effect/toxic_attack.mcfunction @@ -0,0 +1,13 @@ +# weakness and hunger players hit with a toxic attack +# @s = player that was hit +# at unspecified +advancement revoke @s only gm4_monsters_unbound:damaged/attack_effect/toxic + +# scale effect with world difficulty (on easy no effect is applied) +execute store result score $worlddiff gm4_mu_data run difficulty + +execute if score $worlddiff gm4_mu_data matches 2 run effect give @s[tag=!gm4_mu_immune_weakness] weakness 2 0 +execute if score $worlddiff gm4_mu_data matches 3 run effect give @s[tag=!gm4_mu_immune_weakness] weakness 4 0 + +execute if score $worlddiff gm4_mu_data matches 2 run effect give @s[tag=!gm4_mu_immune_hunger] hunger 2 2 +execute if score $worlddiff gm4_mu_data matches 3 run effect give @s[tag=!gm4_mu_immune_hunger] hunger 4 2 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/attack_effect/weakness_attack.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/attack_effect/weakness_attack.mcfunction new file mode 100644 index 0000000000..127daa5132 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/attack_effect/weakness_attack.mcfunction @@ -0,0 +1,7 @@ +# weaken players hit with weakness attack +# @s = player that was hit +# at unspecified +advancement revoke @s only gm4_monsters_unbound:damaged/attack_effect/weakness + +effect give @s[tag=!gm4_mu_immune_weakness] weakness 15 0 +effect give @s[tag=!gm4_mu_immune_hunger] hunger 15 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/cloaked_creeper.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/cloaked_creeper.mcfunction new file mode 100644 index 0000000000..be16326c19 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/cloaked_creeper.mcfunction @@ -0,0 +1,7 @@ +# uncloak creeper if a player is nearby +# @s = cloaked creeper +# at @s +# run from main + +effect clear @s invisibility +tag @s remove gm4_mu_cloaked_creeper diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/blazing/explode_flare.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/blazing/explode_flare.mcfunction new file mode 100644 index 0000000000..81e5e28bc6 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/blazing/explode_flare.mcfunction @@ -0,0 +1,15 @@ +# explode the flare +# @s = flare block_display +# at @s +# run from mob/process/elite/blazing/process_flare + +particle flame ~ ~ ~ 0.01 0.01 0.01 0.1 32 +particle explosion ~ ~ ~ 0 0 0 40 0 + +playsound entity.generic.explode hostile @a ~ ~ ~ 1 1.4 +playsound item.firecharge.use hostile @a ~ ~ ~ 1 0.7 + +# hit players +execute positioned ~-.22 ~-.22 ~-.22 as @a[dx=0,dy=0,dz=0] positioned ~-0.34 ~-0.34 ~-0.34 run damage @s[dx=0,dy=0,dz=0] 5 explosion + +kill @s diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/blazing/init_flare.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/blazing/init_flare.mcfunction new file mode 100644 index 0000000000..67824c990a --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/blazing/init_flare.mcfunction @@ -0,0 +1,13 @@ +# init flare block_display +# @s = flare block_display +# at @s +# run from mob/process/elite/blazing/process + +data merge entity @s {Tags:["gm4_mu_elite_flare"],teleport_duration:1,brightness:{sky:15,block:15},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.125f,-0.125f,-0.125f],scale:[0.25f,0.25f,0.25f]},block_state:{Name:"minecraft:magma_block"}} + +playsound minecraft:entity.blaze.shoot hostile @a ~ ~ ~ 1 1.2 + +tp @s ~ ~ ~ ~ ~ +scoreboard players set @s gm4_mu_data 0 + +execute unless score $keep_tick.elite_process_flare gm4_mu_keep_tick matches 1 run schedule function gm4_monsters_unbound:clocks/elite/blazing_flare 1t diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/blazing/process.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/blazing/process.mcfunction new file mode 100644 index 0000000000..6915844a73 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/blazing/process.mcfunction @@ -0,0 +1,14 @@ +# process blazing elite +# @s = blazing elite +# at @s +# run from mob/process/elite/check_type + +scoreboard players set $has_target gm4_mu_data 0 +execute on target if entity @s[type=player] run scoreboard players set $has_target gm4_mu_data 1 +execute if score $has_target gm4_mu_data matches 1 run scoreboard players add @s gm4_mu_timer 1 +execute if score $has_target gm4_mu_data matches 0 run scoreboard players set @s[scores={gm4_mu_timer=3..5}] gm4_mu_timer 6 +scoreboard players set @s[scores={gm4_mu_timer=10..}] gm4_mu_timer 0 + +execute if score @s gm4_mu_timer matches 3 anchored eyes positioned ^ ^-0.25 ^ on target facing entity @s eyes rotated ~ -75 summon block_display run function gm4_monsters_unbound:mob/process/elite/blazing/init_flare +execute if score @s[type=#gm4_survival_refightalized:zombie_types] gm4_mu_timer matches 4 anchored eyes positioned ^ ^-0.25 ^ on target facing entity @s eyes rotated ~90 -75 summon block_display run function gm4_monsters_unbound:mob/process/elite/blazing/init_flare +execute if score @s[type=#gm4_survival_refightalized:zombie_types] gm4_mu_timer matches 5 anchored eyes positioned ^ ^-0.25 ^ on target facing entity @s eyes rotated ~-90 -75 summon block_display run function gm4_monsters_unbound:mob/process/elite/blazing/init_flare diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/blazing/process_flare.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/blazing/process_flare.mcfunction new file mode 100644 index 0000000000..7b035101be --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/blazing/process_flare.mcfunction @@ -0,0 +1,29 @@ +# process the flare +# @s = flare block_display +# at @s +# run from clocks/elite/blazing_flare + +# particles +particle flame ^ ^ ^0.0125 0.12 0.12 0.12 0.015 2 + +# track towards closest player until nearby, then fly off +execute if score @s gm4_mu_data matches 0 positioned ^ ^ ^0.7 if entity @p[gamemode=!spectator,distance=..2] run scoreboard players set @s gm4_mu_data 1 +execute if score @s[scores={gm4_mu_data=0}] gm4_mu_timer matches ..60 facing entity @p[gamemode=!spectator] eyes positioned ^ ^ ^50 rotated as @s positioned ^ ^ ^500 facing entity @s eyes facing ^ ^ ^-1 positioned as @s run tp @s ~ ~ ~ ~ ~ +tp @s[scores={gm4_mu_timer=..10}] ^ ^ ^0.35 +tp @s[scores={gm4_mu_timer=11..60}] ^ ^ ^0.25 +tp @s[scores={gm4_mu_timer=61..70}] ^ ^ ^0.15 +tp @s[scores={gm4_mu_timer=71..}] ^ ^ ^0.05 + +scoreboard players set $flare_hit gm4_mu_data 0 +# hit players +execute positioned ~-.15 ~-.15 ~-.15 as @a[dx=0,dy=0,dz=0] positioned ~-0.55 ~-0.55 ~-0.55 if entity @s[dx=0,dy=0,dz=0] run scoreboard players set $flare_hit gm4_mu_data 1 +# hit terrain +execute unless block ~ ~ ~ #gm4:no_collision run scoreboard players set $flare_hit gm4_mu_data 1 +# timer ran out +scoreboard players add @s gm4_mu_timer 1 +execute if score @s gm4_mu_timer matches 80.. run scoreboard players set $flare_hit gm4_mu_data 1 +# explode when something is hit +execute if score $flare_hit gm4_mu_data matches 1 run return run function gm4_monsters_unbound:mob/process/elite/blazing/explode_flare + +# keep running +scoreboard players set $keep_tick.elite_process_flare gm4_mu_keep_tick 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/check_type.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/check_type.mcfunction new file mode 100644 index 0000000000..d269062297 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/check_type.mcfunction @@ -0,0 +1,12 @@ +# process elites +# @s = elite mob +# at @s +# run from main + +execute if entity @s[tag=gm4_mu_elite.mending] run function gm4_monsters_unbound:mob/process/elite/mending/process +execute if entity @s[tag=gm4_mu_elite.blazing] run function gm4_monsters_unbound:mob/process/elite/blazing/process +execute if entity @s[tag=gm4_mu_elite.zephyr] run function gm4_monsters_unbound:mob/process/elite/zephyr/process +execute if entity @s[tag=gm4_mu_elite.gargantuan] run function gm4_monsters_unbound:mob/process/elite/gargantuan/process +execute if entity @s[tag=gm4_mu_elite.pearlescent] run function gm4_monsters_unbound:mob/process/elite/pearlescent/process +execute if entity @s[tag=gm4_mu_elite.splitting] run function gm4_monsters_unbound:mob/process/elite/splitting/process +execute if entity @s[tag=gm4_mu_elite.volatile] run function gm4_monsters_unbound:mob/process/elite/volatile/process diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/activate.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/activate.mcfunction new file mode 100644 index 0000000000..f0ecaacd2d --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/activate.mcfunction @@ -0,0 +1,21 @@ +# activate gargantuan elite ground slam +# @s = gargantuan elite +# at @s +# run from mob/process/elite/check_type + +attribute @s minecraft:follow_range modifier remove gm4_monsters_unbound:elite_buff.giant.charging +attribute @s minecraft:movement_speed modifier remove gm4_monsters_unbound:elite_buff.giant.charging +playsound minecraft:entity.zombie.attack_wooden_door hostile @a ~ ~ ~ 1.25 0 + +execute store result storage gm4_monsters_unbound:temp deal.damage float 0.75 run attribute @s minecraft:attack_damage get + +tag @s add gm4_mu_self +execute as @a[distance=..7,gamemode=!spectator] run function gm4_monsters_unbound:mob/process/elite/gargantuan/player_hit with storage gm4_monsters_unbound:temp deal +tag @s remove gm4_mu_self + +data remove storage gm4_monsters_unbound:temp deal + +scoreboard players set $particle_ring gm4_mu_data 72 +execute rotated 0 0 run function gm4_monsters_unbound:mob/process/elite/gargantuan/particle_ring_big + +scoreboard players set @s gm4_mu_timer -6 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/eval_stats.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/eval_stats.mcfunction new file mode 100644 index 0000000000..cd0cf370e5 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/eval_stats.mcfunction @@ -0,0 +1,8 @@ +# set gargantuan elite stats +# @s = gargantuan elite +# at @s +# run from mob/process/elite/gargantuan/update_stats + +$attribute @s movement_speed modifier add gm4_monsters_unbound:elite_buff.giant.health_reduction_stats $(speed) add_multiplied_total +$attribute @s attack_damage modifier add gm4_monsters_unbound:elite_buff.giant.health_reduction_stats $(damage) add_multiplied_total +$attribute @s knockback_resistance modifier add gm4_monsters_unbound:elite_buff.giant.health_reduction_stats $(knockback_resistance) add_value diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/particle_ring.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/particle_ring.mcfunction new file mode 100644 index 0000000000..33db3ab60b --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/particle_ring.mcfunction @@ -0,0 +1,12 @@ +# show a particle ring for gargantuan elite ground slam +# @s = gargantuan elite +# at @s +# run from mob/process/elite/gargantuan/process +# run from here + +particle block{block_state:"chest"} ^ ^0.2 ^7 0.15 0.15 0.15 0.5 2 +particle block{block_state:"chest"} ^ ^0.4 ^7 0.15 0.15 0.15 0.5 2 +particle block{block_state:"chest"} ^ ^0.6 ^7 0.15 0.15 0.15 0.5 2 + +scoreboard players remove $particle_ring gm4_mu_data 1 +execute if score $particle_ring gm4_mu_data matches 1.. rotated ~5 ~ run function gm4_monsters_unbound:mob/process/elite/gargantuan/particle_ring diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/particle_ring_big.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/particle_ring_big.mcfunction new file mode 100644 index 0000000000..d56ceab7c0 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/particle_ring_big.mcfunction @@ -0,0 +1,14 @@ +# show a particle ring for gargantuan elite ground slam +# @s = gargantuan elite +# at @s +# run from mob/process/elite/activate +# run from run + +particle block{block_state:"chest"} ^ ^ ^7 0.225 0.225 0.225 1 5 +particle block{block_state:"chest"} ^ ^0.2 ^7 0.225 0.225 0.225 1 5 +particle block{block_state:"chest"} ^ ^0.4 ^7 0.225 0.225 0.225 1 5 +particle block{block_state:"chest"} ^ ^0.6 ^7 0.225 0.225 0.225 1 5 +particle block{block_state:"chest"} ^ ^0.8 ^7 0.225 0.225 0.225 1 5 + +scoreboard players remove $particle_ring gm4_mu_data 1 +execute if score $particle_ring gm4_mu_data matches 1.. rotated ~5 ~ run function gm4_monsters_unbound:mob/process/elite/gargantuan/particle_ring_big diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/player_hit.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/player_hit.mcfunction new file mode 100644 index 0000000000..30e42b805a --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/player_hit.mcfunction @@ -0,0 +1,10 @@ +# damage player from gargantuan ground slam +# @s = player that got hit +# at @s +# run from mob/process/elite/gargantuan/activate + +$damage @s $(damage) mob_attack by @e[type=#gm4_monsters_unbound:elite_types,tag=gm4_mu_self,limit=1,distance=..7] +effect give @s slowness 2 3 +effect give @s nausea 4 0 + +particle block{block_state:"chest"} ~ ~1.2 ~ 0.325 0.925 0.325 1 12 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/process.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/process.mcfunction new file mode 100644 index 0000000000..437b130084 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/process.mcfunction @@ -0,0 +1,30 @@ +# process gargantuan elite +# @s = gargantuan elite +# at @s +# run from mob/process/elite/check_type + +# check health +execute store result score $curr_health gm4_mu_data run data get entity @s Health 1000 +execute unless score $curr_health gm4_mu_data = @s gm4_mu_data run function gm4_monsters_unbound:mob/process/elite/gargantuan/update_stats + +# no nearby players +execute unless score @s gm4_mu_timer matches 1.. unless entity @a[gamemode=!spectator,distance=..7] run return 0 +# otherwise 40% chance to start attack (60% to return and not use it) +execute unless score @s gm4_mu_timer matches 1.. if entity @a[gamemode=!spectator,distance=..7] if predicate {condition:"minecraft:random_chance",chance:0.6} run return 0 + +scoreboard players add @s gm4_mu_timer 1 +scoreboard players set @s[scores={gm4_mu_timer=20..}] gm4_mu_timer 0 + +scoreboard players set $particle_ring gm4_mu_data 72 +execute if score @s gm4_mu_timer matches 2..4 rotated 0 0 run function gm4_monsters_unbound:mob/process/elite/gargantuan/particle_ring + +attribute @s[scores={gm4_mu_timer=1}] minecraft:movement_speed modifier add gm4_monsters_unbound:elite_buff.giant.charging -1 add_multiplied_total +attribute @s[scores={gm4_mu_timer=1}] minecraft:follow_range modifier add gm4_monsters_unbound:elite_buff.giant.charging -1 add_multiplied_total + +execute if score @s gm4_mu_timer matches 2 run playsound minecraft:entity.zombie.attack_wooden_door hostile @a ~ ~ ~ 1 1.2 +execute if score @s gm4_mu_timer matches 3 run playsound minecraft:entity.zombie.attack_wooden_door hostile @a ~ ~ ~ 1 1.4 +execute if score @s gm4_mu_timer matches 4 run playsound minecraft:entity.zombie.attack_wooden_door hostile @a ~ ~ ~ 1 1.7 + +data modify entity @s[scores={gm4_mu_timer=4}] Motion set value [0d,0.5d,0d] + +execute if score @s gm4_mu_timer matches 5 run function gm4_monsters_unbound:mob/process/elite/gargantuan/activate diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/update_stats.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/update_stats.mcfunction new file mode 100644 index 0000000000..6a343dffd3 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/gargantuan/update_stats.mcfunction @@ -0,0 +1,26 @@ +# update gargantuan elite stats +# @s = gargantuan elite +# at @s +# run from mob/process/elite/gargantuan/process + +scoreboard players operation @s gm4_mu_data = $curr_health gm4_mu_data +attribute @s minecraft:movement_speed modifier remove gm4_monsters_unbound:elite_buff.giant.health_reduction_stats +attribute @s minecraft:attack_damage modifier remove gm4_monsters_unbound:elite_buff.giant.health_reduction_stats +attribute @s minecraft:knockback_resistance modifier remove gm4_monsters_unbound:elite_buff.giant.health_reduction_stats + +execute store result score $max_health gm4_mu_data run attribute @s minecraft:max_health get 10 +scoreboard players operation $curr_health gm4_mu_data /= $max_health gm4_mu_data +scoreboard players set $curr_health_percent_lost gm4_mu_data 100 +scoreboard players operation $curr_health_percent_lost gm4_mu_data -= $curr_health gm4_mu_data + +execute if score $curr_health_percent_lost gm4_mu_data matches 50.. run effect give @s[type=!#gm4_survival_refightalized:skeleton_types] minecraft:resistance infinite 0 true +execute if score $curr_health_percent_lost gm4_mu_data matches 75.. run effect give @s[type=!#gm4_survival_refightalized:skeleton_types] minecraft:resistance infinite 1 true + +execute if score $curr_health_percent_lost gm4_mu_data matches 50.. run scoreboard players set @s[type=#gm4_survival_refightalized:skeleton_types] gm4_sr_arrow.fire_delay 4 +execute if score $curr_health_percent_lost gm4_mu_data matches 75.. run scoreboard players set @s[type=#gm4_survival_refightalized:skeleton_types] gm4_sr_arrow.fire_delay 6 + +execute store result storage gm4_monsters_unbound:temp set.speed float 0.015 run scoreboard players get $curr_health_percent_lost gm4_mu_data +execute store result storage gm4_monsters_unbound:temp set.damage float 0.005 run scoreboard players get $curr_health_percent_lost gm4_mu_data +execute store result storage gm4_monsters_unbound:temp set.knockback_resistance float 0.0015 run scoreboard players add $curr_health_percent_lost gm4_mu_data 567 +function gm4_monsters_unbound:mob/process/elite/gargantuan/eval_stats with storage gm4_monsters_unbound:temp set +data remove storage gm4_monsters_unbound:temp set diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/death.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/death.mcfunction new file mode 100644 index 0000000000..05cbd81089 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/death.mcfunction @@ -0,0 +1,7 @@ +# run on glacial elite death +# @s = glacial elite +# at @s +# run from mob/process/elite/on_death/run + +summon marker ~ ~-1 ~ {Tags:["gm4_mu_elite_death_marker","gm4_mu_elite.glacial_processing"]} +execute unless score $keep_tick.elite_glacial_death gm4_mu_keep_tick matches 1 run schedule function gm4_monsters_unbound:clocks/elite/glacial_death 1t diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/explode.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/explode.mcfunction new file mode 100644 index 0000000000..9aff6f8845 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/explode.mcfunction @@ -0,0 +1,11 @@ +# explode the glacial bomb +# @s = glacial elite death marker +# at @s +# run from mob/process/elite/glacial/process_explosion + +scoreboard players set $freeze_seconds gm4_mu_data 3 +execute as @e[distance=..4.81,type=!#gm4:non_living,tag=!smithed.entity,tag=!smithed.strict] run function gm4_monsters_unbound:effect/freeze/apply +execute as @a[gamemode=!spectator,distance=..12] facing entity @s eyes positioned ^ ^ ^4.5 positioned ~-.05 ~-.05 ~-.05 if entity @s[dx=0,dy=0,dz=0] positioned ~-0.9 ~-0.9 ~-0.9 if entity @s[dx=0,dy=0,dz=0] run function gm4_monsters_unbound:effect/freeze/apply +playsound block.glass.break hostile @a[distance=..4.81] ~ ~ ~ 1 0.8 + +kill @s diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/process_explosion.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/process_explosion.mcfunction new file mode 100644 index 0000000000..39692cb8d3 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/process_explosion.mcfunction @@ -0,0 +1,20 @@ +# process the glacial bomb +# @s = glacial elite death marker +# at @s +# run from clocks/elite/glacial_death + +# before show warning +particle dust{color:[0.725,0.910,0.918],scale:3} ~ ~ ~ 0.04 0.04 0.04 0 4 normal +particle snowflake ~ ~ ~ 1.75 1.75 1.75 0 7 normal +scoreboard players set $frost_ring_yaw gm4_mu_data 0 +execute if score @s gm4_mu_data matches ..360 rotated 0 80 run function gm4_monsters_unbound:mob/process/elite/glacial/warning_yaw_loop + +# explode after 2 seconds +scoreboard players add @s gm4_mu_data 20 + +playsound minecraft:block.snow.break hostile @a[distance=..4.81] ~ ~ ~ 1.55 1.2 +playsound minecraft:block.snow.fall hostile @a[distance=..4.81] ~ ~ ~ 2 0.75 +playsound minecraft:block.snow.fall hostile @a[distance=4.81..16] ~ ~ ~ 1 0.6 + +execute if score @s gm4_mu_data matches 400.. run return run function gm4_monsters_unbound:mob/process/elite/glacial/explode +scoreboard players set $keep_tick.elite_glacial_death gm4_mu_keep_tick 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/warning_pitch_loop_big.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/warning_pitch_loop_big.mcfunction new file mode 100644 index 0000000000..8c2994eda7 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/warning_pitch_loop_big.mcfunction @@ -0,0 +1,9 @@ +# show warning particles +# @s = glacial elite death marker +# at @s +# run from mob/process/elite/glacial/warning_yaw_loop +# run from here + +particle dust{color:[0.725,0.910,0.918],scale:2} ^ ^ ^4.8 0.02 0.02 0.02 0 1 normal +scoreboard players remove $frost_ring_pitch gm4_mu_data 5 +execute if score $frost_ring_pitch gm4_mu_data matches -85.. rotated ~5 ~-5 run function gm4_monsters_unbound:mob/process/elite/glacial/warning_pitch_loop_big diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/warning_pitch_loop_small.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/warning_pitch_loop_small.mcfunction new file mode 100644 index 0000000000..db59de0c89 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/warning_pitch_loop_small.mcfunction @@ -0,0 +1,9 @@ +# show warning particles +# @s = glacial elite death marker +# at @s +# run from mob/process/elite/glacial/warning_yaw_loop +# run from here + +execute if predicate {condition:"minecraft:random_chance",chance:0.15} run particle snowflake ^ ^ ^4.8 0.005 0.005 0.005 0 1 normal +scoreboard players remove $frost_ring_pitch gm4_mu_data 5 +execute if score $frost_ring_pitch gm4_mu_data matches -85.. rotated ~5 ~-5 run function gm4_monsters_unbound:mob/process/elite/glacial/warning_pitch_loop_small diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/warning_yaw_loop.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/warning_yaw_loop.mcfunction new file mode 100644 index 0000000000..14d30955d7 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/glacial/warning_yaw_loop.mcfunction @@ -0,0 +1,12 @@ +# show warning particles +# @s = glacial elite death marker +# at @s +# run from mob/process/elite/glacial/process_explosion +# run from here + +scoreboard players set $frost_ring_pitch gm4_mu_data 80 +execute if score $frost_ring_yaw gm4_mu_data < @s gm4_mu_data run function gm4_monsters_unbound:mob/process/elite/glacial/warning_pitch_loop_big +execute unless score $frost_ring_yaw gm4_mu_data < @s gm4_mu_data run function gm4_monsters_unbound:mob/process/elite/glacial/warning_pitch_loop_small + +scoreboard players add $frost_ring_yaw gm4_mu_data 10 +execute if score $frost_ring_yaw gm4_mu_data matches ..360 rotated ~10 ~ run function gm4_monsters_unbound:mob/process/elite/glacial/warning_yaw_loop diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/mending/check_los_raycast.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/mending/check_los_raycast.mcfunction new file mode 100644 index 0000000000..55e49c314d --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/mending/check_los_raycast.mcfunction @@ -0,0 +1,17 @@ +# check LOS to this undead +# @s = undead near mending elite +# at @s +# run from mob/process/elite/mending/process +# run from here + +execute if score $target_healed gm4_mu_data matches 1.. run return 0 + +tag @s remove gm4_mu_target + +scoreboard players add $raycast_travel_distance gm4_mu_data 3 + +execute positioned ~-.05 ~-.05 ~-.05 if entity @s[dx=0,dy=0,dz=0] positioned ~-0.9 ~-0.9 ~-0.9 if entity @s[dx=0,dy=0,dz=0] at @s anchored eyes positioned ^ ^ ^ run function gm4_monsters_unbound:mob/process/elite/mending/trigger +execute if score $target_healed gm4_mu_data matches 1.. run return run function gm4_monsters_unbound:mob/process/elite/mending/particle_raycast + +execute unless score $raycast_travel_distance gm4_mu_data matches ..300 run return run scoreboard players reset $raycast_travel_distance gm4_mu_data +execute positioned ^ ^ ^.3 if block ~ ~ ~ #gm4:no_collision run function gm4_monsters_unbound:mob/process/elite/mending/check_los_raycast diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/mending/check_target.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/mending/check_target.mcfunction new file mode 100644 index 0000000000..54dab0688e --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/mending/check_target.mcfunction @@ -0,0 +1,10 @@ +# check if this entity is a valid target to be healed +# @s = undead near mending elite +# at @s +# run from mob/process/elite/mending/process + +execute store result score $curr_health gm4_mu_data run data get entity @s Health 10 +execute store result score $max_health gm4_mu_data run attribute @s minecraft:max_health get 10 +# remove a slight amount from max_health to fix floating point errors +scoreboard players remove $max_health gm4_mu_data 2 +execute if score $curr_health gm4_mu_data < $max_health gm4_mu_data run tag @s add gm4_mu_target diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/mending/particle_raycast.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/mending/particle_raycast.mcfunction new file mode 100644 index 0000000000..2a3b5f3a81 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/mending/particle_raycast.mcfunction @@ -0,0 +1,13 @@ +# check LOS to this undead +# @s = undead near mending elite +# at @s +# run from mob/process/elite/mending/process +# run from here + +scoreboard players remove $raycast_travel_distance gm4_mu_data 1 + +particle dust_color_transition{from_color:[0.000,1.000,0.000],scale:0.65,to_color:[0.000,0.000,0.000]} ~ ~ ~ 0.1 0.1 0.1 0 0 + +execute unless score $raycast_travel_distance gm4_mu_data matches 1.. run particle dust_color_transition{from_color:[0.000,1.000,0.000],scale:0.85,to_color:[0.000,0.000,0.000]} ~ ~ ~ 0.22 0.22 0.22 0.5 12 + +execute if score $raycast_travel_distance gm4_mu_data matches 1.. positioned ^ ^ ^-.1 run function gm4_monsters_unbound:mob/process/elite/mending/particle_raycast diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/mending/process.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/mending/process.mcfunction new file mode 100644 index 0000000000..b97ec47608 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/mending/process.mcfunction @@ -0,0 +1,11 @@ +# process mending elite +# @s = mending elite +# at @s +# run from mob/process/elite/check_type + +execute as @e[type=#minecraft:undead,tag=!gm4_mu_elite.mending,distance=..30,limit=12,sort=random] run function gm4_monsters_unbound:mob/process/elite/mending/check_target + +tag @s add gm4_mu_self +scoreboard players set $target_healed gm4_mu_data 0 +execute at @s anchored eyes positioned ^ ^0.4375 ^ as @e[type=#minecraft:undead,tag=gm4_mu_target,distance=..30,sort=random] facing entity @s eyes run function gm4_monsters_unbound:mob/process/elite/mending/check_los_raycast +tag @s remove gm4_mu_self diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/mending/trigger.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/mending/trigger.mcfunction new file mode 100644 index 0000000000..81d1675053 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/mending/trigger.mcfunction @@ -0,0 +1,12 @@ +# heal this undead +# @s = undead near mending elite +# at @s +# run from mob/process/elite/mending/check_los_raycast + +scoreboard players set $target_healed gm4_mu_data 1 + +effect give @s instant_damage 1 2 false +effect give @s resistance 1 1 false +particle heart ^ ^ ^ 0.2 0.2 0.2 0.05 1 + +playsound minecraft:item.bottle.fill hostile @a ~ ~ ~ 0.7 2 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/on_death/run.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/on_death/run.mcfunction new file mode 100644 index 0000000000..ad481af2d2 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/on_death/run.mcfunction @@ -0,0 +1,13 @@ +# check which elite has died +# @s = item dropped from killed elite +# at @s +# run from check_item + +execute store result score $elite_type gm4_mu_data run data get entity @s Item.components."minecraft:custom_data".gm4_mu_elite_on_death.id +execute if score $elite_type gm4_mu_data matches 1 run function gm4_monsters_unbound:mob/process/elite/glacial/death +execute if score $elite_type gm4_mu_data matches 2 positioned ~ ~1.75 ~ summon item_display run function gm4_monsters_unbound:mob/process/elite/vorpal/init_fear_cloud +execute if score $elite_type gm4_mu_data matches 3 positioned ~ ~0.25 ~ run function gm4_monsters_unbound:mob/process/elite/splitting/zombie +execute if score $elite_type gm4_mu_data matches 4 positioned ~ ~0.25 ~ run function gm4_monsters_unbound:mob/process/elite/splitting/skeleton +execute if score $elite_type gm4_mu_data matches 5 run function gm4_monsters_unbound:mob/process/elite/volatile/death + +kill @s diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/on_hit/check_mob.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/on_hit/check_mob.mcfunction new file mode 100644 index 0000000000..301b173396 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/on_hit/check_mob.mcfunction @@ -0,0 +1,7 @@ +# process elite that got hit +# @s = elite that got hit +# at @s +# run from mob/process/elite/on_hit/run + +execute if entity @s[tag=gm4_mu_elite.vorpal] if predicate {condition:"minecraft:random_chance",chance:0.65} run function gm4_monsters_unbound:mob/process/elite/vorpal/warp/run +execute if entity @s[tag=gm4_mu_elite.zephyr] run function gm4_monsters_unbound:mob/process/elite/zephyr/hit_when_charging diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/on_hit/run.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/on_hit/run.mcfunction new file mode 100644 index 0000000000..a349877f35 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/on_hit/run.mcfunction @@ -0,0 +1,6 @@ +# process elites being hit +# @s = player that hit an elite +# at @s +advancement revoke @s only gm4_monsters_unbound:elite/on_hit + +execute as @e[type=#gm4_monsters_unbound:elite_types,tag=gm4_mu_elite.on_hit,nbt={HurtTime:10s},limit=1,sort=nearest] at @s run function gm4_monsters_unbound:mob/process/elite/on_hit/check_mob diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/pearlescent/get_facing.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/pearlescent/get_facing.mcfunction new file mode 100644 index 0000000000..aa6c84c13a --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/pearlescent/get_facing.mcfunction @@ -0,0 +1,4 @@ + +tp @s ~ ~ ~ facing entity @p[tag=gm4_mu_target] eyes +data modify storage gm4_monsters_unbound:temp Rotation set from entity @s Rotation +kill @s diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/pearlescent/lazer.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/pearlescent/lazer.mcfunction new file mode 100644 index 0000000000..28a9a8f30d --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/pearlescent/lazer.mcfunction @@ -0,0 +1,21 @@ +# shoot lazer +# @s = pearlescent elite +# at @s +# run from mob/process/elite/pearlescent/process + +playsound block.campfire.crackle hostile @a ~ ~ ~ 0.5 0.8 +particle flash ~ ~1.8 ~ + +execute on target run tag @s[type=player] add gm4_mu_target +execute unless entity @p[tag=gm4_mu_target] run return 0 +tag @s add gm4_mu_self + +scoreboard players set $lazer_limit gm4_mu_data 150 + +execute anchored eyes positioned ^ ^ ^0.2 summon marker run function gm4_monsters_unbound:mob/process/elite/pearlescent/get_facing +data modify entity @s Rotation set from storage gm4_monsters_unbound:temp Rotation +data remove storage gm4_monsters_unbound:temp Rotation +execute at @s anchored eyes positioned ^ ^ ^0.2 run function gm4_monsters_unbound:mob/process/elite/pearlescent/lazer_raycast + +execute on target run tag @s remove gm4_mu_target +tag @s remove gm4_mu_self diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/pearlescent/lazer_damage.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/pearlescent/lazer_damage.mcfunction new file mode 100644 index 0000000000..11924e74bf --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/pearlescent/lazer_damage.mcfunction @@ -0,0 +1,8 @@ +# deal damage to hit player +# @s = player hit by lazer +# at @s +# run from mob/process/elite/pearlescent/lazer_raycast + +damage @s 1 in_fire by @n[type=#gm4_monsters_unbound:elite_types,tag=gm4_mu_self] +scoreboard players set $attack_hit gm4_mu_data 1 +scoreboard players set $lazer_limit gm4_mu_data 0 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/pearlescent/lazer_raycast.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/pearlescent/lazer_raycast.mcfunction new file mode 100644 index 0000000000..aea39e8ebf --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/pearlescent/lazer_raycast.mcfunction @@ -0,0 +1,16 @@ +# raycast to target player +# @s = pearlescent elite +# at @s +# run from mob/process/elite/pearlescent/lazer +# run from here + +particle dust_color_transition{from_color:[0.400,0.325,0.450],to_color:[0.800,0.650,0.900],scale:1.25} ^0.125 ^ ^ 0.01 0.01 0.01 0 1 +particle dust_color_transition{from_color:[0.400,0.325,0.450],to_color:[0.800,0.650,0.900],scale:1.25} ^-0.125 ^ ^ 0.01 0.01 0.01 0 1 + +particle dust_color_transition{from_color:[0.400,0.325,0.450],to_color:[0.800,0.650,0.900],scale:1.25} ^0.125 ^ ^0.1 0.01 0.01 0.01 0 1 +particle dust_color_transition{from_color:[0.400,0.325,0.450],to_color:[0.800,0.650,0.900],scale:1.25} ^-0.125 ^ ^0.1 0.01 0.01 0.01 0 1 + +execute positioned ~-0.1 ~-0.1 ~-0.1 as @a[gamemode=!spectator,dx=0,dy=0,dz=0] positioned ~-0.8 ~-0.8 ~-0.8 if entity @s[dx=0,dy=0,dz=0] run function gm4_monsters_unbound:mob/process/elite/pearlescent/lazer_damage + +scoreboard players remove $lazer_limit gm4_mu_data 1 +execute if score $lazer_limit gm4_mu_data matches 1.. positioned ^ ^ ^0.2 if block ~ ~ ~ #gm4:no_collision run function gm4_monsters_unbound:mob/process/elite/pearlescent/lazer_raycast diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/pearlescent/process.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/pearlescent/process.mcfunction new file mode 100644 index 0000000000..4491db032a --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/pearlescent/process.mcfunction @@ -0,0 +1,27 @@ +# process pearlescent elite +# @s = pearlescent elite +# at @s +# run from mob/process/elite/check_type + +# 33% chance to start attack if mob has a target +scoreboard players set $attack gm4_mu_data 0 +execute if score @s gm4_mu_timer matches 1.. run scoreboard players set $attack gm4_mu_data 1 +execute unless score $attack gm4_mu_data matches 1 on target if entity @s[type=player] if predicate {condition:"minecraft:random_chance",chance:0.33} run scoreboard players set $attack gm4_mu_data 1 +execute if score $attack gm4_mu_data matches 0 run return 0 + +scoreboard players add @s gm4_mu_timer 1 +scoreboard players set @s[scores={gm4_mu_timer=300..}] gm4_mu_timer 0 + +execute if score @s gm4_mu_timer matches 1 run playsound block.beacon.activate hostile @a ~ ~ ~ 1 0.7 +execute if score @s gm4_mu_timer matches 101..110 run playsound block.beacon.deactivate hostile @a ~ ~ ~ 1 0.7 + +attribute @s[scores={gm4_mu_timer=1}] minecraft:movement_speed modifier add gm4_monsters_unbound:elite_buff.pearlescent.charging -0.75 add_multiplied_total +attribute @s[scores={gm4_mu_timer=5}] minecraft:movement_speed modifier remove gm4_monsters_unbound:elite_buff.pearlescent.charging +attribute @s[scores={gm4_mu_timer=5}] minecraft:movement_speed modifier add gm4_monsters_unbound:elite_buff.pearlescent.firing -0.33 add_multiplied_total +attribute @s[scores={gm4_mu_timer=101..110}] minecraft:movement_speed modifier remove gm4_monsters_unbound:elite_buff.pearlescent.firing + +execute if score @s gm4_mu_timer matches ..100 run particle block{block_state:"pearlescent_froglight"} ~ ~2 ~ 0.3 0.3 0.3 0.5 8 + +scoreboard players set $attack_hit gm4_mu_data 0 +execute if score @s gm4_mu_timer matches 5..100 run function gm4_monsters_unbound:mob/process/elite/pearlescent/lazer +execute if score @s gm4_mu_timer matches 10.. if score $attack_hit gm4_mu_data matches 0 run scoreboard players add @s gm4_mu_timer 10 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/splitting/init_entity.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/splitting/init_entity.mcfunction new file mode 100644 index 0000000000..58706b0c91 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/splitting/init_entity.mcfunction @@ -0,0 +1,35 @@ +# init split entity +# @s = split entity +# at @s +# run from mob/process/elite/splitting/skeleton +# run from mob/process/elite/splitting/zombie + +attribute @s minecraft:attack_damage modifier add gm4_monsters_unbound:split_entity -0.5 add_multiplied_total +attribute @s minecraft:gravity modifier add gm4_monsters_unbound:split_entity -0.5 add_multiplied_total +attribute @s minecraft:jump_strength modifier add gm4_monsters_unbound:split_entity -0.5 add_multiplied_total +attribute @s minecraft:knockback_resistance modifier add gm4_monsters_unbound:split_entity -0.5 add_multiplied_total +attribute @s minecraft:max_health modifier add gm4_monsters_unbound:split_entity -0.5 add_multiplied_total +attribute @s minecraft:scale modifier add gm4_monsters_unbound:split_entity -0.5 add_multiplied_total +attribute @s minecraft:step_height modifier add gm4_monsters_unbound:split_entity -0.5 add_multiplied_total +attribute @s minecraft:movement_speed modifier add gm4_monsters_unbound:split_entity 0.33 add_multiplied_total +attribute @s[type=#gm4_survival_refightalized:skeleton_types] minecraft:follow_range modifier add gm4_monsters_unbound:split_entity -0.66 add_multiplied_total + +scoreboard players set @s gm4_sr_arrow.fire_delay 6 +scoreboard players set @s gm4_sr_arrow.damage_change -14 + +data modify entity @s CustomName set from storage gm4_monsters_unbound:temp CustomName + +execute store result entity @s Motion[0] double 0.01 run random value -30..30 +execute store result entity @s Motion[1] double 0.01 run random value 20..60 +execute store result entity @s Motion[2] double 0.01 run random value -30..30 + +tag @s add gm4_mu_elite.split_entity +tag @s add gm4_mu_split_entity +execute if dimension minecraft:overworld run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld +execute unless dimension minecraft:overworld run function gm4_survival_refightalized:mob/init/calc_difficulty_else + +item replace entity @s armor.head with spawner +data modify entity @s ArmorDropChances[3] set value -327.670F + +team join gm4_mu_elite.split +execute if score $has_bow gm4_mu_data matches 0 run item replace entity @s[type=#gm4_survival_refightalized:skeleton_types] weapon.mainhand with wooden_sword diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/splitting/process.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/splitting/process.mcfunction new file mode 100644 index 0000000000..2716b184b9 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/splitting/process.mcfunction @@ -0,0 +1,2 @@ + +data modify entity @s ArmorItems[3].components."minecraft:custom_name" set from entity @s CustomName diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/splitting/skeleton.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/splitting/skeleton.mcfunction new file mode 100644 index 0000000000..8ba096aa66 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/splitting/skeleton.mcfunction @@ -0,0 +1,20 @@ +# split splitting elite on death +# @s = item +# at @s +# run from mob/process/elite/on_death/run + +data modify storage gm4_monsters_unbound:temp CustomName set from entity @s Item.components."minecraft:custom_name" + +# only 2-3 of the spawned skeletons will have bows, the rest will be melee with wooden swords +scoreboard players set $has_bow gm4_mu_data 1 +execute summon skeleton run function gm4_monsters_unbound:mob/process/elite/splitting/init_entity +execute summon skeleton run function gm4_monsters_unbound:mob/process/elite/splitting/init_entity +execute store result score $has_bow gm4_mu_data run random value 0..1 +execute summon skeleton run function gm4_monsters_unbound:mob/process/elite/splitting/init_entity +scoreboard players set $has_bow gm4_mu_data 0 +execute summon skeleton run function gm4_monsters_unbound:mob/process/elite/splitting/init_entity +execute summon skeleton run function gm4_monsters_unbound:mob/process/elite/splitting/init_entity +execute summon skeleton run function gm4_monsters_unbound:mob/process/elite/splitting/init_entity + +data remove storage gm4_monsters_unbound:temp CustomName + diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/splitting/zombie.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/splitting/zombie.mcfunction new file mode 100644 index 0000000000..e14037d294 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/splitting/zombie.mcfunction @@ -0,0 +1,15 @@ +# split splitting elite on death +# @s = item +# at @s +# run from mob/process/elite/on_death/run + +data modify storage gm4_monsters_unbound:temp CustomName set from entity @s Item.components."minecraft:custom_name" + +execute summon zombie run function gm4_monsters_unbound:mob/process/elite/splitting/init_entity +execute summon zombie run function gm4_monsters_unbound:mob/process/elite/splitting/init_entity +execute summon zombie run function gm4_monsters_unbound:mob/process/elite/splitting/init_entity +execute summon zombie run function gm4_monsters_unbound:mob/process/elite/splitting/init_entity +execute summon zombie run function gm4_monsters_unbound:mob/process/elite/splitting/init_entity +execute summon zombie run function gm4_monsters_unbound:mob/process/elite/splitting/init_entity + +data remove storage gm4_monsters_unbound:temp CustomName diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/death.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/death.mcfunction new file mode 100644 index 0000000000..24e877ffe4 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/death.mcfunction @@ -0,0 +1,9 @@ +# spawn many volatile pillars on death +# @s = item +# at @s +# run from mob/process/elite/on_death/run + +execute positioned ~ ~ ~3 summon marker run function gm4_monsters_unbound:mob/process/elite/volatile/pillar_location +execute positioned ~ ~ ~-3 summon marker run function gm4_monsters_unbound:mob/process/elite/volatile/pillar_location +execute positioned ~3 ~ ~ summon marker run function gm4_monsters_unbound:mob/process/elite/volatile/pillar_location +execute positioned ~-3 ~ ~ summon marker run function gm4_monsters_unbound:mob/process/elite/volatile/pillar_location diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/pillar_damage.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/pillar_damage.mcfunction new file mode 100644 index 0000000000..61e449f91c --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/pillar_damage.mcfunction @@ -0,0 +1,8 @@ +# damage from volatile pillar +# @s = player that was hit +# at @s +# run from mob/process/elite/volatile/pillar_explode + +damage @s 9 explosion +effect give @s slowness 2 2 +effect give @s nausea 4 0 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/pillar_explode.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/pillar_explode.mcfunction new file mode 100644 index 0000000000..c5772e381a --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/pillar_explode.mcfunction @@ -0,0 +1,14 @@ +# explode volatile pillar +# @s = pillar marker +# at @s +# run from mob/process/elite/volatile/pillar_process + +execute if score @s gm4_mu_data matches 2 as @a[gamemode=!spectator,distance=..2.25] run function gm4_monsters_unbound:mob/process/elite/volatile/pillar_damage +execute if score @s gm4_mu_data matches 3 as @a[gamemode=!spectator,distance=..2.5] run function gm4_monsters_unbound:mob/process/elite/volatile/pillar_damage +execute if score @s gm4_mu_data matches 4 as @a[gamemode=!spectator,distance=..2.75] run function gm4_monsters_unbound:mob/process/elite/volatile/pillar_damage +execute if score @s gm4_mu_data matches 5 as @a[gamemode=!spectator,distance=..3] run function gm4_monsters_unbound:mob/process/elite/volatile/pillar_damage +kill @s +particle minecraft:dragon_breath ~ ~ ~ 0.2 0.2 0.2 0.33 64 +particle minecraft:dragon_breath ~ ~0.25 ~ 0.5 0.5 0.5 0 32 +particle minecraft:dragon_breath ~ ~5 ~ 0.2 8 0.2 1 32 +playsound entity.dragon_fireball.explode hostile @a[distance=..32] ~ ~ ~ 1 0.9 0.5 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/pillar_location.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/pillar_location.mcfunction new file mode 100644 index 0000000000..6d63ebe22c --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/pillar_location.mcfunction @@ -0,0 +1,39 @@ +# get a location for volatile pillar +# @s = pillar marker +# at @s +# run from mob/process/elite/volatile/process + +tag @s add gm4_mu_elite.volatile_pillar +execute store result score @s gm4_mu_timer run random value 0..14 +execute store result score @s gm4_mu_data run random value 2..5 +scoreboard players operation @s gm4_mu_timer -= @s gm4_mu_data +scoreboard players operation @s gm4_mu_timer -= @s gm4_mu_data + +execute store result score $randomX gm4_mu_data run random value 0..12 +execute store result score $randomZ gm4_mu_data run random value 0..12 +tp @s ~-6 ~ ~-6 + +execute at @s if score $randomX gm4_mu_data matches 8.. run tp @s ~8 ~ ~ +execute if score $randomX gm4_mu_data matches 8.. run scoreboard players remove $randomX gm4_mu_data 8 +execute at @s if score $randomX gm4_mu_data matches 4.. run tp @s ~4 ~ ~ +execute if score $randomX gm4_mu_data matches 4.. run scoreboard players remove $randomX gm4_mu_data 4 +execute at @s if score $randomX gm4_mu_data matches 2.. run tp @s ~2 ~ ~ +execute if score $randomX gm4_mu_data matches 2.. run scoreboard players remove $randomX gm4_mu_data 2 +execute at @s if score $randomX gm4_mu_data matches 1.. run tp @s ~1 ~ ~ +execute if score $randomX gm4_mu_data matches 1.. run scoreboard players remove $randomX gm4_mu_data 1 + +execute at @s if score $randomZ gm4_mu_data matches 8.. run tp @s ~ ~ ~8 +execute if score $randomZ gm4_mu_data matches 8.. run scoreboard players remove $randomZ gm4_mu_data 8 +execute at @s if score $randomZ gm4_mu_data matches 4.. run tp @s ~ ~ ~4 +execute if score $randomZ gm4_mu_data matches 4.. run scoreboard players remove $randomZ gm4_mu_data 4 +execute at @s if score $randomZ gm4_mu_data matches 2.. run tp @s ~ ~ ~2 +execute if score $randomZ gm4_mu_data matches 2.. run scoreboard players remove $randomZ gm4_mu_data 2 +execute at @s if score $randomZ gm4_mu_data matches 1.. run tp @s ~ ~ ~1 +execute if score $randomZ gm4_mu_data matches 1.. run scoreboard players remove $randomZ gm4_mu_data 1 + +scoreboard players set $move_y_limit gm4_mu_data 12 +execute at @s store result score $location_found gm4_mu_data run function gm4_monsters_unbound:mob/process/elite/volatile/pillar_location_y +execute if score $location_found gm4_mu_data matches 0 run return run kill @s + +execute unless score $keep_tick.elite_pillar_volatile gm4_mu_keep_tick matches 1 run schedule function gm4_monsters_unbound:clocks/elite/volatile_pillar 1t +execute at @s run playsound minecraft:entity.ender_dragon.shoot hostile @a ~ ~ ~ 1 0.5 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/pillar_location_y.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/pillar_location_y.mcfunction new file mode 100644 index 0000000000..81d674ffd3 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/pillar_location_y.mcfunction @@ -0,0 +1,12 @@ +# get a location for volatile pillar +# @s = pillar marker +# at @s +# run from mob/process/elite/volatile/pillar_location +# run from here + +execute if block ~ ~ ~ #gm4:no_collision unless block ~ ~-1 ~ #gm4:no_collision align y run return run tp @s ~ ~ ~ + +scoreboard players remove $move_y_limit gm4_mu_data 1 +execute if score $move_y_limit gm4_mu_data matches 0 run return 0 +execute if block ~ ~ ~ #gm4:no_collision positioned ~ ~-1 ~ run return run function gm4_monsters_unbound:mob/process/elite/volatile/pillar_location_y +execute positioned ~ ~1 ~ run return run function gm4_monsters_unbound:mob/process/elite/volatile/pillar_location_y diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/pillar_particle_ring.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/pillar_particle_ring.mcfunction new file mode 100644 index 0000000000..c2a8d9508f --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/pillar_particle_ring.mcfunction @@ -0,0 +1,10 @@ + +execute if score @s gm4_mu_data matches 2 run particle dust_color_transition{from_color:[0.667,0.000,0.667],scale:1,to_color:[0.000,0.000,0.000]} ^ ^ ^2.25 0 0 0 1 0 normal +execute if score @s gm4_mu_data matches 3 run particle dust_color_transition{from_color:[0.667,0.000,0.667],scale:1,to_color:[0.000,0.000,0.000]} ^ ^ ^2.5 0 0 0 1 0 normal +execute if score @s gm4_mu_data matches 4 run particle dust_color_transition{from_color:[0.667,0.000,0.667],scale:1,to_color:[0.000,0.000,0.000]} ^ ^ ^2.75 0 0 0 1 0 normal +execute if score @s gm4_mu_data matches 5 run particle dust_color_transition{from_color:[0.667,0.000,0.667],scale:1,to_color:[0.000,0.000,0.000]} ^ ^ ^3 0 0 0 1 0 normal + + +scoreboard players remove $particle_ring gm4_mu_data 6 + +execute if score $particle_ring gm4_mu_data matches 1.. rotated ~6 ~ run function gm4_monsters_unbound:mob/process/elite/volatile/pillar_particle_ring diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/pillar_process.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/pillar_process.mcfunction new file mode 100644 index 0000000000..671d66ebec --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/pillar_process.mcfunction @@ -0,0 +1,16 @@ +# process volatile pillar +# @s = pillar marker +# at @s +# run from clocks/elite/volatile_pillar + +particle block{block_state:"purple_glazed_terracotta"} ~ ~5 ~ 0.2 8 0.2 1 32 + +scoreboard players set $particle_ring gm4_mu_data 360 +function gm4_monsters_unbound:mob/process/elite/volatile/pillar_particle_ring + +scoreboard players add @s gm4_mu_timer 1 + +execute if score @s gm4_mu_timer matches 60 run playsound minecraft:entity.breeze.inhale hostile @a ~ ~ ~ 2 2 +execute if score @s gm4_mu_timer matches 70.. run return run function gm4_monsters_unbound:mob/process/elite/volatile/pillar_explode + +scoreboard players set $keep_tick.elite_pillar_volatile gm4_mu_keep_tick 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/process.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/process.mcfunction new file mode 100644 index 0000000000..e2a66d0853 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/volatile/process.mcfunction @@ -0,0 +1,15 @@ +# process volatile elite +# @s = volatile elite +# at @s +# run from mob/process/elite/check_type + +scoreboard players set $has_target gm4_mu_data 0 +execute on target if entity @s[type=player] run scoreboard players set $has_target gm4_mu_data 1 +execute if score $has_target gm4_mu_data matches 0 run return 0 + +scoreboard players add @s gm4_mu_timer 1 +execute if predicate {condition:"random_chance","chance":0.45} run scoreboard players add @s gm4_mu_timer 1 + +execute if score @s gm4_mu_timer matches 8..12 run particle block{block_state:"purple_glazed_terracotta"} ~ ~2 ~ 0 4 0 0.25 32 +execute if score @s gm4_mu_timer matches 8..12 on target at @s summon marker run function gm4_monsters_unbound:mob/process/elite/volatile/pillar_location +scoreboard players set @s[scores={gm4_mu_timer=12..}] gm4_mu_timer 0 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/fear_hit.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/fear_hit.mcfunction new file mode 100644 index 0000000000..c24c77b31d --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/fear_hit.mcfunction @@ -0,0 +1,9 @@ +# apply fear to hit player +# @s = player that was hit +# at @s +# run from mob/process/elite/vorpal/process_fear_cloud + +scoreboard players set $player_hit gm4_mu_data 1 + +execute store result score $fear_seconds gm4_mu_data run random value 10..16 +function gm4_monsters_unbound:effect/fear/apply diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/init_fear_cloud.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/init_fear_cloud.mcfunction new file mode 100644 index 0000000000..ebb66678c7 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/init_fear_cloud.mcfunction @@ -0,0 +1,12 @@ +# spawn fear cloud skull +# @s = block_display +# at @s +# run from mob/process/elite/on_death/run + +data merge entity @s {Tags:["gm4_mu_elite.fear_cloud"],teleport_duration:1,brightness:{sky:15,block:15},transformation:{left_rotation:[0f,1f,0f,0f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.25f,0f],scale:[1f,1f,1f]},item:{id:"minecraft:wither_skeleton_skull",count:1}} + +playsound minecraft:entity.blaze.shoot hostile @a ~ ~ ~ 1 1.2 + +tp @s ~ ~ ~ facing entity @p[gamemode=!spectator] + +execute unless score $keep_tick.elite_death_vorpal gm4_mu_keep_tick matches 1 run schedule function gm4_monsters_unbound:clocks/elite/vorpal_death 1t diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/process_fear_cloud.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/process_fear_cloud.mcfunction new file mode 100644 index 0000000000..04a08a75ad --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/process_fear_cloud.mcfunction @@ -0,0 +1,30 @@ +# process fear cloud skull +# @s = block_display +# at @s +# run from clocks/elite/vorpal_death + +# particles +particle dust{color:[0.000,0.000,0.000],scale:1} ^ ^ ^0.0125 0.2666 0.2666 0.2666 0.666 4 normal + +scoreboard players add @s gm4_mu_timer 1 + +# track towards closest player +execute facing entity @p[gamemode=!spectator] eyes positioned ^ ^ ^25 rotated as @s positioned ^ ^ ^25 facing entity @s eyes facing ^ ^ ^-1 positioned as @s run tp @s ~ ~ ~ ~ ~ +tp @s[scores={gm4_mu_timer=..29}] ^ ^ ^0.025 +tp @s[scores={gm4_mu_timer=30..60}] ^ ^ ^0.075 +tp @s[scores={gm4_mu_timer=61..90}] ^ ^ ^0.125 +tp @s[scores={gm4_mu_timer=91..120}] ^ ^ ^0.200 +tp @s[scores={gm4_mu_timer=121..140}] ^ ^ ^0.300 +tp @s[scores={gm4_mu_timer=141..160}] ^ ^ ^0.450 +tp @s[scores={gm4_mu_timer=161..}] ^ ^ ^0.650 + +# hit players +scoreboard players set $player_hit gm4_mu_data 0 +execute positioned ~-.15 ~-.15 ~-.15 as @a[dx=0,dy=0,dz=0] positioned ~-0.55 ~-0.55 ~-0.55 if entity @s[dx=0,dy=0,dz=0] run function gm4_monsters_unbound:mob/process/elite/vorpal/fear_hit +execute if score $player_hit gm4_mu_data matches 1 run return run kill @s + +# timer ran out +execute if score @s gm4_mu_timer matches 240.. run return run kill @s + +# keep running if entity is still around +scoreboard players set $keep_tick.elite_death_vorpal gm4_mu_keep_tick 1 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/warp/randomize.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/warp/randomize.mcfunction new file mode 100644 index 0000000000..77a11c8546 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/warp/randomize.mcfunction @@ -0,0 +1,9 @@ +# get random teleport location +# @s = marker +# at @s +# run from clocks/elite/vorpal/warp/spawn_marker + +execute store result score $randomX gm4_mu_data run random value 0..12 +execute store result score $randomZ gm4_mu_data run random value 0..12 + +execute at @s run function gm4_monsters_unbound:mob/process/elite/vorpal/warp/tp_marker diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/warp/run.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/warp/run.mcfunction new file mode 100644 index 0000000000..fd2e7686aa --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/warp/run.mcfunction @@ -0,0 +1,14 @@ +# teleport the elite randomly +# @s = vorpal elite +# at @s +# run from clocks/elite/on_hit/check_mob + +# teleport up to 12 blocks away +tag @s add gm4_mu_target +execute positioned ~-6 ~ ~-6 summon marker run function gm4_monsters_unbound:mob/process/elite/vorpal/warp/spawn_marker +tag @s remove gm4_mu_target + +playsound minecraft:entity.enderman.teleport hostile @a ~ ~ ~ 1 0.75 + +execute at @s run particle minecraft:portal ~ ~1.75 ~ 0 0 0 0.75 32 +execute at @s run playsound minecraft:entity.enderman.teleport hostile @a ~ ~ ~ 1 0.75 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/warp/set_ypos.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/warp/set_ypos.mcfunction new file mode 100644 index 0000000000..f3d3c7bcf8 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/warp/set_ypos.mcfunction @@ -0,0 +1,11 @@ +# get random teleport location +# @s = marker +# at @s +# run from clocks/elite/vorpal/warp/tp_marker + +execute at @s run tp @s ~ ~-1 ~ +scoreboard players add $set_y gm4_mu_data 1 +scoreboard players set $warp_safe gm4_mu_data 0 +execute at @s if predicate gm4_monsters_unbound:technical/valid_tp unless entity @a[gamemode=!creative,gamemode=!spectator,distance=..3] run scoreboard players set $warp_safe gm4_mu_data 1 +execute if score $warp_safe gm4_mu_data matches 1 run scoreboard players set $warp_attempt gm4_mu_data 33 +execute unless score $set_y gm4_mu_data matches 8.. at @s unless score $warp_safe gm4_mu_data matches 1 run function gm4_monsters_unbound:mob/process/elite/vorpal/warp/set_ypos diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/warp/spawn_marker.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/warp/spawn_marker.mcfunction new file mode 100644 index 0000000000..8cc3471e7c --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/warp/spawn_marker.mcfunction @@ -0,0 +1,12 @@ +# get random teleport location +# @s = marker +# at @s +# run from clocks/elite/vorpal/warp/run + +execute store result score $y_pos gm4_mu_data run data get entity @s Pos[1] +scoreboard players set $warp_attempt gm4_mu_data 0 + +function gm4_monsters_unbound:mob/process/elite/vorpal/warp/randomize + +execute if score $warp_safe gm4_mu_data matches 1 at @s align xyz run tp @e[type=#gm4_monsters_unbound:elite_types,tag=gm4_mu_target] ~.5 ~ ~.5 +kill @s diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/warp/tp_marker.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/warp/tp_marker.mcfunction new file mode 100644 index 0000000000..f17fdbacac --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/vorpal/warp/tp_marker.mcfunction @@ -0,0 +1,31 @@ +# get random teleport location +# @s = marker +# at @s +# run from clocks/elite/vorpal/warp/randomize +# run from here + +execute at @s if score $randomX gm4_mu_data matches 8.. run tp @s ~8 ~ ~ +execute if score $randomX gm4_mu_data matches 8.. run scoreboard players remove $randomX gm4_mu_data 8 +execute at @s if score $randomX gm4_mu_data matches 4.. run tp @s ~4 ~ ~ +execute if score $randomX gm4_mu_data matches 4.. run scoreboard players remove $randomX gm4_mu_data 4 +execute at @s if score $randomX gm4_mu_data matches 2.. run tp @s ~2 ~ ~ +execute if score $randomX gm4_mu_data matches 2.. run scoreboard players remove $randomX gm4_mu_data 2 +execute at @s if score $randomX gm4_mu_data matches 1.. run tp @s ~1 ~ ~ +execute if score $randomX gm4_mu_data matches 1.. run scoreboard players remove $randomX gm4_mu_data 1 + +execute at @s if score $randomZ gm4_mu_data matches 8.. run tp @s ~ ~ ~8 +execute if score $randomZ gm4_mu_data matches 8.. run scoreboard players remove $randomZ gm4_mu_data 8 +execute at @s if score $randomZ gm4_mu_data matches 4.. run tp @s ~ ~ ~4 +execute if score $randomZ gm4_mu_data matches 4.. run scoreboard players remove $randomZ gm4_mu_data 4 +execute at @s if score $randomZ gm4_mu_data matches 2.. run tp @s ~ ~ ~2 +execute if score $randomZ gm4_mu_data matches 2.. run scoreboard players remove $randomZ gm4_mu_data 2 +execute at @s if score $randomZ gm4_mu_data matches 1.. run tp @s ~ ~ ~1 +execute if score $randomZ gm4_mu_data matches 1.. run scoreboard players remove $randomZ gm4_mu_data 1 + +execute store result entity @s Pos[1] double 1 run scoreboard players get $y_pos gm4_mu_data +execute at @s run tp @s ~ ~4 ~ +scoreboard players set $set_y gm4_mu_data 0 +execute at @s run function gm4_monsters_unbound:mob/process/elite/vorpal/warp/set_ypos + +scoreboard players add $warp_attempt gm4_mu_data 1 +execute unless score $warp_attempt gm4_mu_data matches 33.. run function gm4_monsters_unbound:mob/process/elite/vorpal/warp/randomize diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/activate.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/activate.mcfunction new file mode 100644 index 0000000000..d4bfb53877 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/activate.mcfunction @@ -0,0 +1,18 @@ +# activate charged attack +# @s = zephyr elite +# at @s +# run from mob/process/elite/zephyr/process + +execute anchored eyes positioned ^ ^-1.15 ^ run particle gust_emitter_small ~ ~ ~ 0 0 0 1 1 normal +playsound minecraft:entity.breeze.wind_burst hostile @a ~ ~ ~ 1 0 + +# skeletons shoot arrows instead of speed burst +execute if entity @s[type=#gm4_survival_refightalized:skeleton_types] run return run function gm4_monsters_unbound:mob/process/elite/zephyr/skeleton/start + +summon breeze_wind_charge ~ ~ ~ {Motion:[0.0,-5.0,0.0]} +attribute @s minecraft:movement_speed modifier remove gm4_monsters_unbound:elite_buff.speed.charging +attribute @s minecraft:movement_speed modifier add gm4_monsters_unbound:elite_buff.speed.charged 1.5 add_multiplied_total +attribute @s minecraft:attack_damage modifier add gm4_monsters_unbound:elite_buff.speed.charged 0.75 add_multiplied_total +attribute @s minecraft:attack_knockback modifier add gm4_monsters_unbound:elite_buff.speed.charged 2 add_value + +tag @s add gm4_mu_charging_attack diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/charge_complete.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/charge_complete.mcfunction new file mode 100644 index 0000000000..d6915a57ab --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/charge_complete.mcfunction @@ -0,0 +1,13 @@ +# charge is complete +# @s = zephyr elite +# at @s +# run from mob/process/attack_effect/charging_attack + +attribute @s minecraft:movement_speed modifier remove gm4_monsters_unbound:elite_buff.speed.charged +attribute @s minecraft:attack_damage modifier remove gm4_monsters_unbound:elite_buff.speed.charged +attribute @s minecraft:attack_knockback modifier remove gm4_monsters_unbound:elite_buff.speed.charged + +# don't charge again until player target is lost +tag @s remove gm4_mu_charging_attack +tag @s remove gm4_mu_elite.on_hit +scoreboard players set @s gm4_mu_timer -12 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/hit_when_charging.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/hit_when_charging.mcfunction new file mode 100644 index 0000000000..13e4a16f10 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/hit_when_charging.mcfunction @@ -0,0 +1,21 @@ +# remove charge if mob is hit +# @s = zephyr elite +# at @s +# run from mob/process/elite/on_hit/check_mob + +execute anchored eyes positioned ^ ^-0.15 ^ run particle small_gust ~ ~ ~ 0.45 0.45 0.45 1 16 normal +playsound minecraft:entity.breeze.hurt hostile @a ~ ~ ~ 1 0 +effect give @s slowness 1 9 true + +attribute @s minecraft:movement_speed modifier remove gm4_monsters_unbound:elite_buff.speed.charging +attribute @s minecraft:movement_speed modifier remove gm4_monsters_unbound:elite_buff.speed.charged +attribute @s minecraft:attack_damage modifier remove gm4_monsters_unbound:elite_buff.speed.charged +attribute @s minecraft:attack_knockback modifier remove gm4_monsters_unbound:elite_buff.speed.charged + +execute if score @s gm4_mu_timer matches 2.. run summon breeze_wind_charge ~ ~ ~ {Motion:[0.0,-5.0,0.0]} + +# disable charge for a little time +tag @s remove gm4_mu_elite.zephyr_skeleton_burst +tag @s remove gm4_mu_charging_attack +tag @s remove gm4_mu_elite.on_hit +scoreboard players set @s gm4_mu_timer -4 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/lose_charge.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/lose_charge.mcfunction new file mode 100644 index 0000000000..00707776f0 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/lose_charge.mcfunction @@ -0,0 +1,14 @@ +# remove charge if target is lost +# @s = zephyr elite +# at @s +# run from mob/process/elite/zephyr/process + +attribute @s minecraft:movement_speed modifier remove gm4_monsters_unbound:elite_buff.speed.charging +attribute @s minecraft:movement_speed modifier remove gm4_monsters_unbound:elite_buff.speed.charged +attribute @s minecraft:attack_damage modifier remove gm4_monsters_unbound:elite_buff.speed.charged +attribute @s minecraft:attack_knockback modifier remove gm4_monsters_unbound:elite_buff.speed.charged +scoreboard players reset @s gm4_mu_timer + +effect give @s[tag=gm4_mu_elite.zephyr_skeleton_burst] speed 3 3 +tag @s remove gm4_mu_elite.zephyr_skeleton_burst +tag @s remove gm4_mu_elite.on_hit diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/process.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/process.mcfunction new file mode 100644 index 0000000000..b1d8f88b4a --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/process.mcfunction @@ -0,0 +1,28 @@ +# process zephyr elite +# @s = zephyr elite +# at @s +# run from mob/process/elite/check_type + +scoreboard players set $has_target gm4_mu_data 0 +execute on target run scoreboard players set $has_target gm4_mu_data 1 +execute if entity @s[type=#gm4_survival_refightalized:skeleton_types,scores={gm4_mu_timer=1..}] run scoreboard players set $has_target gm4_mu_data 1 + +# no target +execute if score $has_target gm4_mu_data matches 0 if score @s gm4_mu_timer matches -2147483648..2147483647 run function gm4_monsters_unbound:mob/process/elite/zephyr/lose_charge +execute if score $has_target gm4_mu_data matches 0 run return run scoreboard players reset @s gm4_mu_timer + +scoreboard players add @s gm4_mu_timer 1 + +execute if score @s gm4_mu_timer matches 1..4 anchored eyes positioned ^ ^-0.15 ^ run particle small_gust ~ ~ ~ 0.35 0.35 0.35 1 6 normal + +tag @s[scores={gm4_mu_timer=1}] add gm4_mu_elite.on_hit +attribute @s[scores={gm4_mu_timer=1}] minecraft:movement_speed modifier add gm4_monsters_unbound:elite_buff.speed.charging -1 add_multiplied_total + +execute if score @s gm4_mu_timer matches 2 run playsound minecraft:entity.breeze.inhale hostile @a ~ ~ ~ 1 0.5 +execute if score @s gm4_mu_timer matches 3 run playsound minecraft:entity.breeze.charge hostile @a ~ ~ ~ 1 0.5 +execute if score @s gm4_mu_timer matches 4 run playsound minecraft:entity.breeze.idle_air hostile @a ~ ~ ~ 1 0.65 + +execute if score @s gm4_mu_timer matches 5 run function gm4_monsters_unbound:mob/process/elite/zephyr/activate +execute if score @s[type=#gm4_survival_refightalized:skeleton_types] gm4_mu_timer matches 6..10 run function gm4_monsters_unbound:mob/process/elite/zephyr/skeleton/arrow_burst + +scoreboard players reset @s[scores={gm4_mu_timer=14..},tag=!gm4_mu_charging_attack] gm4_mu_timer diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/skeleton/arrow_burst.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/skeleton/arrow_burst.mcfunction new file mode 100644 index 0000000000..42e6e1fe78 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/skeleton/arrow_burst.mcfunction @@ -0,0 +1,13 @@ +# shoot many arrows +# @s = zephyr elite +# at @s +# run from mob/process/elite/zephyr/process +# run from clocks/elite/zephyr_process + +scoreboard players add @s gm4_mu_data 1 + +execute if score @s gm4_mu_data matches 16.. run return run function gm4_monsters_unbound:mob/process/elite/zephyr/lose_charge + +scoreboard players set $keep_tick.elite_process_zephyr gm4_mu_keep_tick 1 + +execute anchored eyes positioned ^ ^ ^0.05 on target facing entity @s eyes summon arrow run function gm4_monsters_unbound:mob/process/elite/zephyr/skeleton/init_arrow diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/skeleton/get_target_pos.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/skeleton/get_target_pos.mcfunction new file mode 100644 index 0000000000..0a21431496 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/skeleton/get_target_pos.mcfunction @@ -0,0 +1,10 @@ +# get pos of target +# @s = marker +# at @s +# run from mob/process/elite/zephyr/skeleton/init_arrow + +data modify storage gm4_monsters_unbound:temp Pos set from entity @s Pos +execute store result score $target_x gm4_mu_data run data get storage gm4_monsters_unbound:temp Pos[0] 100 +execute store result score $target_y gm4_mu_data run data get storage gm4_monsters_unbound:temp Pos[1] 100 +execute store result score $target_z gm4_mu_data run data get storage gm4_monsters_unbound:temp Pos[2] 100 +kill @s diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/skeleton/init_arrow.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/skeleton/init_arrow.mcfunction new file mode 100644 index 0000000000..4980b3fa3a --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/skeleton/init_arrow.mcfunction @@ -0,0 +1,38 @@ +# init arrow burst arrow +# @s = arrow +# at @s +# run from mob/process/elite/zephyr/skeleton/arrow_burst + +# don't process this arrow +tag @s add gm4_sr_arrow_checked + +# arrow deals half damage +data modify entity @s damage set value 0.5 + +# get player pos +execute positioned ^ ^ ^10 summon marker run function gm4_monsters_unbound:mob/process/elite/zephyr/skeleton/get_target_pos + +# get vector +data modify storage gm4_monsters_unbound:temp Pos set from entity @s Pos +execute store result score $motion_x gm4_mu_data run data get storage gm4_monsters_unbound:temp Pos[0] 100 +execute store result score $motion_y gm4_mu_data run data get storage gm4_monsters_unbound:temp Pos[1] 100 +execute store result score $motion_z gm4_mu_data run data get storage gm4_monsters_unbound:temp Pos[2] 100 + +execute store result score $motion_x_offset gm4_mu_data run random value -128..128 +execute store result score $motion_y_offset gm4_mu_data run random value -32..32 +execute store result score $motion_z_offset gm4_mu_data run random value -128..128 + +scoreboard players operation $target_x gm4_mu_data += $motion_x_offset gm4_mu_data +scoreboard players operation $target_y gm4_mu_data += $motion_y_offset gm4_mu_data +scoreboard players operation $target_z gm4_mu_data += $motion_z_offset gm4_mu_data + +scoreboard players operation $motion_x gm4_mu_data -= $target_x gm4_mu_data +scoreboard players operation $motion_y gm4_mu_data -= $target_y gm4_mu_data +scoreboard players operation $motion_z gm4_mu_data -= $target_z gm4_mu_data + +# set motion +execute store result entity @s Motion[0] double -0.0016517 run scoreboard players get $motion_x gm4_mu_data +execute store result entity @s Motion[1] double -0.0016517 run scoreboard players get $motion_y gm4_mu_data +execute store result entity @s Motion[2] double -0.0016517 run scoreboard players get $motion_z gm4_mu_data + +data remove storage gm4_monsters_unbound:temp Pos diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/skeleton/start.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/skeleton/start.mcfunction new file mode 100644 index 0000000000..372bcb456c --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/elite/zephyr/skeleton/start.mcfunction @@ -0,0 +1,8 @@ +# start arrow burst for skeleton zephyr elite +# @s = zephyr elite +# at @s +# run from mob/process/elite/zephyr/process + +tag @s add gm4_mu_elite.zephyr_skeleton_burst +scoreboard players set @s gm4_mu_data 0 +execute unless score $keep_tick.elite_process_zephyr gm4_mu_keep_tick matches 1 run schedule function gm4_monsters_unbound:clocks/elite/zephyr_process 2t diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/reveal_dripstone_trap.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/reveal_dripstone_trap.mcfunction new file mode 100644 index 0000000000..2b6b6b9b56 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/reveal_dripstone_trap.mcfunction @@ -0,0 +1,21 @@ +# reveal snowy trap when a player gets nearby +# @s = hidden snowy trap +# at @s +# run from main + +kill @s + +execute unless block ~ ~1 ~ #gm4_monsters_unbound:dripstone run return 0 + +# spring the trap +particle block{block_state:"dripstone_block"} ~ ~ ~ 0.2 0.6 0.2 1 24 +particle block{block_state:"dripstone_block"} ~ ~-16 ~ 0.2 10 0.2 1 64 +playsound minecraft:block.dripstone_block.break block @a[distance=..42] ~ ~ ~ 1.5 0.8 1 + +execute store result score $pick_entity gm4_mu_data run random value 1..3 +scoreboard players set $mob_extras gm4_sr_data 1 +execute if score $pick_entity gm4_mu_data matches 1 run summon skeleton ~ ~-0.8 ~ {Tags:["gm4_sr_extra_mob"],Motion:[0.0d,-0.275d,0.0d],attributes:[{id:"fall_damage_multiplier",base:1,modifiers:[{id:"gm4_monsters_unbound:stat_change.dripstone_trap",amount:-0.95,operation:"add_multiplied_total"}]}]} +execute if score $pick_entity gm4_mu_data matches 2 run summon zombie ~ ~-0.8 ~ {Tags:["gm4_sr_extra_mob"],Motion:[0.0d,-0.275d,0.0d],attributes:[{id:"fall_damage_multiplier",base:1,modifiers:[{id:"gm4_monsters_unbound:stat_change.dripstone_trap",amount:-0.95,operation:"add_multiplied_total"}]}]} +execute if score $pick_entity gm4_mu_data matches 3 run summon spider ~ ~ ~ {Tags:["gm4_sr_extra_mob"],Motion:[0.0d,-0.275d,0.0d],attributes:[{id:"fall_damage_multiplier",base:1,modifiers:[{id:"gm4_monsters_unbound:stat_change.dripstone_trap",amount:-0.95,operation:"add_multiplied_total"}]}]} + +execute as @n[type=#gm4_survival_refightalized:modify,tag=gm4_sr_extra_mob] at @s run function gm4_survival_refightalized:mob/init/initiate diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/reveal_snowy_trap.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/reveal_snowy_trap.mcfunction new file mode 100644 index 0000000000..52da02f481 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/reveal_snowy_trap.mcfunction @@ -0,0 +1,20 @@ +# reveal snowy trap when a player gets nearby +# @s = hidden snowy trap +# at @s +# run from main + +kill @s + +execute unless block ~ ~ ~ snow run return 0 + +# spring the trap +particle block{block_state:"snow"} ~ ~1 ~ 0.2 0.6 0.2 1 12 +playsound minecraft:block.snow.place block @a ~ ~ ~ 1.5 0.8 + +execute store result score $pick_entity gm4_mu_data run random value 1..3 +scoreboard players set $mob_extras gm4_sr_data 1 +execute if score $pick_entity gm4_mu_data matches 1 run summon zombie ~ ~-0.75 ~ {Tags:["gm4_sr_extra_mob"],Motion:[0.0d,0.5d,0.0d]} +execute if score $pick_entity gm4_mu_data matches 2 run summon stray ~ ~-0.75 ~ {Tags:["gm4_sr_extra_mob"],Motion:[0.0d,0.5d,0.0d]} +execute if score $pick_entity gm4_mu_data matches 3 run summon creeper ~ ~-0.75 ~ {Tags:["gm4_sr_extra_mob"],Motion:[0.0d,0.5d,0.0d]} + +execute as @n[type=#gm4_survival_refightalized:modify,tag=gm4_sr_extra_mob] at @s run function gm4_survival_refightalized:mob/init/initiate diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/spore/activate.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/spore/activate.mcfunction new file mode 100644 index 0000000000..fc43aafca4 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/spore/activate.mcfunction @@ -0,0 +1,31 @@ +# summon new zombie/husk/drowned when spore is grown +# @s = spore item +# at @s +# run from mob/process/spore/advance + +# check for mob cap +execute at @p[gamemode=!spectator] store result score $spore_zombie_count gm4_mu_data if entity @e[type=#gm4_survival_refightalized:zombie_types,tag=gm4_mu_spore_mob,distance=..32] +execute if score $spore_zombie_count gm4_mu_data > $mob_limit.spore_zombie gm4_sr_config run kill @s +execute if score $spore_zombie_count gm4_mu_data > $mob_limit.spore_zombie gm4_sr_config run return 0 + +# get spores in stack and their generation +execute store result score $spore_count gm4_mu_data run data get entity @s Item.count +execute store result score $generation gm4_mu_data run data get entity @s Item.components."minecraft:custom_data".gm4_mu_spore.generation + +# spawn up to 4 spore zombies +execute align xz run summon zombie ~.5 ~ ~.5 {Tags:["gm4_sr_extra_mob","gm4_mu_spore_mob"]} +execute if score $spore_count gm4_mu_data matches 2.. align xz run summon zombie ~.51 ~ ~.47 {Tags:["gm4_sr_extra_mob","gm4_mu_spore_mob"]} +execute if score $spore_count gm4_mu_data matches 3.. align xz run summon zombie ~.54 ~ ~.52 {Tags:["gm4_sr_extra_mob","gm4_mu_spore_mob"]} +execute if score $spore_count gm4_mu_data matches 4.. align xz run summon zombie ~0.47 ~ ~.54 {Tags:["gm4_sr_extra_mob","gm4_mu_spore_mob"]} +execute if entity @s[tag=gm4_mu_spore.cherry] run tag @e[type=zombie,tag=gm4_mu_spore_mob,distance=..1] add gm4_mu_spore_zombie.cherry + +# vfx +particle minecraft:block{block_state:"minecraft:flowering_azalea_leaves"} ~ ~1 ~ 0.35 1 0.35 0.1 32 +playsound block.grass.break hostile @a ~ ~ ~ 0.6 0.6 + +# remove spores +execute if score $spore_count gm4_mu_data matches ..4 run kill @s +execute if score $spore_count gm4_mu_data matches 5.. store result entity @s Item.count byte 1 run scoreboard players remove $spore_count gm4_mu_data 4 + +# set spore zombie generation +execute as @e[tag=gm4_mu_spore_mob,distance=..1] at @s run function gm4_monsters_unbound:mob/process/spore/set_generation diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/spore/advance.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/spore/advance.mcfunction new file mode 100644 index 0000000000..3038556e50 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/spore/advance.mcfunction @@ -0,0 +1,14 @@ +# advance spore growth +# @s = spore +# at @s +# run from main + +execute if score @s gm4_mu_data matches 10.. run function gm4_monsters_unbound:mob/process/spore/activate +scoreboard players add @s gm4_mu_data 1 +execute if score @s[tag=!gm4_mu_spore.cherry] gm4_mu_data matches 1..4 run particle minecraft:block{block_state:"minecraft:flowering_azalea_leaves"} ~ ~ ~ 0.04 0.15 0.04 0.05 5 +execute if score @s[tag=!gm4_mu_spore.cherry] gm4_mu_data matches 5..7 run particle minecraft:block{block_state:"minecraft:flowering_azalea_leaves"} ~ ~ ~ 0.045 0.175 0.045 0.1 8 +execute if score @s[tag=!gm4_mu_spore.cherry] gm4_mu_data matches 8.. run particle minecraft:block{block_state:"minecraft:flowering_azalea_leaves"} ~ ~ ~ 0.05 0.2 0.05 0.15 16 +execute if score @s[tag=gm4_mu_spore.cherry] gm4_mu_data matches 1..4 run particle minecraft:block{block_state:"minecraft:cherry_leaves"} ~ ~ ~ 0.04 0.15 0.04 0.05 5 +execute if score @s[tag=gm4_mu_spore.cherry] gm4_mu_data matches 5..7 run particle minecraft:block{block_state:"minecraft:cherry_leaves"} ~ ~ ~ 0.045 0.175 0.045 0.1 8 +execute if score @s[tag=gm4_mu_spore.cherry] gm4_mu_data matches 8.. run particle minecraft:block{block_state:"minecraft:cherry_leaves"} ~ ~ ~ 0.05 0.2 0.05 0.15 16 +playsound block.grass.step hostile @a ~ ~ ~ 2 0.5 diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/spore/initialise.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/spore/initialise.mcfunction new file mode 100644 index 0000000000..03e1f3a7b0 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/spore/initialise.mcfunction @@ -0,0 +1,8 @@ +# tag spore item as spore +# @s = spore item +# at unspecified +# run from check_item + +tag @s add gm4_mu_spore +data merge entity @s {Age:-32768,PickupDelay:32767,Health:4} +execute if items entity @s contents minecraft:cherry_leaves run tag @s add gm4_mu_spore.cherry diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/spore/set_generation.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/spore/set_generation.mcfunction new file mode 100644 index 0000000000..bf2c1dfca0 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/spore/set_generation.mcfunction @@ -0,0 +1,9 @@ +# set generation of new zombie/husk/drowned +# @s = zombie/husk/drowned +# at @s +# run from mob/process/spore/activate + +scoreboard players operation @s gm4_mu_generation = $generation gm4_mu_data +tag @s remove gm4_mu_spore_mob +tag @s add gm4_mu_spore_zombie +function gm4_monsters_unbound:mob/init/initiate diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/toxic_creeper.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/toxic_creeper.mcfunction new file mode 100644 index 0000000000..c3c3da772f --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/mob/process/toxic_creeper.mcfunction @@ -0,0 +1,10 @@ +# refresh effects on creeper +# @s = toxic creeper +# at unspecified +# run from slow_clock +# run from mob/init/mob_type/creeper + +effect give @s weakness 33 1 +effect give @s blindness 33 0 true +effect give @s nausea 33 0 true +effect give @s hunger 33 1 true diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/slow_clock.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/slow_clock.mcfunction new file mode 100644 index 0000000000..3a7c598719 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/slow_clock.mcfunction @@ -0,0 +1,10 @@ +schedule function gm4_monsters_unbound:slow_clock 30s + +# toxic creepers +execute as @e[type=creeper,tag=gm4_mu_toxic_creeper] run function gm4_monsters_unbound:mob/process/toxic_creeper + +# cloaked crepers +effect give @e[type=creeper,tag=gm4_mu_cloaked_creeper] invisibility 33 0 + +# remove traps that have not been triggered +execute as @e[type=marker,tag=gm4_mu_trap] at @s unless entity @a[gamemode=!spectator,distance=..128] run kill @s diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/function/tick.mcfunction b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/tick.mcfunction new file mode 100644 index 0000000000..e13dc0c417 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/function/tick.mcfunction @@ -0,0 +1,4 @@ +schedule function gm4_monsters_unbound:tick 1t + +# check for items on the ground +execute as @e[type=item,tag=!gm4_mu_item_checked,tag=!smithed.strict,tag=!smithed.entity] run function gm4_monsters_unbound:check_item diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/guidebook/monsters_unbound.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/guidebook/monsters_unbound.json new file mode 100644 index 0000000000..1ae5dd1b06 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/guidebook/monsters_unbound.json @@ -0,0 +1,828 @@ +{ + "id": "monsters_unbound", + "name": "Monsters Unbound", + "module_type": "module", + "icon": { + "id": "minecraft:chainmail_chestplate" + }, + "criteria": { + "enter_underground": { + "trigger": "minecraft:location", + "conditions": { + "player": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/underground" + } + ] + } + }, + "enter_dripstone_caves": { + "trigger": "minecraft:location", + "conditions": { + "player": [ + { + "condition": "minecraft:location_check", + "predicate": { + "biomes": "minecraft:dripstone_caves" + } + } + ] + } + }, + "enter_burned": { + "trigger": "minecraft:location", + "conditions": { + "player": [ + { + "condition": "minecraft:reference", + "name": "gm4_monsters_unbound:biome/burned" + } + ] + } + }, + "enter_flowering": { + "trigger": "minecraft:location", + "conditions": { + "player": [ + { + "condition": "minecraft:reference", + "name": "gm4_monsters_unbound:biome/flowering" + } + ] + } + }, + "enter_growth": { + "trigger": "minecraft:location", + "conditions": { + "player": [ + { + "condition": "minecraft:reference", + "name": "gm4_monsters_unbound:biome/growth" + } + ] + } + }, + "enter_mountainous": { + "trigger": "minecraft:location", + "conditions": { + "player": [ + { + "condition": "minecraft:reference", + "name": "gm4_monsters_unbound:biome/mountainous" + } + ] + } + }, + "enter_warm_ocean": { + "trigger": "minecraft:location", + "conditions": { + "player": [ + { + "condition": "minecraft:location_check", + "predicate": { + "biomes": "minecraft:warm_ocean" + } + } + ] + } + }, + "enter_snowy": { + "trigger": "minecraft:location", + "conditions": { + "player": [ + { + "condition": "minecraft:reference", + "name": "gm4_monsters_unbound:biome/snowy" + } + ] + } + }, + "enter_toxic": { + "trigger": "minecraft:location", + "conditions": { + "player": [ + { + "condition": "minecraft:reference", + "name": "gm4_monsters_unbound:biome/toxic" + } + ] + } + }, + "kill_elite_blazing": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.blazing\"]}" + } + } + ] + } + }, + "kill_elite_gargantuan": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.gargantuan\"]}" + } + } + ] + } + }, + "kill_elite_glacial": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.glacial\"]}" + } + } + ] + } + }, + "kill_elite_mending": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.mending\"]}" + } + } + ] + } + }, + "kill_elite_pearlescent": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.pearlescent\"]}" + } + } + ] + } + }, + "kill_elite_splitting": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.splitting\"]}" + } + } + ] + } + }, + "kill_elite_volatile": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.volatile\"]}" + } + } + ] + } + }, + "kill_elite_vorpal": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.vorpal\"]}" + } + } + ] + } + }, + "kill_elite_zephyr": { + "trigger": "minecraft:player_killed_entity", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_elite.zephyr\"]}" + } + } + ] + } + } + }, + "sections": [ + { + "name": "biomes", + "enable": [], + "requirements": [], + "pages": [ + [ + { + "insert": "title" + }, + { + "translate": "text.gm4.guidebook.monsters_unbound.description.biomes", + "fallback": "Mobs spawned in different biomes have special modifiers.\n\nSome areas and biomes spawn different mobs than usual." + } + ] + ] + }, + { + "name": "underground", + "enable": [], + "requirements": [ + [ + "enter_underground" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.underground", + "fallback": "Mobs spawned underground are generally stronger and can have varying buffs and potion effects." + } + ] + ] + }, + { + "name": "burned", + "enable": [], + "requirements": [ + [ + "enter_burned" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.burned", + "fallback": "Mobs spawned in a %s biome are weaker but faster.\n\nHusks spawn in large groups.", + "with": [ + { + "translate": "text.gm4.guidebook.monsters_unbound.burned", + "fallback": "burned", + "color": "blue", + "hoverEvent": { + "action": "show_text", + "contents": [ + "- ", + { + "translate": "biome.minecraft.desert" + }, + "\n- ", + { + "translate": "biome.minecraft.savanna" + }, + "\n- ", + { + "translate": "biome.minecraft.savanna_plateau" + }, + "\n- ", + { + "translate": "biome.minecraft.windswept_savanna" + }, + "\n- ", + { + "translate": "biome.minecraft.badlands" + }, + "\n- ", + { + "translate": "biome.minecraft.wooded_badlands" + }, + "\n- ", + { + "translate": "biome.minecraft.eroded_badlands" + } + ] + } + } + ] + } + ] + ] + }, + { + "name": "dripstone_caves", + "enable": [], + "requirements": [ + [ + "enter_dripstone_caves" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.dripstone_caves", + "fallback": "More Spiders are found in Dripstone Caves, and Skeletons may wield pickaxes.\n\nSome Dripstone may be trapped and drop a mob when walked below." + } + ] + ] + }, + { + "name": "flowering", + "enable": [], + "requirements": [ + [ + "enter_flowering" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.flowering", + "fallback": "In %s biomes Spore Zombies can be found, these drop a respawning Spore on death. Spores are susceptible to fire.\n\nCreepers are weaker but invisible.", + "with": [ + { + "translate": "text.gm4.guidebook.monsters_unbound.flowering", + "fallback": "flowering", + "color": "blue", + "hoverEvent": { + "action": "show_text", + "contents": [ + "- ", + { + "translate": "biome.minecraft.sunflower_plains" + }, + "\n- ", + { + "translate": "biome.minecraft.flower_forest" + }, + "\n- ", + { + "translate": "biome.minecraft.cherry_grove" + }, + "\n- ", + { + "translate": "biome.minecraft.lush_caves" + } + ] + } + } + ] + } + ] + ] + }, + { + "name": "growth", + "enable": [], + "requirements": [ + [ + "enter_growth" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.growth", + "fallback": "Mobs spawned in a %s biome are faster.\n\nSkeletons usually use melee weapons.\n\nMore Spiders are found here", + "with": [ + { + "translate": "text.gm4.guidebook.monsters_unbound.growth", + "fallback": "growth", + "color": "blue", + "hoverEvent": { + "action": "show_text", + "contents": [ + "- ", + { + "translate": "biome.minecraft.snowy_taiga" + }, + "\n- ", + { + "translate": "biome.minecraft.grove" + }, + "\n- ", + { + "translate": "biome.minecraft.taiga" + }, + "\n- ", + { + "translate": "biome.minecraft.old_growth_pine_taiga" + }, + "\n- ", + { + "translate": "biome.minecraft.old_growth_spruce_taiga" + }, + "\n- ", + { + "translate": "biome.minecraft.dark_forest" + }, + "\n- ", + { + "translate": "biome.minecraft.mangrove_swamp" + } + ] + } + } + ] + } + ] + ] + }, + { + "name": "mountainous", + "enable": [], + "requirements": [ + [ + "enter_mountainous" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.mountainous", + "fallback": "Phantoms can spawn in %s biomes.\n\nCreepers have more health.\n\nSpiders are faster", + "with": [ + { + "translate": "text.gm4.guidebook.monsters_unbound.mountainous", + "fallback": "mountainous", + "color": "blue", + "hoverEvent": { + "action": "show_text", + "contents": [ + "- ", + { + "translate": "biome.minecraft.snowy_slopes" + }, + "\n- ", + { + "translate": "biome.minecraft.jagged_peaks" + }, + "\n- ", + { + "translate": "biome.minecraft.frozen_peaks" + }, + "\n- ", + { + "translate": "biome.minecraft.windswept_hills" + }, + "\n- ", + { + "translate": "biome.minecraft.windswept_gravelly_hills" + }, + "\n- ", + { + "translate": "biome.minecraft.windswept_forest" + }, + "\n- ", + { + "translate": "biome.minecraft.stony_shores" + }, + "\n- ", + { + "translate": "biome.minecraft.cherry_grove" + }, + "\n- ", + { + "translate": "biome.minecraft.meadow" + }, + "\n- ", + { + "translate": "biome.minecraft.stony_peaks" + }, + "\n- ", + { + "translate": "biome.minecraft.windswept_savanna" + }, + "\n- ", + { + "translate": "biome.minecraft.eroded_badlands" + } + ] + } + } + ] + } + ] + ] + }, + { + "name": "snowy", + "enable": [], + "requirements": [ + [ + "enter_snowy" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.snowy", + "fallback": "Mobs can ambush the player from snow in %s biomes.\n\nMobs can apply slowness.\n\nSpiders can be Gargantuan Elites.", + "with": [ + { + "translate": "text.gm4.guidebook.monsters_unbound.snowy", + "fallback": "snowy", + "color": "blue", + "hoverEvent": { + "action": "show_text", + "contents": [ + "- ", + { + "translate": "biome.minecraft.snowy_plains" + }, + "\n- ", + { + "translate": "biome.minecraft.ice_spikes" + }, + "\n- ", + { + "translate": "biome.minecraft.snowy_taiga" + }, + "\n- ", + { + "translate": "biome.minecraft.snowy_beach" + }, + "\n- ", + { + "translate": "biome.minecraft.grove" + }, + "\n- ", + { + "translate": "biome.minecraft.snowy_slopes" + }, + "\n- ", + { + "translate": "biome.minecraft.jagged_peaks" + }, + "\n- ", + { + "translate": "biome.minecraft.frozen_peaks" + }, + "\n- ", + { + "translate": "biome.minecraft.frozen_river" + }, + "\n- ", + { + "translate": "biome.minecraft.frozen_ocean" + }, + "\n- ", + { + "translate": "biome.minecraft.deep_frozen_ocean" + } + ] + } + } + ] + } + ] + ] + }, + { + "name": "toxic", + "enable": [], + "requirements": [ + [ + "enter_toxic" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.toxic", + "fallback": "Mobs spawned in a %s biome can apply various negative effects.\n\nMore Witches are found here.", + "with": [ + { + "translate": "text.gm4.guidebook.monsters_unbound.toxic", + "fallback": "toxic", + "color": "blue", + "hoverEvent": { + "action": "show_text", + "contents": [ + "- ", + { + "translate": "biome.minecraft.swamp" + }, + "\n- ", + { + "translate": "biome.minecraft.mangrove_swamp" + }, + "\n- ", + { + "translate": "biome.minecraft.jungle" + }, + "\n- ", + { + "translate": "biome.minecraft.bamboo_jungle" + } + ] + } + } + ] + } + ] + ] + }, + { + "name": "warm_ocean", + "enable": [], + "requirements": [ + [ + "enter_warm_ocean" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.warm_ocean", + "fallback": "Drowned spawned in a Warm Ocean are much more powerful and have a larger chance to spawn wielding a Trident." + } + ] + ] + }, + { + "name": "elites", + "enable": [], + "requirements": [], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.elites", + "fallback": "Zombies that spawn as babies or as leaders are replaced with a random Elite variant.\n\nSkeletons have a static 5% chance to be an Elite." + } + ] + ] + }, + { + "name": "elite_blazing", + "enable": [], + "requirements": [ + [ + "kill_elite_blazing" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.elite_blazing", + "fallback": "Blazing Elites are slow and immune to burning. Their attacks deal little damage but have Fire Aspect II or Flame. Occasionally will spawn slow moving homing projectiles that explode on contact." + } + ] + ] + }, + { + "name": "elite_gargantuan", + "enable": [], + "requirements": [ + [ + "kill_elite_gargantuan" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.elite_gargantuan", + "fallback": "Gargantuan Elites are much bigger and gain stats based on their missing health. Will occasionally perform an AoE stomp attack." + } + ] + ] + }, + { + "name": "elite_glacial", + "enable": [], + "requirements": [ + [ + "kill_elite_glacial" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.elite_glacial", + "fallback": "Glacial Elites leave a sphere of frozen energy on death. This sphere explodes after 2 seconds freezing any entity inside for 3 seconds." + } + ] + ] + }, + { + "name": "elite_mending", + "enable": [], + "requirements": [ + [ + "kill_elite_mending" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.elite_mending", + "fallback": "Mending Elites will heal other undead mobs in their line of sight, this will never target other Mending Elites." + } + ] + ] + }, + { + "name": "elite_pearlescent", + "enable": [], + "requirements": [ + [ + "kill_elite_pearlescent" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.elite_pearlescent", + "fallback": "Pearescent Elites can shoot damaging lasers from their eyes, the laser is blocked by terrain." + } + ] + ] + }, + { + "name": "elite_splitting", + "enable": [], + "requirements": [ + [ + "kill_elite_splitting" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.elite_splitting", + "fallback": "Splitting Elites split into 6 smaller and weaker versions of itself on death." + } + ] + ] + }, + { + "name": "elite_volatile", + "enable": [], + "requirements": [ + [ + "kill_elite_volatile" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.elite_volatile", + "fallback": "Volatile Elites create randomly targeted purple beams of energy around them that explode after a delay, dealing heavy magic damage." + } + ] + ] + }, + { + "name": "elite_vorpal", + "enable": [], + "requirements": [ + [ + "kill_elite_vorpal" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.elite_vorpal", + "fallback": "Vorpal Elites teleport randomly on getting hit. On death a homing skull will track the nearest player and apply Fear, which blinds and slows interactions." + } + ] + ] + }, + { + "name": "elite_zephyr", + "enable": [], + "requirements": [ + [ + "kill_elite_zephyr" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.monsters_unbound.description.elite_zephyr", + "fallback": "Zephyr Elites can charge a powerful wind-charged attack. Damaging them during the charge time dissipates the charge. Zephyr Zombies will rush the player, Zephyr Skeletons fire a burst of arrows." + } + ] + ] + } + ] +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/glacial.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/glacial.json new file mode 100644 index 0000000000..36d9cd885f --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/glacial.json @@ -0,0 +1,25 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:packed_ice", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_mu_elite_on_death:{name:glacial,id:1}}" + }, + { + "function": "minecraft:set_components", + "components": { + "minecraft:custom_model_data": "item/elite_headwear/glacial" + } + } + ] + } + ] + } + ] +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/mending.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/mending.json new file mode 100644 index 0000000000..20099b774e --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/mending.json @@ -0,0 +1,21 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:lime_glazed_terracotta", + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "minecraft:custom_model_data": "item/elite_headwear/mending" + } + } + ] + } + ] + } + ] +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/pearlescent.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/pearlescent.json new file mode 100644 index 0000000000..2c49acbf15 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/pearlescent.json @@ -0,0 +1,21 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:pearlescent_froglight", + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "minecraft:custom_model_data": "item/elite_headwear/pearlescent" + } + } + ] + } + ] + } + ] +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/splitting_skeleton.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/splitting_skeleton.json new file mode 100644 index 0000000000..68ac43f2d4 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/splitting_skeleton.json @@ -0,0 +1,19 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:spawner", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_mu_elite_on_death:{name:splitting_skeleton,id:4}}" + } + ] + } + ] + } + ] +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/splitting_zombie.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/splitting_zombie.json new file mode 100644 index 0000000000..d56b27fa3d --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/splitting_zombie.json @@ -0,0 +1,19 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:spawner", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_mu_elite_on_death:{name:splitting_zombie,id:3}}" + } + ] + } + ] + } + ] +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/volatile.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/volatile.json new file mode 100644 index 0000000000..0d75cacd25 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/volatile.json @@ -0,0 +1,32 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:purple_glazed_terracotta", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_mu_elite_on_death:{name:volatile,id:5}}" + }, + { + "function": "minecraft:set_enchantments", + "enchantments": { + "blast_protection": 10 + }, + "add": true + }, + { + "function": "minecraft:set_components", + "components": { + "minecraft:enchantment_glint_override": false + } + } + ] + } + ] + } + ] +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/vorpal.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/vorpal.json new file mode 100644 index 0000000000..c5f7e8dff4 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/elite/vorpal.json @@ -0,0 +1,19 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:black_wool", + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_mu_elite_on_death:{name:vorpal,id:2}}" + } + ] + } + ] + } + ] +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/mob/equip_armor/spore.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/mob/equip_armor/spore.json new file mode 100644 index 0000000000..682023d45d --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/mob/equip_armor/spore.json @@ -0,0 +1,97 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:cherry_leaves", + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "minecraft:custom_model_data": "item/spore/cherry" + } + } + ], + "conditions": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_spore_zombie.cherry\"]}" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:azalea_leaves", + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "minecraft:custom_model_data": "item/spore/default" + } + } + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.66 + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_spore_zombie.cherry\"]}" + } + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:flowering_azalea_leaves", + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "minecraft:custom_model_data": "item/spore/flowering" + } + } + ], + "conditions": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_mu_spore_zombie.cherry\"]}" + } + } + } + ] + } + ], + "functions": [ + { + "function": "minecraft:set_custom_data", + "tag": "{gm4_mu_spore:{generation:0}}" + }, + { + "function": "minecraft:set_name", + "target": "item_name", + "name": { + "translate": "item.gm4.monsters_unbound.zombie_spore", + "fallback": "Zombie Spore", + "italic": false + } + } + ] + } + ] +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/mob/equip_arrow/skeleton_toxic.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/mob/equip_arrow/skeleton_toxic.json new file mode 100644 index 0000000000..e7dde35b7e --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/mob/equip_arrow/skeleton_toxic.json @@ -0,0 +1,129 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:tipped_arrow", + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "minecraft:potion_contents": { + "custom_color": 8889187, + "custom_effects": [ + { + "id": "minecraft:weakness", + "amplifier": 0, + "duration": 100, + "show_particles": true, + "show_icon": true, + "ambient": false + }, + { + "id": "minecraft:hunger", + "amplifier": 1, + "duration": 100, + "show_particles": true, + "show_icon": true, + "ambient": false + }, + { + "id": "minecraft:poison", + "amplifier": 0, + "duration": 100, + "show_particles": true, + "show_icon": true, + "ambient": false + } + ] + }, + "minecraft:hide_additional_tooltip": {} + } + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "potion.withDuration", + "with": [ + { + "translate": "potion.withAmplifier", + "with": [ + { + "translate": "effect.minecraft.hunger" + }, + { + "translate": "potion.potency.1" + } + ] + }, + "0:05" + ], + "color": "red", + "italic": false + }, + { + "translate": "potion.withDuration", + "with": [ + { + "translate": "effect.minecraft.weakness" + }, + "0:05" + ], + "color": "red", + "italic": false + }, + { + "translate": "potion.withDuration", + "with": [ + { + "translate": "effect.minecraft.poison" + }, + "0:05" + ], + "color": "red", + "italic": false + }, + "", + { + "translate": "potion.whenDrank", + "color": "dark_purple", + "italic": false + }, + { + "translate": "attribute.modifier.take.0", + "with": [ + "4", + { + "translate": "attribute.name.attack_damage" + } + ], + "color": "red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_name", + "target": "item_name", + "name": { + "translate": "item.minecraft.tipped_arrow.effect.poison", + "italic": false + } + }, + { + "function": "minecraft:set_count", + "count": { + "min": 2, + "max": 4 + } + } + ] + } + ] + } + ] +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/mob/equip_arrow/stray_snowy.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/mob/equip_arrow/stray_snowy.json new file mode 100644 index 0000000000..6f47c517ba --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/mob/equip_arrow/stray_snowy.json @@ -0,0 +1,91 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:tipped_arrow", + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "minecraft:potion_contents": { + "custom_color": 9154528, + "custom_effects": [ + { + "id": "minecraft:slowness", + "amplifier": 2, + "duration": 600, + "show_particles": true, + "show_icon": true, + "ambient": false + } + ] + }, + "minecraft:hide_additional_tooltip": {} + } + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "potion.withDuration", + "with": [ + { + "translate": "potion.withAmplifier", + "with": [ + { + "translate": "effect.minecraft.slowness" + }, + { + "translate": "potion.potency.1" + } + ] + }, + "0:30" + ], + "color": "red", + "italic": false + }, + "", + { + "translate": "potion.whenDrank", + "color": "dark_purple", + "italic": false + }, + { + "translate": "attribute.modifier.take.1", + "with": [ + "30", + { + "translate": "attribute.name.movement_speed" + } + ], + "color": "red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_name", + "target": "item_name", + "name": { + "translate": "item.minecraft.tipped_arrow.effect.slowness", + "italic": false + } + }, + { + "function": "minecraft:set_count", + "count": { + "min": 1, + "max": 2 + } + } + ] + } + ] + } + ] +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/mob/equip_arrow/stray_toxic.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/mob/equip_arrow/stray_toxic.json new file mode 100644 index 0000000000..44348ab554 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/loot_table/mob/equip_arrow/stray_toxic.json @@ -0,0 +1,140 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:tipped_arrow", + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "minecraft:potion_contents": { + "custom_color": 8889187, + "custom_effects": [ + { + "id": "minecraft:weakness", + "amplifier": 0, + "duration": 100, + "show_particles": true, + "show_icon": true, + "ambient": false + }, + { + "id": "minecraft:poison", + "amplifier": 1, + "duration": 100, + "show_particles": true, + "show_icon": true, + "ambient": false + }, + { + "id": "minecraft:slowness", + "amplifier": 0, + "duration": 600, + "show_particles": true, + "show_icon": true, + "ambient": false + } + ] + }, + "minecraft:hide_additional_tooltip": {} + } + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "potion.withDuration", + "with": [ + { + "translate": "effect.minecraft.slowness" + }, + "0:30" + ], + "color": "red", + "italic": false + }, + { + "translate": "potion.withDuration", + "with": [ + { + "translate": "potion.withAmplifier", + "with": [ + { + "translate": "effect.minecraft.poison" + }, + { + "translate": "potion.potency.1" + } + ] + }, + "0:05" + ], + "color": "red", + "italic": false + }, + { + "translate": "potion.withDuration", + "with": [ + { + "translate": "effect.minecraft.weakness" + }, + "0:05" + ], + "color": "red", + "italic": false + }, + "", + { + "translate": "potion.whenDrank", + "color": "dark_purple", + "italic": false + }, + { + "translate": "attribute.modifier.take.1", + "with": [ + "15", + { + "translate": "attribute.name.movement_speed" + } + ], + "color": "red", + "italic": false + }, + { + "translate": "attribute.modifier.take.0", + "with": [ + "4", + { + "translate": "attribute.name.attack_damage" + } + ], + "color": "red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_name", + "target": "item_name", + "name": { + "translate": "item.minecraft.tipped_arrow.effect.poison", + "italic": false + } + }, + { + "function": "minecraft:set_count", + "count": { + "min": 2, + "max": 4 + } + } + ] + } + ] + } + ] +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/burned.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/burned.json new file mode 100644 index 0000000000..6dbf35d141 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/burned.json @@ -0,0 +1,23 @@ +[ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/underground" + } + }, + { + "condition": "minecraft:location_check", + "predicate": { + "biomes": [ + "minecraft:desert", + "minecraft:savanna", + "minecraft:savanna_plateau", + "minecraft:windswept_savanna", + "minecraft:badlands", + "minecraft:wooded_badlands", + "minecraft:eroded_badlands" + ] + } + } +] diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/flowering.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/flowering.json new file mode 100644 index 0000000000..0076ffbb3f --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/flowering.json @@ -0,0 +1,35 @@ +[ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:location_check", + "predicate": { + "biomes": "minecraft:lush_caves" + } + }, + { + "condition": "minecraft:all_of", + "terms": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/underground" + } + }, + { + "condition": "minecraft:location_check", + "predicate": { + "biomes": [ + "minecraft:sunflower_plains", + "minecraft:flower_forest", + "minecraft:cherry_grove" + ] + } + } + ] + } + ] + } +] diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/growth.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/growth.json new file mode 100644 index 0000000000..36dc9adb2e --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/growth.json @@ -0,0 +1,23 @@ +[ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/underground" + } + }, + { + "condition": "minecraft:location_check", + "predicate": { + "biomes": [ + "minecraft:snowy_taiga", + "minecraft:grove", + "minecraft:taiga", + "minecraft:old_growth_pine_taiga", + "minecraft:old_growth_spruce_taiga", + "minecraft:dark_forest", + "minecraft:mangrove_swamp" + ] + } + } +] diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/mountainous.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/mountainous.json new file mode 100644 index 0000000000..802689bbf8 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/mountainous.json @@ -0,0 +1,28 @@ +[ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/underground" + } + }, + { + "condition": "minecraft:location_check", + "predicate": { + "biomes": [ + "minecraft:snowy_slopes", + "minecraft:jagged_peaks", + "minecraft:frozen_peaks", + "minecraft:windswept_hills", + "minecraft:windswept_gravelly_hills", + "minecraft:windswept_forest", + "minecraft:stony_shore", + "minecraft:meadow", + "minecraft:stony_peaks", + "minecraft:windswept_savanna", + "minecraft:eroded_badlands", + "minecraft:cherry_grove" + ] + } + } +] diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/reef.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/reef.json new file mode 100644 index 0000000000..5f0551827a --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/reef.json @@ -0,0 +1,28 @@ +[ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/underground" + } + }, + { + "condition": "minecraft:location_check", + "predicate": { + "block": { + "blocks": "#gm4:water" + } + } + } + ] + }, + { + "condition": "minecraft:location_check", + "predicate": { + "biomes": "minecraft:warm_ocean" + } + } +] diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/snowy.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/snowy.json new file mode 100644 index 0000000000..6b9fa961eb --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/snowy.json @@ -0,0 +1,27 @@ +[ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/underground" + } + }, + { + "condition": "minecraft:location_check", + "predicate": { + "biomes": [ + "minecraft:snowy_plains", + "minecraft:ice_spikes", + "minecraft:snowy_taiga", + "minecraft:snowy_beach", + "minecraft:grove", + "minecraft:snowy_slopes", + "minecraft:jagged_peaks", + "minecraft:frozen_peaks", + "minecraft:frozen_river", + "minecraft:frozen_ocean", + "minecraft:deep_frozen_ocean" + ] + } + } +] diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/toxic.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/toxic.json new file mode 100644 index 0000000000..fd294dbc53 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/biome/toxic.json @@ -0,0 +1,20 @@ +[ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/underground" + } + }, + { + "condition": "minecraft:location_check", + "predicate": { + "biomes": [ + "minecraft:swamp", + "minecraft:mangrove_swamp", + "minecraft:jungle", + "minecraft:bamboo_jungle" + ] + } + } +] diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/chance/spawn_phantom.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/chance/spawn_phantom.json new file mode 100644 index 0000000000..3723be3e3d --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/chance/spawn_phantom.json @@ -0,0 +1,18 @@ +[ + { + "condition": "minecraft:random_chance", + "chance": 0.075 + }, + { + "condition": "minecraft:reference", + "name": "gm4_monsters_unbound:biome/mountainous" + }, + { + "condition": "minecraft:time_check", + "value": { + "min": 13188, + "max": 22812 + }, + "period": 24000 + } +] diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/technical/on_fire.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/technical/on_fire.json new file mode 100644 index 0000000000..81903de6b6 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/technical/on_fire.json @@ -0,0 +1,9 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "flags": { + "is_on_fire": true + } + } + } diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/technical/valid_tp.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/technical/valid_tp.json new file mode 100644 index 0000000000..11032fe31d --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/predicate/technical/valid_tp.json @@ -0,0 +1,73 @@ +[ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "offsetY": -1, + "predicate": { + "block": { + "blocks": "#gm4:no_collision" + } + } + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:location_check", + "offsetY": 1, + "predicate": { + "fluid": { + "fluids": "#minecraft:lava" + } + } + }, + { + "condition": "minecraft:location_check", + "predicate": { + "fluid": { + "fluids": "#minecraft:lava" + } + } + }, + { + "condition": "minecraft:location_check", + "offsetY": 1, + "predicate": { + "fluid": { + "fluids": "#minecraft:water" + } + } + }, + { + "condition": "minecraft:location_check", + "predicate": { + "fluid": { + "fluids": "#minecraft:water" + } + } + } + ] + } + }, + { + "condition": "minecraft:location_check", + "offsetY": 1, + "predicate": { + "block": { + "blocks": "#gm4:no_collision" + } + } + }, + { + "condition": "minecraft:location_check", + "predicate": { + "block": { + "blocks": "#gm4:no_collision" + } + } + } +] diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/tags/block/dripstone.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/tags/block/dripstone.json new file mode 100644 index 0000000000..66925de919 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/tags/block/dripstone.json @@ -0,0 +1,6 @@ +{ + "values": [ + "minecraft:dripstone_block", + "minecraft:pointed_dripstone" + ] +} diff --git a/gm4_monsters_unbound/data/gm4_monsters_unbound/tags/entity_type/elite_types.json b/gm4_monsters_unbound/data/gm4_monsters_unbound/tags/entity_type/elite_types.json new file mode 100644 index 0000000000..98d6cd9b42 --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_monsters_unbound/tags/entity_type/elite_types.json @@ -0,0 +1,10 @@ +{ + "values": [ + "minecraft:bogged", + "minecraft:drowned", + "minecraft:husk", + "minecraft:skeleton", + "minecraft:stray", + "minecraft:zombie" + ] +} diff --git a/gm4_monsters_unbound/data/gm4_survival_refightalized/tags/function/init_mob.json b/gm4_monsters_unbound/data/gm4_survival_refightalized/tags/function/init_mob.json new file mode 100644 index 0000000000..4ce5a5586c --- /dev/null +++ b/gm4_monsters_unbound/data/gm4_survival_refightalized/tags/function/init_mob.json @@ -0,0 +1,5 @@ +{ + "values": [ + "gm4_monsters_unbound:mob/init/mob_type" + ] +} diff --git a/gm4_monsters_unbound/images/monsters_unbound.png b/gm4_monsters_unbound/images/monsters_unbound.png new file mode 100644 index 0000000000..113458931d Binary files /dev/null and b/gm4_monsters_unbound/images/monsters_unbound.png differ diff --git a/gm4_monsters_unbound/pack.svg b/gm4_monsters_unbound/pack.svg new file mode 100644 index 0000000000..31dc1698ff --- /dev/null +++ b/gm4_monsters_unbound/pack.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gm4_monsters_unbound/translations.csv b/gm4_monsters_unbound/translations.csv new file mode 100644 index 0000000000..dbd01e78c5 --- /dev/null +++ b/gm4_monsters_unbound/translations.csv @@ -0,0 +1,10 @@ +key,en_us +advancement.gm4.monsters_unbound.elite_kill.title,Elite Hunter +advancement.gm4.monsters_unbound.elite_kill.description,Kill any Elite monster +advancement.gm4.monsters_unbound.elite_kill_all.title,Elites Hunted +advancement.gm4.monsters_unbound.elite_kill_all.description,Kill one of every Elite monster +text.gm4.guidebook.module_desc.monsters_unbound,Use special armor and weapon modifiers to defend against mobs that grow ever stronger. +text.gm4.guidebook.monsters_unbound.description.biomes,Mobs spawned in different biomes have special modifiers.\n\nSome areas and biomes spawn different mobs than usual. +text.gm4.guidebook.monsters_unbound.description.elites,Zombies that spawn as babies or as leaders are replaced with a random Elite variant.\n\nSkeletons have a static 5% chance to be an Elite. +text.gm4.guidebook.monsters_unbound.description.elite_zephyr,"Zephyr Elites can charge a powerful wind-charged attack. Damaging them during the charge time dissipates the charge. Zephyr Zombies will rush the player, Zephyr Skeletons fire a burst of arrows." +item.gm4.monsters_unbound.zombie_spore,Zombie Spore diff --git a/gm4_survival_refightalized/README.md b/gm4_survival_refightalized/README.md new file mode 100644 index 0000000000..73ab8039d2 --- /dev/null +++ b/gm4_survival_refightalized/README.md @@ -0,0 +1,14 @@ +# Survival Refightalized + +Use special weapon and armor modifiers to defend against mobs that grow ever stronger! + +Spore Zombies in Lush Caves + +### Features: +- The longer you stay alive the stronger mobs will become. +- Different biomes grant special buffs to mobs that spawn in them, creating bigger Slimes or Spore Zombies that keep regrowing! +- Weaker Phantoms that take damage if they try to fly into water, as they deserve. +- Mobs will drop new Modified armor and weapons. These come with special attributes that allow you to customize your gear! +- Modifiers range from a ramping speed boost to a loyal immortal dog to fight by your side. Or a piece of armour that teleports you randomly, if that's what you like. + +A full list of all modifiers to mobs, weapons and armor can be found at the [Wiki](https://wiki.gm4.co/Survival_Refightalized). diff --git a/gm4_survival_refightalized/beet.yaml b/gm4_survival_refightalized/beet.yaml new file mode 100644 index 0000000000..4662653841 --- /dev/null +++ b/gm4_survival_refightalized/beet.yaml @@ -0,0 +1,37 @@ +id: gm4_survival_refightalized +name: Survival Refightalized +version: 1.0.X + +data_pack: + load: . + +resource_pack: + load: . + +pipeline: + - gm4.plugins.extend.module + - gm4.plugins.include.lib_forceload + - gm4.plugins.include.lib_lore + +meta: + gm4: + versioning: + required: + lib_forceload: 1.3.0 + lib_lore: 1.1.0 + schedule_loops: + - tick + - main + - slow_clock + website: + description: Use special armor and weapon modifiers to defend against mobs that grow ever stronger. + recommended: + - gm4_monsters_unbound + - gm4_augmented_armor + video: null + wiki: https://wiki.gm4.co/wiki/Survival_Refightalized + credits: + Creator: + - Thanathor + Icon Design: + - Hozz diff --git a/gm4_survival_refightalized/data/gm4/advancement/survival_refightalized_armor_damage.json b/gm4_survival_refightalized/data/gm4/advancement/survival_refightalized_armor_damage.json new file mode 100644 index 0000000000..9a30594664 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4/advancement/survival_refightalized_armor_damage.json @@ -0,0 +1,23 @@ +{ + "display": { + "icon": { + "id": "minecraft:leather_chestplate" + }, + "title": { + "translate": "advancement.gm4.survival_refightalized.armor_damage.title", + "fallback": "Armor Up!" + }, + "description": { + "translate": "advancement.gm4.survival_refightalized.armor_damage.description", + "fallback": "Discover that Armor works a bit differently now", + "color": "gray" + }, + "frame": "task" + }, + "parent": "gm4:root", + "criteria": { + "full_set": { + "trigger": "minecraft:impossible" + } + } +} diff --git a/gm4_survival_refightalized/data/gm4/advancement/survival_refightalized_parry.json b/gm4_survival_refightalized/data/gm4/advancement/survival_refightalized_parry.json new file mode 100644 index 0000000000..1d3a48a513 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4/advancement/survival_refightalized_parry.json @@ -0,0 +1,23 @@ +{ + "display": { + "icon": { + "id": "minecraft:shield" + }, + "title": { + "translate": "advancement.gm4.survival_refightalized.parry.title", + "fallback": "Not Today" + }, + "description": { + "translate": "advancement.gm4.survival_refightalized.parry.description", + "fallback": "Parry with a Shield by blocking just before an attack", + "color": "gray" + }, + "frame": "task" + }, + "parent": "gm4:survival_refightalized_armor_damage", + "criteria": { + "full_set": { + "trigger": "minecraft:impossible" + } + } +} diff --git a/gm4_survival_refightalized/data/gm4/advancement/survival_refightalized_parry_lethal_damage.json b/gm4_survival_refightalized/data/gm4/advancement/survival_refightalized_parry_lethal_damage.json new file mode 100644 index 0000000000..b5b1e77ff7 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4/advancement/survival_refightalized_parry_lethal_damage.json @@ -0,0 +1,27 @@ +{ + "display": { + "icon": { + "id": "minecraft:shield", + "components": { + "minecraft:enchantment_glint_override": true + } + }, + "title": { + "translate": "advancement.gm4.survival_refightalized.parry_lethal_damage.title", + "fallback": "Not Today, Either" + }, + "description": { + "translate": "advancement.gm4.survival_refightalized.parry_lethal_damage.description", + "fallback": "Block lethal damage with a Shield Parry", + "color": "gray" + }, + "frame": "challenge", + "hidden": true + }, + "parent": "gm4:survival_refightalized_parry", + "criteria": { + "full_set": { + "trigger": "minecraft:impossible" + } + } +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/advancement/damaged.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/advancement/damaged.json new file mode 100644 index 0000000000..06cdde48d6 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/advancement/damaged.json @@ -0,0 +1,208 @@ +{ + "criteria": { + "combat_damage": { + "trigger": "minecraft:entity_hurt_player", + "conditions": { + "damage": { + "type": { + "tags": [ + { + "id": "gm4_survival_refightalized:combat", + "expected": true + }, + { + "id": "gm4_survival_refightalized:ignore", + "expected": false + } + ] + } + } + } + }, + "armor_piercing": { + "trigger": "minecraft:entity_hurt_player", + "conditions": { + "damage": { + "type": { + "tags": [ + { + "id": "gm4_survival_refightalized:armor_piercing", + "expected": true + }, + { + "id": "gm4_survival_refightalized:ignore", + "expected": false + } + ] + } + } + } + }, + "armor_piercing_mob": { + "trigger": "minecraft:entity_hurt_player", + "conditions": { + "damage": { + "type": { + "source_entity": { + "nbt": "{Tags:[\"gm4_sr_stat.armor_pierce_attack\"]}" + } + } + } + } + }, + "bypasses_enchantments": { + "trigger": "minecraft:entity_hurt_player", + "conditions": { + "damage": { + "type": { + "tags": [ + { + "id": "minecraft:bypasses_enchantments", + "expected": true + }, + { + "id": "gm4_survival_refightalized:ignore", + "expected": false + } + ] + } + } + } + }, + "is_fire": { + "trigger": "minecraft:entity_hurt_player", + "conditions": { + "damage": { + "type": { + "tags": [ + { + "id": "minecraft:is_fire", + "expected": true + }, + { + "id": "gm4_survival_refightalized:ignore", + "expected": false + } + ] + } + } + } + }, + "is_explosion": { + "trigger": "minecraft:entity_hurt_player", + "conditions": { + "damage": { + "type": { + "tags": [ + { + "id": "minecraft:is_explosion", + "expected": true + }, + { + "id": "gm4_survival_refightalized:ignore", + "expected": false + } + ] + } + } + } + }, + "is_fall": { + "trigger": "minecraft:entity_hurt_player", + "conditions": { + "damage": { + "type": { + "tags": [ + { + "id": "minecraft:is_fall", + "expected": true + }, + { + "id": "gm4_survival_refightalized:ignore", + "expected": false + } + ] + } + } + } + }, + "is_projectile": { + "trigger": "minecraft:entity_hurt_player", + "conditions": { + "damage": { + "type": { + "tags": [ + { + "id": "minecraft:is_projectile", + "expected": true + }, + { + "id": "gm4_survival_refightalized:ignore", + "expected": false + } + ] + } + } + } + }, + "witch": { + "trigger": "minecraft:effects_changed", + "conditions": { + "effects": { + "minecraft:poison": {} + }, + "source": { + "type": "minecraft:witch" + } + } + }, + "cave_spider": { + "trigger": "minecraft:entity_hurt_player", + "conditions": { + "damage": { + "source_entity": { + "type": "minecraft:cave_spider" + }, + "type": { + "tags": [ + { + "id": "gm4_survival_refightalized:ignore", + "expected": false + } + ] + } + } + } + }, + "catch_other": { + "trigger": "minecraft:entity_hurt_player", + "conditions": { + "damage": { + "type": { + "tags": [ + { + "id": "gm4_survival_refightalized:ignore", + "expected": false + } + ] + } + } + } + } + }, + "requirements": [ + [ + "combat_damage", + "armor_piercing", + "armor_piercing_mob", + "bypasses_enchantments", + "is_fire", + "is_fall", + "is_explosion", + "is_projectile", + "witch", + "cave_spider", + "catch_other" + ] + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/advancement/reach_tier/diamond_netherite.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/advancement/reach_tier/diamond_netherite.json new file mode 100644 index 0000000000..21cac2dfc9 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/advancement/reach_tier/diamond_netherite.json @@ -0,0 +1,99 @@ +{ + "criteria": { + "diamond_helmet": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": "minecraft:diamond_helmet" + } + ] + } + }, + "diamond_chestplate": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": "minecraft:diamond_chestplate" + } + ] + } + }, + "diamond_leggings": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": "minecraft:diamond_leggings" + } + ] + } + }, + "diamond_boots": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": "minecraft:diamond_boots" + } + ] + } + }, + "netherite_helmet": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": "minecraft:netherite_helmet" + } + ] + } + }, + "netherite_chestplate": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": "minecraft:netherite_chestplate" + } + ] + } + }, + "netherite_leggings": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": "minecraft:netherite_leggings" + } + ] + } + }, + "netherite_boots": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": "minecraft:netherite_boots" + } + ] + } + } + }, + "requirements": [ + [ + "diamond_helmet", + "diamond_chestplate", + "diamond_leggings", + "diamond_boots", + "netherite_helmet", + "netherite_chestplate", + "netherite_leggings", + "netherite_boots" + ] + ], + "rewards": { + "function": "gm4_survival_refightalized:player/reach_tier/diamond_netherite" + } +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/advancement/reach_tier/iron_golden.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/advancement/reach_tier/iron_golden.json new file mode 100644 index 0000000000..10d70096d3 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/advancement/reach_tier/iron_golden.json @@ -0,0 +1,99 @@ +{ + "criteria": { + "iron_helmet": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": "minecraft:iron_helmet" + } + ] + } + }, + "iron_chestplate": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": "minecraft:iron_chestplate" + } + ] + } + }, + "iron_leggings": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": "minecraft:iron_leggings" + } + ] + } + }, + "iron_boots": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": "minecraft:iron_boots" + } + ] + } + }, + "golden_helmet": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": "minecraft:golden_helmet" + } + ] + } + }, + "golden_chestplate": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": "minecraft:golden_chestplate" + } + ] + } + }, + "golden_leggings": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": "minecraft:golden_leggings" + } + ] + } + }, + "golden_boots": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "items": [ + { + "items": "minecraft:golden_boots" + } + ] + } + } + }, + "requirements": [ + [ + "iron_helmet", + "iron_chestplate", + "iron_leggings", + "iron_boots", + "golden_helmet", + "golden_chestplate", + "golden_leggings", + "golden_boots" + ] + ], + "rewards": { + "function": "gm4_survival_refightalized:player/reach_tier/iron_golden" + } +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/advancement/using_shield.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/advancement/using_shield.json new file mode 100644 index 0000000000..db5846e152 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/advancement/using_shield.json @@ -0,0 +1,15 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:using_item", + "conditions": { + "item": { + "items": "minecraft:shield" + } + } + } + }, + "rewards": { + "function": "gm4_survival_refightalized:player/damage/shield/using" + } +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/check_arrow.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/check_arrow.mcfunction new file mode 100644 index 0000000000..db369a2ced --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/check_arrow.mcfunction @@ -0,0 +1,13 @@ +# check shot arrows +# @s = arrow +# at unspecified +# run from tick + +# tag item as checked and try to process +tag @s add gm4_sr_arrow_checked + +execute store result score $arrow_damage gm4_sr_data run data get entity @s damage 10 +tag @s add gm4_sr_current_arrow +execute on origin if entity @s[type=#gm4_survival_refightalized:can_fire_arrows] run function gm4_survival_refightalized:mob/process/arrow/run +tag @s remove gm4_sr_current_arrow +execute unless score $arrow_damage gm4_sr_data matches 20 store result entity @s damage double 0.1 run scoreboard players get $arrow_damage gm4_sr_data diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/debug/dont_run/dev.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/debug/dont_run/dev.mcfunction new file mode 100644 index 0000000000..31e015e4f1 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/debug/dont_run/dev.mcfunction @@ -0,0 +1,19 @@ +# show stats of the closest modified mob +# @s = modified mob +# at player with gm4_sr_dev.mob_stats tag +# run from player/player_submain + +execute store result score $dev.difficulty gm4_sr_data run scoreboard players get @s gm4_sr_mob.difficulty +execute store result score $dev.health_max gm4_sr_data run attribute @s minecraft:max_health get 1 +execute store result score $dev.health_curr gm4_sr_data run data get entity @s Health +execute store result score $worlddiff gm4_sr_data run difficulty +execute if score $worlddiff gm4_sr_data matches 1 store result score $dev.damage gm4_sr_data run attribute @s minecraft:attack_damage get 77 +execute if score $worlddiff gm4_sr_data matches 2 store result score $dev.damage gm4_sr_data run attribute @s minecraft:attack_damage get 100 +execute if score $worlddiff gm4_sr_data matches 3 store result score $dev.damage gm4_sr_data run attribute @s minecraft:attack_damage get 150 +scoreboard players operation $dev.damage_10 gm4_sr_data = $dev.damage gm4_sr_data +scoreboard players operation $dev.damage_10 gm4_sr_data /= #100 gm4_sr_data +scoreboard players operation $dev.damage_1 gm4_sr_data = $dev.damage gm4_sr_data +scoreboard players operation $dev.damage_1 gm4_sr_data %= #100 gm4_sr_data +execute store result score $dev.speed gm4_sr_data run attribute @s minecraft:movement_speed get 100 +execute at @s run particle firework ~ ~1 ~ 0.2 0.5 0.2 0 3 force @p[tag=gm4_sr_dev.mob_stats] +title @p[tag=gm4_sr_dev.mob_stats] actionbar [{"text":"Diff: ","color":"gray"},{"score":{"name":"$dev.difficulty","objective":"gm4_sr_data"},"color":"white"},{"text":" Health: ","color":"gray"},{"score":{"name":"$dev.health_curr","objective":"gm4_sr_data"},"color":"white"},{"text":"/","color":"white"},{"score":{"name":"$dev.health_max","objective":"gm4_sr_data"},"color":"white"},{"text":" Damage: "},{"score":{"name":"$dev.damage_10","objective":"gm4_sr_data"},"color":"white"},{"text":".","color":"white"},{"score":{"name":"$dev.damage_1","objective":"gm4_sr_data"},"color":"white"},{"text":" Speed: "},{"score":{"name":"$dev.speed","objective":"gm4_sr_data"},"color":"white"}] diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/init.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/init.mcfunction new file mode 100644 index 0000000000..4fd693c9ab --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/init.mcfunction @@ -0,0 +1,79 @@ +execute unless score survival_refightalized gm4_modules matches 1 run data modify storage gm4:log queue append value {type:"install",module:"Survival Refightalized"} +execute unless score survival_refightalized gm4_earliest_version < survival_refightalized gm4_modules run scoreboard players operation survival_refightalized gm4_earliest_version = survival_refightalized gm4_modules +scoreboard players set survival_refightalized gm4_modules 1 + +# scoreboards +scoreboard objectives add gm4_sr_data dummy +scoreboard objectives add gm4_sr_config dummy + +scoreboard objectives add gm4_sr_mob.difficulty dummy +scoreboard objectives add gm4_sr_mob.damage_cap dummy + +scoreboard objectives add gm4_sr_health.restoration dummy +scoreboard objectives add gm4_sr_health.regeneration_timer dummy +scoreboard objectives add gm4_sr_health.absorption_reduction_timer dummy + +scoreboard objectives add gm4_sr_stat.current_health dummy +scoreboard objectives add gm4_sr_stat.max_health dummy +scoreboard objectives add gm4_sr_stat.health_percentage dummy +scoreboard objectives add gm4_sr_stat.current_absorption dummy +scoreboard objectives add gm4_sr_stat.max_absorption dummy + +scoreboard objectives add gm4_sr_stat.armor_recharge_change dummy +scoreboard objectives add gm4_sr_stat.regeneration_rate_change dummy + +scoreboard objectives add gm4_sr_stat.hunger food +scoreboard objectives add gm4_sr_stat.damage_taken custom:damage_taken +scoreboard objectives add gm4_sr_stat.damage_absorbed custom:damage_absorbed +scoreboard objectives add gm4_sr_stat.damage_resisted custom:damage_resisted +scoreboard objectives add gm4_sr_stat.damage_blocked custom:damage_blocked_by_shield +scoreboard objectives add gm4_sr_stat.armor armor +scoreboard objectives add gm4_sr_stat.deaths deathCount + +scoreboard objectives add gm4_sr_armor.tier dummy +scoreboard objectives add gm4_sr_armor.reduction dummy +scoreboard objectives add gm4_sr_armor.reduction_timer dummy + +scoreboard objectives add gm4_sr_arrow.fire_delay dummy +scoreboard objectives add gm4_sr_arrow.fire_delay_left dummy +scoreboard objectives add gm4_sr_arrow.damage_change dummy + +scoreboard objectives add gm4_sr_shield.use_ticks dummy +scoreboard objectives add gm4_sr_shield.timer dummy + +# configs +execute unless score $natural_regen gm4_sr_config matches -2147483648..2147483647 run scoreboard players set $natural_regen gm4_sr_config 1 +execute unless score $combat_regen_timer gm4_sr_config matches -2147483648..2147483647 run scoreboard players set $combat_regen_timer gm4_sr_config 1250 +execute unless score $armor_recharge_timer gm4_sr_config matches -2147483648..2147483647 run scoreboard players set $armor_recharge_timer gm4_sr_config 1250 + +# swap natural regeneration to module's system +execute unless score $natural_regen_disabled gm4_sr_data matches 1 run gamerule naturalRegeneration false +execute unless score $natural_regen_disabled gm4_sr_data matches 1 run data modify storage gm4:log queue append value {type:"text",message:'{"text":"[INFO] Survival Refightalized changed gamerule naturalRegeneration to false"}'} +scoreboard players set $natural_regen_disabled gm4_sr_data 1 +execute store result score $naturalregeneration gm4_sr_data run gamerule naturalRegeneration +execute if score $natural_regen gm4_sr_config matches 1 if score $naturalregeneration gm4_sr_data matches 1 run data modify storage gm4:log queue append value {type:"text",message:'[{"text":"[WARN]","color":"red"},{"text":" Survival Refightalized requires naturalRegeneration to be false, but it is true. ","color":"white"},{"text":"click here to fix","color":"red","clickEvent":{"action":"suggest_command","value":"/gamerule naturalRegeneration false"}}]'} + +# constants +scoreboard players set #-128 gm4_sr_data -128 +scoreboard players set #-50 gm4_sr_data -50 +scoreboard players set #0 gm4_sr_data 0 +scoreboard players set #1 gm4_sr_data 1 +scoreboard players set #2 gm4_sr_data 2 +scoreboard players set #4 gm4_sr_data 4 +scoreboard players set #5 gm4_sr_data 5 +scoreboard players set #8 gm4_sr_data 8 +scoreboard players set #10 gm4_sr_data 10 +scoreboard players set #20 gm4_sr_data 20 +scoreboard players set #25 gm4_sr_data 25 +scoreboard players set #50 gm4_sr_data 50 +scoreboard players set #60 gm4_sr_data 60 +scoreboard players set #80 gm4_sr_data 80 +scoreboard players set #100 gm4_sr_data 100 +scoreboard players set #300 gm4_sr_data 300 +scoreboard players set #1000 gm4_sr_data 1000 +scoreboard players set #1024 gm4_sr_data 1024 + +# start clocks +schedule function gm4_survival_refightalized:tick 1t +schedule function gm4_survival_refightalized:main 2t +schedule function gm4_survival_refightalized:slow_clock 3t diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/main.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/main.mcfunction new file mode 100644 index 0000000000..b666c419b6 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/main.mcfunction @@ -0,0 +1,20 @@ +schedule function gm4_survival_refightalized:main 16t + +# function tag call for expansions to keep clocks sync'd +function #gm4_survival_refightalized:main + +# Inititate newly spawned mobs, as long as they are in the modify entity tag list +execute as @e[type=#gm4_survival_refightalized:modify,tag=!smithed.entity,tag=!gm4_sr_processed,nbt=!{PersistenceRequired:1b}] at @s run function gm4_survival_refightalized:mob/init/check_mob +schedule function gm4_survival_refightalized:mob/init/stat/check_damage_cap_schedule 1t + +# phantoms drown under water +execute as @e[type=phantom,tag=!smithed.entity] at @s if block ~ ~ ~ #gm4:water run damage @s 2 drown + +# restore armor here as well as in player submain to make it happen every 8 ticks +execute as @a[gamemode=!spectator,tag=gm4_sr_armor.reduction,scores={gm4_sr_armor.reduction_timer=..0}] run function gm4_survival_refightalized:player/armor/recharge + +# tick down skeleton arrow fire delay +execute as @e[type=#gm4_survival_refightalized:can_fire_arrows,scores={gm4_sr_arrow.fire_delay_left=1..}] run function gm4_survival_refightalized:mob/process/arrow/tick_fire_delay + +# schedule player submain 8 ticks from now +schedule function gm4_survival_refightalized:player_submain 8t diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/calc_difficulty_else.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/calc_difficulty_else.mcfunction new file mode 100644 index 0000000000..e4b81c1b6e --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/calc_difficulty_else.mcfunction @@ -0,0 +1,20 @@ +# calc base difficulty for this mob and any spawns that originate from it +# @s = mobs that can be buffed +# at @s +# run from mob/init/check_mob + +# get the tier from closest player +scoreboard players operation $armor_tier gm4_sr_data = @p gm4_sr_armor.tier + +# use world difficulty to set base difficulty 10/25/50 +execute store result score $worlddiff gm4_sr_data run difficulty +execute if score $worlddiff gm4_sr_data matches 3 run scoreboard players set $difficulty_base gm4_sr_data 50 +execute if score $worlddiff gm4_sr_data matches 2 run scoreboard players set $difficulty_base gm4_sr_data 25 +execute unless score $worlddiff gm4_sr_data matches 2..3 run scoreboard players set $difficulty_base gm4_sr_data 10 + +# add at random 20-80 +execute store result score $random_add gm4_sr_data run random value 20..80 +scoreboard players operation $difficulty_base gm4_sr_data += $random_add gm4_sr_data + +# the rest of this function will also run for any additional spawns +function gm4_survival_refightalized:mob/init/initiate diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/calc_difficulty_overworld.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/calc_difficulty_overworld.mcfunction new file mode 100644 index 0000000000..7a98364a1e --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/calc_difficulty_overworld.mcfunction @@ -0,0 +1,39 @@ +# calc base difficulty for this mob and any spawns that originate from it +# @s = mobs that can be buffed +# at @s +# run from mob/init/check_mob + +# get the tier from closest player +scoreboard players operation $armor_tier gm4_sr_data = @p gm4_sr_armor.tier + +# use world difficulty to set base difficulty 5/10/20 +execute store result score $worlddiff gm4_sr_data run difficulty +execute if score $worlddiff gm4_sr_data matches 3 run scoreboard players set $difficulty_base gm4_sr_data 20 +execute if score $worlddiff gm4_sr_data matches 2 run scoreboard players set $difficulty_base gm4_sr_data 10 +execute unless score $worlddiff gm4_sr_data matches 2..3 run scoreboard players set $difficulty_base gm4_sr_data 5 + +# not underground + raining +10 +execute if predicate gm4_survival_refightalized:technical/raining run scoreboard players add $difficulty_base gm4_sr_data 10 +# not underground + thundering (will also add the raining modifier) +15 +execute if predicate gm4_survival_refightalized:technical/thundering run scoreboard players add $difficulty_base gm4_sr_data 15 +# night & not underground biome 0-20 based on moon phase +scoreboard players operation $moon_diff_add gm4_sr_data = $moon gm4_sr_data +scoreboard players operation $moon_diff_add gm4_sr_data *= #5 gm4_sr_data +execute unless predicate gm4_survival_refightalized:mob/underground if predicate gm4_survival_refightalized:technical/night_time run scoreboard players operation $difficulty_base gm4_sr_data += $moon_diff_add gm4_sr_data + +# get depth the mob spawned at based on motion_blocking_no_leaves, subtract 16 to shift curve +execute positioned over motion_blocking_no_leaves summon marker run function gm4_survival_refightalized:mob/init/get_world_surface +execute store result score $mob_depth gm4_sr_data run data get entity @s Pos[1] +scoreboard players operation $mob_depth gm4_sr_data -= $world_surface gm4_sr_data +scoreboard players remove $mob_depth gm4_sr_data 16 +scoreboard players operation $mob_depth gm4_sr_data > #-128 gm4_sr_data +scoreboard players operation $mob_depth gm4_sr_data < #0 gm4_sr_data + +# underground quadratic increase +0-80 based on mob depth +scoreboard players operation $mob_depth gm4_sr_data *= $mob_depth gm4_sr_data +scoreboard players operation $mob_depth gm4_sr_data *= #5 gm4_sr_data +scoreboard players operation $mob_depth gm4_sr_data /= #1024 gm4_sr_data +execute if predicate gm4_survival_refightalized:mob/underground if score $mob_depth gm4_sr_data matches 1.. run scoreboard players operation $difficulty_base gm4_sr_data += $mob_depth gm4_sr_data + +# the rest of this function will also run for any additional spawns +function gm4_survival_refightalized:mob/init/initiate diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/check_mob.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/check_mob.mcfunction new file mode 100644 index 0000000000..304fdb8176 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/check_mob.mcfunction @@ -0,0 +1,16 @@ +# initiate newly spawned mobs (mobs without any tags) +# @s = mobs that can be buffed +# at @s +# run from main + +# mark as from a spawner if mob spawned in the air, unless it is expected to +execute if block ~ ~-0.01 ~ #gm4:no_collision run tag @s[type=!#gm4_survival_refightalized:modify_in_air] add gm4_sr_processed + +# remove gm4_sr_processed tag if this mob is riding another mob (spider / chicken jockeys) +scoreboard players set $mounted gm4_sr_data 0 +execute if entity @s[tag=gm4_sr_processed] on vehicle run scoreboard players set $mounted gm4_sr_data 1 +execute if score $mounted gm4_sr_data matches 1 run tag @s remove gm4_sr_processed + +# initiate unless mob is from spawner +execute unless entity @s[tag=gm4_sr_processed] if dimension minecraft:overworld run function gm4_survival_refightalized:mob/init/calc_difficulty_overworld +execute unless entity @s[tag=gm4_sr_processed] unless dimension minecraft:overworld run function gm4_survival_refightalized:mob/init/calc_difficulty_else diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/get_world_surface.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/get_world_surface.mcfunction new file mode 100644 index 0000000000..19f09d95ca --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/get_world_surface.mcfunction @@ -0,0 +1,7 @@ +# get y level of world surface (motion blocking no leaves) +# @s = marker +# at @s +# run from mob/init/calc_difficulty_overworld + +execute store result score $world_surface gm4_sr_data run data get entity @s Pos[1] +kill @s diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/initiate.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/initiate.mcfunction new file mode 100644 index 0000000000..897c4f1812 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/initiate.mcfunction @@ -0,0 +1,49 @@ +# initiate newly spawned mobs (mobs without any tags) +# @s = mobs that can be buffed +# at @s +# run from mob/init/calc_difficulty_else +# run from mob/init/calc_difficulty_overworld + +scoreboard players operation $difficulty gm4_sr_data = $difficulty_base gm4_sr_data + +# apply a random difficulty_mult to nudge difficulty around +execute store result score $difficulty_mult gm4_sr_data run random value -35..35 +scoreboard players operation $difficulty_add gm4_sr_data = $difficulty gm4_sr_data +scoreboard players operation $difficulty_add gm4_sr_data *= $difficulty_mult gm4_sr_data +scoreboard players operation $difficulty_add gm4_sr_data /= #100 gm4_sr_data +scoreboard players operation $difficulty gm4_sr_data += $difficulty_add gm4_sr_data +# apply a random difficulty_flat to nudge difficulty around +execute store result score $difficulty_flat gm4_sr_data run random value -15..15 +scoreboard players operation $difficulty gm4_sr_data += $difficulty_flat gm4_sr_data + +# make sure difficulty is between 0 - 100 +scoreboard players operation $difficulty gm4_sr_data > #0 gm4_sr_data +scoreboard players operation $difficulty gm4_sr_data < #100 gm4_sr_data + +# store difficulty on mob +scoreboard players operation @s gm4_sr_mob.difficulty = $difficulty gm4_sr_data + +# reset scoreboard +scoreboard players reset $mob_extras gm4_sr_data +# initialize different mobs +function gm4_survival_refightalized:mob/init/mob_type +# allow expansions to alter mobs +function #gm4_survival_refightalized:init_mob + +# remove the damage bonus from hard difficulty if needed +execute if score $worlddiff gm4_sr_data matches 3 run attribute @s minecraft:attack_damage modifier add gm4_survival_refightalized:stat_change.hard_difficulty_offset -0.333334 add_multiplied_total + +# set modifiers +execute unless score $removed_mob gm4_sr_data matches 1 run function gm4_survival_refightalized:mob/init/stat/prep +scoreboard players reset $removed_mob gm4_sr_data + +# heal to max health +effect give @s[type=#minecraft:undead] instant_damage 1 20 true +effect give @s[type=!#minecraft:undead] instant_health 1 20 true + +# mark mob as initiated +tag @s add gm4_sr_processed + +# process any spawned mobs +execute if score $mob_extras gm4_sr_data matches 1.. unless entity @s[tag=gm4_sr_extra_mob] as @e[type=#gm4_survival_refightalized:modify,tag=gm4_sr_extra_mob] at @s run function gm4_survival_refightalized:mob/init/initiate +tag @s remove gm4_sr_extra_mob diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type.mcfunction new file mode 100644 index 0000000000..350e54c806 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type.mcfunction @@ -0,0 +1,18 @@ +# check what mob is being processed +# @s = mobs that can be buffed +# at @s +# run from mob/init/initiate + +# zombie, zombie_villager, husk, drowned +execute if entity @s[type=#gm4_survival_refightalized:zombie_types] run return run function gm4_survival_refightalized:mob/init/mob_type/zombie +# skeleton, bogged, stray +execute if entity @s[type=#gm4_survival_refightalized:skeleton_types,type=!wither_skeleton] run return run function gm4_survival_refightalized:mob/init/mob_type/skeleton +execute if entity @s[type=spider] run return run function gm4_survival_refightalized:mob/init/mob_type/spider +execute if entity @s[type=creeper] run return run function gm4_survival_refightalized:mob/init/mob_type/creeper +execute if entity @s[type=cave_spider] run return run function gm4_survival_refightalized:mob/init/mob_type/spider +execute if entity @s[type=enderman] run return run function gm4_survival_refightalized:mob/init/mob_type/enderman +execute if entity @s[type=wither_skeleton] run return run function gm4_survival_refightalized:mob/init/mob_type/wither_skeleton +execute if entity @s[type=phantom] run return run function gm4_survival_refightalized:mob/init/mob_type/phantom +execute if entity @s[type=piglin] run return run function gm4_survival_refightalized:mob/init/mob_type/piglin +execute if entity @s[type=zombified_piglin] run return run function gm4_survival_refightalized:mob/init/mob_type/zombified_piglin +execute if entity @s[type=silverfish] run return run function gm4_survival_refightalized:mob/init/mob_type/silverfish diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/cave_spider.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/cave_spider.mcfunction new file mode 100644 index 0000000000..d0fdae049c --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/cave_spider.mcfunction @@ -0,0 +1,19 @@ +# calculate modifiers for newly spawned cave spider +# @s = cave spider +# at @s +# run from mob/init/mob_type + +# Stat Block (normal/hard diff) +# health: 4 - 12 +# damage: 0.5 - 1.5 +# speed: 90 - 135% + +# base stat nerf +attribute @s minecraft:max_health modifier add gm4_survival_refightalized:stat_change.base_nerf -8 add_value +attribute @s minecraft:attack_damage modifier add gm4_survival_refightalized:stat_change.base_nerf -1.5 add_value +attribute @s minecraft:movement_speed modifier add gm4_survival_refightalized:stat_change.base_nerf -0.1 add_multiplied_base + +# max stat buffs +scoreboard players set $mob_health gm4_sr_data 8 +scoreboard players set $mob_damage gm4_sr_data 10 +scoreboard players set $mob_speed gm4_sr_data 45 diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/creeper.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/creeper.mcfunction new file mode 100644 index 0000000000..0ab9b4594f --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/creeper.mcfunction @@ -0,0 +1,18 @@ +# calculate modifiers for newly spawned creeper +# @s = creeper +# at @s +# run from mob/init/mob_type + +# Stat Block (normal/hard diff) +# health: 12 - 24 +# damage: explosion +# speed: 90 - 125% + +# base stat nerf +attribute @s minecraft:max_health modifier add gm4_survival_refightalized:stat_change.base_nerf -8 add_value +attribute @s minecraft:movement_speed modifier add gm4_survival_refightalized:stat_change.base_nerf -0.1 add_value + +# max stat buffs +scoreboard players set $mob_health gm4_sr_data 12 +scoreboard players set $mob_damage gm4_sr_data 0 +scoreboard players set $mob_speed gm4_sr_data 35 diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/enderman.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/enderman.mcfunction new file mode 100644 index 0000000000..c341033b53 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/enderman.mcfunction @@ -0,0 +1,18 @@ +# calculate modifiers for newly spawned enderman +# @s = enderman +# at @s +# run from mob/init/mob_type + +# Stat Block (normal/hard diff) +# health: 40 - 55 +# damage: 5 - 8 +# speed: 90 - 125% + +# base stat nerf +attribute @s minecraft:attack_damage modifier add gm4_survival_refightalized:stat_change.base_nerf -2 add_value +attribute @s minecraft:movement_speed modifier add gm4_survival_refightalized:stat_change.base_nerf -0.1 add_multiplied_base + +# max stat buffs +scoreboard players set $mob_health gm4_sr_data 15 +scoreboard players set $mob_damage gm4_sr_data 30 +scoreboard players set $mob_speed gm4_sr_data 35 diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/phantom.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/phantom.mcfunction new file mode 100644 index 0000000000..abcd1e5497 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/phantom.mcfunction @@ -0,0 +1,18 @@ +# calculate modifiers for newly spawned phantom +# @s = phantom +# at @s +# run from mob/init/mob_type + +# Stat Block (normal/hard diff) +# health: 4 - 16 +# damage: 1.5 - 4 +# speed: 100% + +# base stat nerf +attribute @s minecraft:max_health modifier add gm4_survival_refightalized:stat_change.base_nerf -16 add_value +attribute @s minecraft:attack_damage modifier add gm4_survival_refightalized:stat_change.base_nerf -0.5 add_value + +# max stat buffs +scoreboard players set $mob_health gm4_sr_data 12 +scoreboard players set $mob_damage gm4_sr_data 35 +scoreboard players set $mob_speed gm4_sr_data 0 diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/piglin.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/piglin.mcfunction new file mode 100644 index 0000000000..938e0e8b91 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/piglin.mcfunction @@ -0,0 +1,30 @@ +# calculate modifiers for newly spawned piglin +# @s = piglin +# at @s +# run from mob/init/mob_type + +# Stat Block (normal/hard diff) +# health: 16 - 32 +# damage: 5 - 7 (melee), 2 - 4 (unarmed) +# speed: 80 - 115% + +# base stat nerf +attribute @s minecraft:attack_damage modifier add gm4_survival_refightalized:stat_change.base_nerf -3 add_value +attribute @s minecraft:movement_speed modifier add gm4_survival_refightalized:stat_change.base_nerf -0.2 add_multiplied_base + +# max stat buffs +scoreboard players set $mob_health gm4_sr_data 16 +scoreboard players set $mob_damage gm4_sr_data 20 +scoreboard players set $mob_speed gm4_sr_data 35 +# max damage mob is allowed to deal in one hit (to deal with weapons) +scoreboard players set @s gm4_sr_mob.damage_cap 70 +tag @s add gm4_sr_check_damage_cap + +# set armor +scoreboard players set $override_equipment gm4_sr_data 0 +function #gm4_survival_refightalized:equip/piglin +execute if score $override_equipment gm4_sr_data matches 1 run return 1 +loot replace entity @s armor.feet loot gm4_survival_refightalized:mob/piglin/feet +loot replace entity @s armor.legs loot gm4_survival_refightalized:mob/piglin/legs +loot replace entity @s armor.chest loot gm4_survival_refightalized:mob/piglin/chest +loot replace entity @s armor.head loot gm4_survival_refightalized:mob/piglin/head diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/silverfish.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/silverfish.mcfunction new file mode 100644 index 0000000000..1f2abe339d --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/silverfish.mcfunction @@ -0,0 +1,32 @@ +# calculate modifiers for newly spawned silverfish +# @s = silverfish +# at @s +# run from mob/init/mob_type + +# Stat Block (normal/hard diff) +# health: 1 - 6 +# damage: 1 - 2.5 +# speed: 80 - 120% + +# base stat nerf +attribute @s minecraft:max_health modifier add gm4_survival_refightalized:stat_change.base_nerf -7 add_value +attribute @s minecraft:movement_speed modifier add gm4_survival_refightalized:stat_change.base_nerf -0.2 add_multiplied_total + +# max stat buffs +scoreboard players set $mob_health gm4_sr_data 5 +scoreboard players set $mob_damage gm4_sr_data 15 +scoreboard players set $mob_speed gm4_sr_data 40 + +# size changes +execute store result score $size_change gm4_sr_data run random value 1..100 +# normal (+20% speed) +execute if score $size_change gm4_sr_data matches ..50 run attribute @s minecraft:movement_speed modifier add gm4_survival_refightalized:stat_change.random_scale 0.2 add_multiplied_total +# medium (+0.25 scale) +execute if score $size_change gm4_sr_data matches 51..75 run attribute @s minecraft:scale modifier add gm4_survival_refightalized:stat_change.random_scale 0.25 add_value +# large (+0.5 scale, +2 health) +execute if score $size_change gm4_sr_data matches 76..90 run attribute @s minecraft:scale modifier add gm4_survival_refightalized:stat_change.random_scale 0.5 add_value +execute if score $size_change gm4_sr_data matches 76..90 run attribute @s minecraft:max_health modifier add gm4_survival_refightalized:stat_change.random_scale 2 add_value +# giant (+0.75 scale, +4 health, +1 damage) +execute if score $size_change gm4_sr_data matches 90..100 run attribute @s minecraft:scale modifier add gm4_survival_refightalized:stat_change.random_scale 0.75 add_value +execute if score $size_change gm4_sr_data matches 90..100 run attribute @s minecraft:max_health modifier add gm4_survival_refightalized:stat_change.random_scale 4 add_value +execute if score $size_change gm4_sr_data matches 90..100 run attribute @s minecraft:attack_damage modifier add gm4_survival_refightalized:stat_change.random_scale 1 add_value diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/skeleton.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/skeleton.mcfunction new file mode 100644 index 0000000000..e230b25585 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/skeleton.mcfunction @@ -0,0 +1,37 @@ +# calculate modifiers for newly spawned skeleton / stray / bogged +# @s = skeleton / stray / bogged +# at @s +# run from mob/init/mob_type + +# Stat Block (normal/hard diff) +# health: 9 - 22 +# damage: 2 - 6.5 (cap 7) +# speed: 75 - 105% + +# base stat nerf +attribute @s minecraft:max_health modifier add gm4_survival_refightalized:stat_change.base_nerf -11 add_value +attribute @s minecraft:movement_speed modifier add gm4_survival_refightalized:stat_change.base_nerf -0.25 add_multiplied_base + +# max stat buffs +scoreboard players set $mob_health gm4_sr_data 13 +scoreboard players set $mob_damage gm4_sr_data 45 +scoreboard players set $mob_speed gm4_sr_data 30 +# max damage mob is allowed to deal in one hit (to deal with weapons) +scoreboard players set @s gm4_sr_mob.damage_cap 70 +tag @s add gm4_sr_check_damage_cap + +# arrow damage - only set if it was not preset at spawning +execute unless score @s gm4_sr_arrow.damage_change matches -2147483648..2147483647 store result score @s gm4_sr_arrow.damage_change run random value -4..4 +execute unless score @s gm4_sr_arrow.fire_delay matches -2147483648..2147483647 store result score @s gm4_sr_arrow.damage_change run random value -4..4 + +# set weapon +loot replace entity @s[tag=!gm4_sr_melee_skeleton] weapon.mainhand loot gm4_survival_refightalized:mob/skeleton/weapon + +# set armor +scoreboard players set $override_equipment gm4_sr_data 0 +function #gm4_survival_refightalized:equip/skeleton +execute if score $override_equipment gm4_sr_data matches 1 run return 1 +loot replace entity @s armor.feet loot gm4_survival_refightalized:mob/generic/feet +loot replace entity @s armor.legs loot gm4_survival_refightalized:mob/generic/legs +loot replace entity @s armor.chest loot gm4_survival_refightalized:mob/generic/chest +loot replace entity @s armor.head loot gm4_survival_refightalized:mob/generic/head diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/spider.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/spider.mcfunction new file mode 100644 index 0000000000..2e9d3c0594 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/spider.mcfunction @@ -0,0 +1,18 @@ +# calculate modifiers for newly spawned spider +# @s = spider +# at @s +# run from mob/init/mob_type + +# Stat Block (normal/hard diff) +# health: 12 - 30 +# damage: 2 - 5.5 +# speed: 95 - 145% + +# base stat nerf +attribute @s minecraft:max_health modifier add gm4_survival_refightalized:stat_change.base_nerf -4 add_value +attribute @s minecraft:movement_speed modifier add gm4_survival_refightalized:stat_change.base_nerf -0.05 add_multiplied_base + +# max stat buffs +scoreboard players set $mob_health gm4_sr_data 18 +scoreboard players set $mob_damage gm4_sr_data 35 +scoreboard players set $mob_speed gm4_sr_data 50 diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/wither_skeleton.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/wither_skeleton.mcfunction new file mode 100644 index 0000000000..924596927e --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/wither_skeleton.mcfunction @@ -0,0 +1,44 @@ +# calculate modifiers for newly spawned wither skeleton +# @s = wither skeleton +# at @s +# run from mob/init/mob_type + +# Stat Block (normal/hard diff) +# health: 22 - 36 +# damage: 6.5 - 8.5 (armed), 0.5 - 2.5 (unarmed) +# speed: 95 - 120% + +# base stat nerf +attribute @s minecraft:max_health modifier add gm4_survival_refightalized:stat_change.base_buff 2 add_value +attribute @s minecraft:attack_damage modifier add gm4_survival_refightalized:stat_change.base_nerf -1.5 add_value +attribute @s minecraft:movement_speed modifier add gm4_survival_refightalized:stat_change.base_nerf -0.05 add_multiplied_base + +# max stat buffs +scoreboard players set $mob_health gm4_sr_data 14 +scoreboard players set $mob_damage gm4_sr_data 20 +scoreboard players set $mob_speed gm4_sr_data 25 +# max damage mob is allowed to deal in one hit (to deal with weapons) +scoreboard players set @s gm4_sr_mob.damage_cap 85 +tag @s add gm4_sr_check_damage_cap + +# knockback resistance +attribute @s minecraft:knockback_resistance modifier add gm4_survival_refightalized:stat_change.kb_resist 0.666 add_value + +# set weapon +loot replace entity @s weapon.mainhand loot gm4_survival_refightalized:mob/wither_skeleton/weapon + +# withering arrow if a bow is held +execute if data entity @s HandItems[{id:"minecraft:bow"}] run loot replace entity @s weapon.offhand loot gm4_survival_refightalized:mob/wither_skeleton/arrow + +# shoot arrows slower and weaker +scoreboard players set @s gm4_sr_arrow.fire_delay 4 +execute store result score @s gm4_sr_arrow.damage_change run random value -6..0 + +# set armor +scoreboard players set $override_equipment gm4_sr_data 0 +function #gm4_survival_refightalized:equip/wither_skeleton +execute if score $override_equipment gm4_sr_data matches 1 run return 1 +loot replace entity @s armor.feet loot gm4_survival_refightalized:mob/wither_skeleton/feet +loot replace entity @s armor.legs loot gm4_survival_refightalized:mob/wither_skeleton/legs +loot replace entity @s armor.chest loot gm4_survival_refightalized:mob/wither_skeleton/chest +loot replace entity @s armor.head loot gm4_survival_refightalized:mob/wither_skeleton/head diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/zombie.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/zombie.mcfunction new file mode 100644 index 0000000000..8805944bfc --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/zombie.mcfunction @@ -0,0 +1,41 @@ +# calculate modifiers for newly spawned zombie / zombie villager / husk / drowned +# @s = zombie / zombie villager / husk / drowned +# at @s +# run from mob/init/mob_type + +# Stat Block (normal/hard diff) +# health: 18 - 36 +# damage: 3 - 6.5 (cap 8) +# speed: 80 - 120% + +# base stat nerf +attribute @s minecraft:max_health modifier add gm4_survival_refightalized:stat_change.base_nerf -2 add_value +attribute @s minecraft:movement_speed modifier add gm4_survival_refightalized:stat_change.base_nerf -0.2 add_multiplied_base + +# max stat buffs +scoreboard players set $mob_health gm4_sr_data 18 +scoreboard players set $mob_damage gm4_sr_data 35 +scoreboard players set $mob_speed gm4_sr_data 40 +# max damage mob is allowed to deal in one hit (to deal with weapons) +scoreboard players set @s gm4_sr_mob.damage_cap 80 +tag @s add gm4_sr_check_damage_cap + +# add fire delay to drowned for tridents +scoreboard players set @s[type=drowned] gm4_sr_arrow.fire_delay 10 + +# remove leader bonus from zombies +execute if data entity @s attributes[{id:"minecraft:max_health"}].modifiers[{id:"minecraft:leader_zombie_bonus"}] run attribute @s minecraft:max_health modifier remove minecraft:leader_zombie_bonus + +# remove baby zombies (will be turned into Elites with Monsters Unbound) +scoreboard players set $was_baby gm4_sr_data 0 +execute if data entity @s {IsBaby:1b} store success score $was_baby gm4_sr_data run data modify entity @s IsBaby set value 0b +execute if score $was_baby gm4_sr_data matches 1 run tag @s add gm4_sr_was_baby + +# set armor +scoreboard players set $override_equipment gm4_sr_data 0 +function #gm4_survival_refightalized:equip/zombie +execute if score $override_equipment gm4_sr_data matches 1 run return 1 +loot replace entity @s armor.feet loot gm4_survival_refightalized:mob/generic/feet +loot replace entity @s armor.legs loot gm4_survival_refightalized:mob/generic/legs +loot replace entity @s armor.chest loot gm4_survival_refightalized:mob/generic/chest +loot replace entity @s armor.head loot gm4_survival_refightalized:mob/generic/head diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/zombified_piglin.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/zombified_piglin.mcfunction new file mode 100644 index 0000000000..8c0ad7ddb4 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/mob_type/zombified_piglin.mcfunction @@ -0,0 +1,25 @@ +# calculate modifiers for newly spawned zombified piglin +# @s = zombified piglin +# at @s +# run from mob/init/mob_type + +# Stat Block (normal/hard diff) +# health: 14 - 20 +# damage: 3.5 - 5 (armed), 0.5 - 2 (unarmed) +# speed: 90 - 140% + +# base stat nerf +attribute @s minecraft:max_health modifier add gm4_survival_refightalized:stat_change.base_nerf -6 add_value +attribute @s minecraft:attack_damage modifier add gm4_survival_refightalized:stat_change.base_nerf -4.5 add_value +attribute @s minecraft:movement_speed modifier add gm4_survival_refightalized:stat_change.base_nerf -0.1 add_multiplied_base + +# max stat buffs +scoreboard players set $mob_health gm4_sr_data 18 +scoreboard players set $mob_damage gm4_sr_data 15 +scoreboard players set $mob_speed gm4_sr_data 50 +# max damage mob is allowed to deal in one hit (to deal with weapons) +scoreboard players set @s gm4_sr_mob.damage_cap 60 +tag @s add gm4_sr_check_damage_cap + +# remove zombie leader bonus +execute if data entity @s attributes[{id:"minecraft:max_health"}].modifiers[{id:"minecraft:leader_zombie_bonus"}] run attribute @s minecraft:max_health modifier remove minecraft:leader_zombie_bonus diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/stat/check_damage_cap.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/stat/check_damage_cap.mcfunction new file mode 100644 index 0000000000..50054a3177 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/stat/check_damage_cap.mcfunction @@ -0,0 +1,13 @@ +# cap damage mobs can do +# @s = mob with gm4_sr_check_damage_cap tag +# at unspecified +# run from mob/init/modifier/check_damage_cap_schedule + +tag @s remove gm4_sr_check_damage_cap + +# check if damage did not exceed the cap, otherwise reduce to get back to it +execute if score $worlddiff gm4_sr_data matches ..2 store result score $mob_total_damage gm4_sr_data run attribute @s minecraft:attack_damage get 10 +execute if score $worlddiff gm4_sr_data matches 3 store result score $mob_total_damage gm4_sr_data run attribute @s minecraft:attack_damage get 15 +execute store result storage gm4_survival_refightalized:temp picked_stat.damage_capped float 0.1 run scoreboard players operation @s gm4_sr_mob.damage_cap -= $mob_total_damage gm4_sr_data +execute if score @s gm4_sr_mob.damage_cap matches ..-1 run function gm4_survival_refightalized:mob/init/stat/eval_damage_cap with storage gm4_survival_refightalized:temp picked_stat +data remove storage gm4_survival_refightalized:temp picked_stat diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/stat/check_damage_cap_schedule.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/stat/check_damage_cap_schedule.mcfunction new file mode 100644 index 0000000000..cf62294032 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/stat/check_damage_cap_schedule.mcfunction @@ -0,0 +1,6 @@ +# schedule damage cap check 1t later to allow mainhand changes to apply +# @s = unspecified +# at unspecified +# schedule from main + +execute as @e[tag=gm4_sr_check_damage_cap] run function gm4_survival_refightalized:mob/init/stat/check_damage_cap diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/stat/eval.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/stat/eval.mcfunction new file mode 100644 index 0000000000..125f1c8913 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/stat/eval.mcfunction @@ -0,0 +1,8 @@ +# evaluate stats +# @s = mobs that can be buffed +# at @s +# run from mob/init/modifier/stat/prep + +$execute if score $mob_health gm4_sr_data matches 1.. run attribute @s minecraft:max_health modifier add gm4_survival_refightalized:stat_change.difficulty_buff $(health) add_value +$execute if score $mob_damage gm4_sr_data matches 1.. run attribute @s minecraft:attack_damage modifier add gm4_survival_refightalized:stat_change.difficulty_buff $(damage) add_value +$execute if score $mob_speed gm4_sr_data matches 1.. run attribute @s minecraft:movement_speed modifier add gm4_survival_refightalized:stat_change.difficulty_buff $(speed) add_multiplied_base diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/stat/eval_damage_cap.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/stat/eval_damage_cap.mcfunction new file mode 100644 index 0000000000..3dab7775fb --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/stat/eval_damage_cap.mcfunction @@ -0,0 +1,7 @@ +# cap damage to this mobs cap +# @s = mobs that can be buffed +# at @s +# run from mob/init/modifier/check_damage_cap + +$attribute @s attack_damage modifier add gm4_survival_refightalized:stat_change.damage_cap_reduction $(damage_capped) add_value +tag @s add gm4_sr_mob.damage_capped diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/stat/prep.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/stat/prep.mcfunction new file mode 100644 index 0000000000..b5da266527 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/init/stat/prep.mcfunction @@ -0,0 +1,29 @@ +# apply biome-specific modifiers randomize the stats +# @s = mobs that can be buffed +# at @s +# run from mob/init/mob_type + +# remove bonus health if enderman spawned in end +execute if entity @s[type=enderman] if dimension the_end run scoreboard players set $mob_health gm4_sr_data 0 +# remove bonus damage if weapon is held +execute if predicate gm4_survival_refightalized:mob/has_weapon run scoreboard players set $mob_damage gm4_sr_data 0 + +# randomise stats - set values between 0 and current value based on: +# HEALTH = 0.5*score + BINOMDIST(n=0.5*score,p=0.5) +execute if score $mob_health gm4_sr_data matches 1.. store result score $mob_health gm4_sr_data run loot spawn 29999998 1 7133 loot gm4_survival_refightalized:randomize_stats/health +# DAMAGE = 0.15*score + RANDOM(0 - 0.35*score) + BINOMDIST(n=0.5*score,p=0.5) +execute if score $mob_damage gm4_sr_data matches 1.. store result score $mob_damage gm4_sr_data run loot spawn 29999998 1 7133 loot gm4_survival_refightalized:randomize_stats/damage +# SPEED = RANDOM(0 - 0.5*score) + BINOMDIST(n=0.5*score,p=0.5) +execute if score $mob_speed gm4_sr_data matches 1.. store result score $mob_speed gm4_sr_data run loot spawn 29999998 1 7133 loot gm4_survival_refightalized:randomize_stats/speed + +# store modifiers modified by difficulty +execute store result storage gm4_survival_refightalized:temp picked_stat.health float 0.01 run scoreboard players operation $mob_health gm4_sr_data *= $difficulty gm4_sr_data +execute store result storage gm4_survival_refightalized:temp picked_stat.damage float 0.001 run scoreboard players operation $mob_damage gm4_sr_data *= $difficulty gm4_sr_data +execute store result storage gm4_survival_refightalized:temp picked_stat.speed float 0.0001 run scoreboard players operation $mob_speed gm4_sr_data *= $difficulty gm4_sr_data + +# evaluate stats and add modifiers to mob +function gm4_survival_refightalized:mob/init/stat/eval with storage gm4_survival_refightalized:temp picked_stat +data remove storage gm4_survival_refightalized:temp picked_stat + +# TODO: remove (spigot bug) +execute positioned 29999998 1 7133 run kill @e[type=item,distance=..2] diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/process/arrow/run.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/process/arrow/run.mcfunction new file mode 100644 index 0000000000..9db46d2f84 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/process/arrow/run.mcfunction @@ -0,0 +1,14 @@ +# modify shot arrows +# @s = arrow +# at unspecified +# run from check_arrow + +# if origin is a player run function tag for expansions +execute if entity @s[type=player] run return run function #gm4_survival_refightalized:fired_arrow + +# | Non-players: +# add damage to arrow +scoreboard players operation $arrow_damage gm4_sr_data += @s gm4_sr_arrow.damage_change +# add fire delay +scoreboard players operation @s gm4_sr_arrow.fire_delay_left = @s gm4_sr_arrow.fire_delay +attribute @s[scores={gm4_sr_arrow.fire_delay_left=1..}] minecraft:follow_range modifier add gm4_survival_refightalized:arrow_fire_delay -1 add_multiplied_total diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/process/arrow/tick_fire_delay.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/process/arrow/tick_fire_delay.mcfunction new file mode 100644 index 0000000000..7bbc4cfc2b --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/mob/process/arrow/tick_fire_delay.mcfunction @@ -0,0 +1,7 @@ +# tick down arrow fire delay +# @s = entity that shot an arrow +# at unspecified +# run from main + +scoreboard players remove @s gm4_sr_arrow.fire_delay_left 1 +attribute @s[scores={gm4_sr_arrow.fire_delay_left=0}] minecraft:follow_range modifier remove gm4_survival_refightalized:arrow_fire_delay diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/absorption/eval_reduction.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/absorption/eval_reduction.mcfunction new file mode 100644 index 0000000000..0274feb2a7 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/absorption/eval_reduction.mcfunction @@ -0,0 +1,11 @@ +# reduce absorption hearts on player based on their score +# @s = damaged player +# at @s +# run from player/health/damaged/calculate_reduction + +$attribute @s max_absorption modifier add gm4_sr_absorption_reduced -$(absorption_reduction) add_value +# restore absorption cap after 4 ticks to let it remove the health +scoreboard players set @s gm4_sr_health.absorption_reduction_timer 3 +schedule function gm4_survival_refightalized:player/absorption/restore_clock 1t + +scoreboard players reset $damage_absorption gm4_sr_data diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/absorption/restore_clock.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/absorption/restore_clock.mcfunction new file mode 100644 index 0000000000..9983421393 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/absorption/restore_clock.mcfunction @@ -0,0 +1,9 @@ +# restore absorption hearts cap +# @s = unspecified +# at unspecified +# schedule from player/health/damaged/eval_absorption_reduction + +execute as @a[scores={gm4_sr_health.absorption_reduction_timer=1}] run attribute @s minecraft:max_absorption modifier remove gm4_sr_absorption_reduced +scoreboard players remove @a[scores={gm4_sr_health.absorption_reduction_timer=1..}] gm4_sr_health.absorption_reduction_timer 1 + +execute if entity @a[scores={gm4_sr_health.absorption_reduction_timer=1..}] run schedule function gm4_survival_refightalized:player/absorption/restore_clock 1t diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/break.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/break.mcfunction new file mode 100644 index 0000000000..c139117ce1 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/break.mcfunction @@ -0,0 +1,7 @@ + +playsound minecraft:entity.armor_stand.break player @a[distance=..8] ~ ~ ~ 0.66 0 0.5 +function gm4_survival_refightalized:player/resistance/remove +function #gm4_survival_refightalized:armor_break + +# set damage taken to the amount of armor remaining so it gets removed +scoreboard players operation $damage_armor gm4_sr_data = $player_armor gm4_sr_data diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/check.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/check.mcfunction new file mode 100644 index 0000000000..2371cbfde0 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/check.mcfunction @@ -0,0 +1,30 @@ +# set damage on armor item +# @s = player wearing the item +# at unspecified +# + +# get item data +item replace block 29999998 1 7134 container.0 from entity @s armor.head +item replace block 29999998 1 7134 container.1 from entity @s armor.chest +item replace block 29999998 1 7134 container.2 from entity @s armor.legs +item replace block 29999998 1 7134 container.3 from entity @s armor.feet +data modify storage gm4_survival_refightalized:temp Items set from block 29999998 1 7134 Items + +execute if items block 29999998 1 7134 container.0 * run function gm4_survival_refightalized:player/armor/durability/head/run +execute if items block 29999998 1 7134 container.1 * run function gm4_survival_refightalized:player/armor/durability/chest/run +execute if items block 29999998 1 7134 container.2 * run function gm4_survival_refightalized:player/armor/durability/legs/run +execute if items block 29999998 1 7134 container.3 * run function gm4_survival_refightalized:player/armor/durability/feet/run + +# stopsounds +stopsound @s player item.armor.equip_chain +stopsound @s player item.armor.equip_diamond +stopsound @s player item.armor.equip_generic +stopsound @s player item.armor.equip_gold +stopsound @s player item.armor.equip_iron +stopsound @s player item.armor.equip_leather +stopsound @s player item.armor.equip_netherite +stopsound @s player item.armor.equip_turtle + +# cleanup +data remove block 29999998 1 7134 Items +data remove storage gm4_survival_refightalized:temp Items diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/chest/break.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/chest/break.mcfunction new file mode 100644 index 0000000000..7fb2e00356 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/chest/break.mcfunction @@ -0,0 +1,3 @@ + +playsound minecraft:entity.item.break player @s ~ ~ ~ 1 1 +item replace entity @s armor.chest with air diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/chest/eval.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/chest/eval.mcfunction new file mode 100644 index 0000000000..742d8486b1 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/chest/eval.mcfunction @@ -0,0 +1,6 @@ +# set damage on armor item +# @s = player wearing the item +# at unspecified +# + +$item modify entity @s armor.chest {function:"minecraft:set_components",components:{"minecraft:damage":$(damage)}} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/chest/find_durability.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/chest/find_durability.mcfunction new file mode 100644 index 0000000000..dce66418b5 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/chest/find_durability.mcfunction @@ -0,0 +1,11 @@ +# set damage on armor item +# @s = player wearing the item +# at unspecified +# + +execute if items block 29999998 1 7134 container.1 leather_chestplate run return 80 +execute if items block 29999998 1 7134 container.1 golden_chestplate run return 112 +execute if items block 29999998 1 7134 container.1 chainmail_chestplate run return 240 +execute if items block 29999998 1 7134 container.1 iron_chestplate run return 240 +execute if items block 29999998 1 7134 container.1 diamond_chestplate run return 528 +execute if items block 29999998 1 7134 container.1 netherite_chestplate run return 592 diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/chest/run.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/chest/run.mcfunction new file mode 100644 index 0000000000..9c0f054ed7 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/chest/run.mcfunction @@ -0,0 +1,35 @@ + +# if unbreakable don't run +execute if data storage gm4_survival_refightalized:temp Items[{Slot:1b}].components."minecraft:unbreakable" run return 0 + +# calculate incoming damage based on unbreaking +execute store result score $unbreaking_level gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:1b}].components."minecraft:enchantments".levels."minecraft:unbreaking" +scoreboard players add $unbreaking_level gm4_sr_data 1 +scoreboard players set $damage_chance gm4_sr_data 100 +scoreboard players operation $damage_chance gm4_sr_data /= $unbreaking_level gm4_sr_data +scoreboard players set $damage_opportunities gm4_sr_data 1 +execute store result score $incoming_damage gm4_sr_data run loot spawn 29999998 1 7133 loot gm4_survival_refightalized:technical/roll_damage +# TODO: remove (spigot bug) +execute positioned 29999998 1 7133 run kill @e[type=item,distance=..2] + +# if no damage is going to be applied cancel function +execute unless score $incoming_damage gm4_sr_data matches 1.. run return 0 + +# find the total durability of this item +execute store result score $total_durability gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:1b}].components."minecraft:max_damage" +execute if score $total_durability gm4_sr_data matches 0 store result score $total_durability gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:1b}].components."minecraft:custom_data".gm4_augmented_armor.durability +execute if score $total_durability gm4_sr_data matches 0 store result score $total_durability gm4_sr_data run function gm4_survival_refightalized:player/armor/durability/chest/find_durability +execute if score $total_durability gm4_sr_data matches 0 run return 0 + +# add incoming damage to the current damage +execute store result score $current_damage gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:1b}].components."minecraft:damage" +scoreboard players operation $current_damage gm4_sr_data += $incoming_damage gm4_sr_data +execute if score $current_damage gm4_sr_data > $total_durability gm4_sr_data run return run function gm4_survival_refightalized:player/armor/durability/chest/break + +# apply to armor +execute store result storage gm4_survival_refightalized:temp set.damage int 1 run scoreboard players get $current_damage gm4_sr_data +function gm4_survival_refightalized:player/armor/durability/chest/eval with storage gm4_survival_refightalized:temp set + +# cleanup +data remove storage gm4_survival_refightalized:temp set +scoreboard players reset $total_durability gm4_sr_data diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/feet/break.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/feet/break.mcfunction new file mode 100644 index 0000000000..834c76ef5c --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/feet/break.mcfunction @@ -0,0 +1,3 @@ + +playsound minecraft:entity.item.break player @s ~ ~ ~ 1 1 +item replace entity @s armor.feet with air diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/feet/eval.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/feet/eval.mcfunction new file mode 100644 index 0000000000..19ccd8dd17 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/feet/eval.mcfunction @@ -0,0 +1,6 @@ +# set damage on armor item +# @s = player wearing the item +# at unspecified +# + +$item modify entity @s armor.feet {function:"minecraft:set_components",components:{"minecraft:damage":$(damage)}} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/feet/find_durability.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/feet/find_durability.mcfunction new file mode 100644 index 0000000000..6f37fd2656 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/feet/find_durability.mcfunction @@ -0,0 +1,11 @@ +# set damage on armor item +# @s = player wearing the item +# at unspecified +# + +execute if items block 29999998 1 7134 container.3 leather_boots run return 65 +execute if items block 29999998 1 7134 container.3 golden_boots run return 91 +execute if items block 29999998 1 7134 container.3 chainmail_boots run return 195 +execute if items block 29999998 1 7134 container.3 iron_boots run return 195 +execute if items block 29999998 1 7134 container.3 diamond_boots run return 429 +execute if items block 29999998 1 7134 container.3 netherite_boots run return 481 diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/feet/run.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/feet/run.mcfunction new file mode 100644 index 0000000000..90eea48116 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/feet/run.mcfunction @@ -0,0 +1,35 @@ + +# if unbreakable don't run +execute if data storage gm4_survival_refightalized:temp Items[{Slot:3b}].components."minecraft:unbreakable" run return 0 + +# calculate incoming damage based on unbreaking +execute store result score $unbreaking_level gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:3b}].components."minecraft:enchantments".levels."minecraft:unbreaking" +scoreboard players add $unbreaking_level gm4_sr_data 1 +scoreboard players set $damage_chance gm4_sr_data 100 +scoreboard players operation $damage_chance gm4_sr_data /= $unbreaking_level gm4_sr_data +scoreboard players set $damage_opportunities gm4_sr_data 1 +execute store result score $incoming_damage gm4_sr_data run loot spawn 29999998 1 7133 loot gm4_survival_refightalized:technical/roll_damage +# TODO: remove (spigot bug) +execute positioned 29999998 1 7133 run kill @e[type=item,distance=..2] + +# if no damage is going to be applied cancel function +execute unless score $incoming_damage gm4_sr_data matches 1.. run return 0 + +# find the total durability of this item +execute store result score $total_durability gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:3b}].components."minecraft:max_damage" +execute if score $total_durability gm4_sr_data matches 0 store result score $total_durability gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:3b}].components."minecraft:custom_data".gm4_augmented_armor.durability +execute if score $total_durability gm4_sr_data matches 0 store result score $total_durability gm4_sr_data run function gm4_survival_refightalized:player/armor/durability/feet/find_durability +execute if score $total_durability gm4_sr_data matches 0 run return 0 + +# add incoming damage to the current damage +execute store result score $current_damage gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:3b}].components."minecraft:damage" +scoreboard players operation $current_damage gm4_sr_data += $incoming_damage gm4_sr_data +execute if score $current_damage gm4_sr_data > $total_durability gm4_sr_data run return run function gm4_survival_refightalized:player/armor/durability/feet/break + +# apply to armor +execute store result storage gm4_survival_refightalized:temp set.damage int 1 run scoreboard players get $current_damage gm4_sr_data +function gm4_survival_refightalized:player/armor/durability/feet/eval with storage gm4_survival_refightalized:temp set + +# cleanup +data remove storage gm4_survival_refightalized:temp set +scoreboard players reset $total_durability gm4_sr_data diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/head/break.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/head/break.mcfunction new file mode 100644 index 0000000000..a267dec32d --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/head/break.mcfunction @@ -0,0 +1,3 @@ + +playsound minecraft:entity.item.break player @s ~ ~ ~ 1 1 +item replace entity @s armor.head with air diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/head/eval.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/head/eval.mcfunction new file mode 100644 index 0000000000..f725ae0442 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/head/eval.mcfunction @@ -0,0 +1,6 @@ +# set damage on armor item +# @s = player wearing the item +# at unspecified +# + +$item modify entity @s armor.head {function:"minecraft:set_components",components:{"minecraft:damage":$(damage)}} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/head/find_durability.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/head/find_durability.mcfunction new file mode 100644 index 0000000000..021ff7262a --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/head/find_durability.mcfunction @@ -0,0 +1,12 @@ +# set damage on armor item +# @s = player wearing the item +# at unspecified +# + +execute if items block 29999998 1 7134 container.0 leather_helmet run return 55 +execute if items block 29999998 1 7134 container.0 golden_helmet run return 77 +execute if items block 29999998 1 7134 container.0 chainmail_helmet run return 165 +execute if items block 29999998 1 7134 container.0 iron_helmet run return 165 +execute if items block 29999998 1 7134 container.0 diamond_helmet run return 363 +execute if items block 29999998 1 7134 container.0 netherite_helmet run return 407 +execute if items block 29999998 1 7134 container.0 turtle_helmet run return 275 diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/head/run.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/head/run.mcfunction new file mode 100644 index 0000000000..3749474af1 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/head/run.mcfunction @@ -0,0 +1,35 @@ + +# if unbreakable don't run +execute if data storage gm4_survival_refightalized:temp Items[{Slot:0b}].components."minecraft:unbreakable" run return 0 + +# calculate incoming damage based on unbreaking +execute store result score $unbreaking_level gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:0b}].components."minecraft:enchantments".levels."minecraft:unbreaking" +scoreboard players add $unbreaking_level gm4_sr_data 1 +scoreboard players set $damage_chance gm4_sr_data 100 +scoreboard players operation $damage_chance gm4_sr_data /= $unbreaking_level gm4_sr_data +scoreboard players set $damage_opportunities gm4_sr_data 1 +execute store result score $incoming_damage gm4_sr_data run loot spawn 29999998 1 7133 loot gm4_survival_refightalized:technical/roll_damage +# TODO: remove (spigot bug) +execute positioned 29999998 1 7133 run kill @e[type=item,distance=..2] + +# if no damage is going to be applied cancel function +execute unless score $incoming_damage gm4_sr_data matches 1.. run return 0 + +# find the total durability of this item +execute store result score $total_durability gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:0b}].components."minecraft:max_damage" +execute if score $total_durability gm4_sr_data matches 0 store result score $total_durability gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:0b}].components."minecraft:custom_data".gm4_augmented_armor.durability +execute if score $total_durability gm4_sr_data matches 0 store result score $total_durability gm4_sr_data run function gm4_survival_refightalized:player/armor/durability/head/find_durability +execute if score $total_durability gm4_sr_data matches 0 run return 0 + +# add incoming damage to the current damage +execute store result score $current_damage gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:0b}].components."minecraft:damage" +scoreboard players operation $current_damage gm4_sr_data += $incoming_damage gm4_sr_data +execute if score $current_damage gm4_sr_data > $total_durability gm4_sr_data run return run function gm4_survival_refightalized:player/armor/durability/head/break + +# apply to armor +execute store result storage gm4_survival_refightalized:temp set.damage int 1 run scoreboard players get $current_damage gm4_sr_data +function gm4_survival_refightalized:player/armor/durability/head/eval with storage gm4_survival_refightalized:temp set + +# cleanup +data remove storage gm4_survival_refightalized:temp set +scoreboard players reset $total_durability gm4_sr_data diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/legs/break.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/legs/break.mcfunction new file mode 100644 index 0000000000..e139d1f81e --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/legs/break.mcfunction @@ -0,0 +1,3 @@ + +playsound minecraft:entity.item.break player @s ~ ~ ~ 1 1 +item replace entity @s armor.legs with air diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/legs/eval.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/legs/eval.mcfunction new file mode 100644 index 0000000000..69e4e0a063 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/legs/eval.mcfunction @@ -0,0 +1,6 @@ +# set damage on armor item +# @s = player wearing the item +# at unspecified +# + +$item modify entity @s armor.legs {function:"minecraft:set_components",components:{"minecraft:damage":$(damage)}} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/legs/find_durability.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/legs/find_durability.mcfunction new file mode 100644 index 0000000000..aea6efd4a8 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/legs/find_durability.mcfunction @@ -0,0 +1,11 @@ +# set damage on armor item +# @s = player wearing the item +# at unspecified +# + +execute if items block 29999998 1 7134 container.2 leather_leggings run return 75 +execute if items block 29999998 1 7134 container.2 golden_leggings run return 105 +execute if items block 29999998 1 7134 container.2 chainmail_leggings run return 225 +execute if items block 29999998 1 7134 container.2 iron_leggings run return 225 +execute if items block 29999998 1 7134 container.2 diamond_leggings run return 495 +execute if items block 29999998 1 7134 container.2 netherite_leggings run return 555 diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/legs/run.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/legs/run.mcfunction new file mode 100644 index 0000000000..e16a5551c4 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/durability/legs/run.mcfunction @@ -0,0 +1,35 @@ + +# if unbreakable don't run +execute if data storage gm4_survival_refightalized:temp Items[{Slot:2b}].components."minecraft:unbreakable" run return 0 + +# calculate incoming damage based on unbreaking +execute store result score $unbreaking_level gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:2b}].components."minecraft:enchantments".levels."minecraft:unbreaking" +scoreboard players add $unbreaking_level gm4_sr_data 1 +scoreboard players set $damage_chance gm4_sr_data 100 +scoreboard players operation $damage_chance gm4_sr_data /= $unbreaking_level gm4_sr_data +scoreboard players set $damage_opportunities gm4_sr_data 1 +execute store result score $incoming_damage gm4_sr_data run loot spawn 29999998 1 7133 loot gm4_survival_refightalized:technical/roll_damage +# TODO: remove (spigot bug) +execute positioned 29999998 1 7133 run kill @e[type=item,distance=..2] + +# if no damage is going to be applied cancel function +execute unless score $incoming_damage gm4_sr_data matches 1.. run return 0 + +# find the total durability of this item +execute store result score $total_durability gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:2b}].components."minecraft:max_damage" +execute if score $total_durability gm4_sr_data matches 0 store result score $total_durability gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:2b}].components."minecraft:custom_data".gm4_augmented_armor.durability +execute if score $total_durability gm4_sr_data matches 0 store result score $total_durability gm4_sr_data run function gm4_survival_refightalized:player/armor/durability/legs/find_durability +execute if score $total_durability gm4_sr_data matches 0 run return 0 + +# add incoming damage to the current damage +execute store result score $current_damage gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:2b}].components."minecraft:damage" +scoreboard players operation $current_damage gm4_sr_data += $incoming_damage gm4_sr_data +execute if score $current_damage gm4_sr_data > $total_durability gm4_sr_data run return run function gm4_survival_refightalized:player/armor/durability/legs/break + +# apply to armor +execute store result storage gm4_survival_refightalized:temp set.damage int 1 run scoreboard players get $current_damage gm4_sr_data +function gm4_survival_refightalized:player/armor/durability/legs/eval with storage gm4_survival_refightalized:temp set + +# cleanup +data remove storage gm4_survival_refightalized:temp set +scoreboard players reset $total_durability gm4_sr_data diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/eval_reduction.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/eval_reduction.mcfunction new file mode 100644 index 0000000000..f4d92209f9 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/eval_reduction.mcfunction @@ -0,0 +1,9 @@ +# reduce armor on player based on their score +# @s = damaged player +# at @s +# run from player/health/damaged/calculate_reduction +# run from player/health/regain_armor + +attribute @s minecraft:armor modifier remove gm4_survival_refightalized:armor_reduced +$attribute @s armor modifier add gm4_survival_refightalized:armor_reduced -$(armor_reduction) add_value +tag @s add gm4_sr_armor.reduction diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/recharge.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/recharge.mcfunction new file mode 100644 index 0000000000..b3f16f56f7 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/recharge.mcfunction @@ -0,0 +1,23 @@ +# regain 1 armor for this player +# @s = player with reduced armor +# at unspecified +# run from main +# run from player/process + +# only run if health is full +function gm4_survival_refightalized:player/health/calculate_hp +execute unless score @s gm4_sr_stat.health_percentage matches 100.. run return 0 + +scoreboard players remove @s[scores={gm4_sr_armor.reduction=1..}] gm4_sr_armor.reduction 10 +scoreboard players operation @s gm4_sr_armor.reduction > #0 gm4_sr_data + +# if no armor reduction is left don't apply armor +attribute @s[scores={gm4_sr_armor.reduction=..0}] minecraft:armor modifier remove gm4_survival_refightalized:armor_reduced +execute if entity @s[scores={gm4_sr_armor.reduction=..0}] run return run tag @s remove gm4_sr_armor.reduction + +execute store result storage gm4_survival_refightalized:temp set.armor_reduction float 0.1 run scoreboard players get @s gm4_sr_armor.reduction +function gm4_survival_refightalized:player/armor/eval_reduction with storage gm4_survival_refightalized:temp set +data remove storage gm4_survival_refightalized:temp set + +# reapply resistance +effect give @s resistance 2 255 true diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/timer.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/timer.mcfunction new file mode 100644 index 0000000000..cf64e7eaf4 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/armor/timer.mcfunction @@ -0,0 +1,7 @@ + +# gm4_sr_stat.armor_recharge_change is normally 0, but can be changed by expansions +scoreboard players set $armor_recharge gm4_sr_data 100 +scoreboard players operation $armor_recharge gm4_sr_data += @s gm4_sr_stat.armor_recharge_change +scoreboard players operation $armor_recharge gm4_sr_data > #0 gm4_sr_data +scoreboard players operation @s[scores={gm4_sr_armor.reduction_timer=1..}] gm4_sr_armor.reduction_timer -= $armor_recharge gm4_sr_data +execute unless score @s gm4_sr_armor.reduction_timer matches 1.. run function gm4_survival_refightalized:player/armor/recharge diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/calculate_damage.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/calculate_damage.mcfunction new file mode 100644 index 0000000000..1a8c7a3841 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/calculate_damage.mcfunction @@ -0,0 +1,48 @@ + +# make sure at least 1 damage is dealt +scoreboard players operation $damage_total gm4_sr_data > #1 gm4_sr_data +tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":"Real Damage Taken (x10): ","color":"gray"},{"score":{"name":"$damage_total","objective":"gm4_sr_data"},"color":"white"}] + +# | Armor +scoreboard players operation $damage_armor gm4_sr_data += $damage_total gm4_sr_data +# if damage pierces armor no effect +execute unless entity @s[advancements={gm4_survival_refightalized:damaged={armor_piercing=false,armor_piercing_mob=false}}] run scoreboard players set $damage_armor gm4_sr_data 0 +# if armor is reduced to below 1 play sound and remove resistance effect on player +execute store result score $player_armor gm4_sr_data run attribute @s minecraft:armor get 10 +scoreboard players operation $armor_check gm4_sr_data = $player_armor gm4_sr_data +scoreboard players operation $armor_check gm4_sr_data -= $damage_armor gm4_sr_data +execute if score $armor_check gm4_sr_data matches ..9 run function gm4_survival_refightalized:player/armor/break +# calc the reduction in armor that should be applied +execute store result storage gm4_survival_refightalized:temp set.armor_reduction float 0.1 run scoreboard players operation @s gm4_sr_armor.reduction += $damage_armor gm4_sr_data +# any leftover damage is applied to the players absorption and health +scoreboard players operation $damage_left gm4_sr_data = $damage_total gm4_sr_data +scoreboard players operation $damage_left gm4_sr_data -= $damage_armor gm4_sr_data + +# | Absorption +# get scores +scoreboard players operation $current_absorption_hearts gm4_sr_data = @s gm4_sr_stat.current_absorption +scoreboard players operation $current_absorption_max gm4_sr_data = @s gm4_sr_stat.max_absorption +# apply leftover damge to absorption first +scoreboard players operation $damage_absorption gm4_sr_data += $damage_left gm4_sr_data +scoreboard players operation $damage_absorption gm4_sr_data < $current_absorption_hearts gm4_sr_data +scoreboard players operation $current_absorption_hearts gm4_sr_data -= $damage_absorption gm4_sr_data +# set storage to the amount of reduction of max absorption needed to get to the new absorption total +execute store result storage gm4_survival_refightalized:temp set.absorption_reduction float 0.1 run scoreboard players operation $current_absorption_max gm4_sr_data -= $current_absorption_hearts gm4_sr_data + +# | Health +scoreboard players operation $damage_left gm4_sr_data -= $damage_absorption gm4_sr_data +scoreboard players operation $damage_health gm4_sr_data += $damage_left gm4_sr_data + +# | Damage the player +# armor +execute if score $damage_armor gm4_sr_data matches 1.. run tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":" > Armor: ","color":"gray"},{"score":{"name":"$damage_armor","objective":"gm4_sr_data"},"color":"white"}] +execute if score $damage_armor gm4_sr_data matches 1.. run function gm4_survival_refightalized:player/armor/eval_reduction with storage gm4_survival_refightalized:temp set +# absorption hearts +execute if score $damage_absorption gm4_sr_data matches 1.. run tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":" > Absorption: ","color":"gray"},{"score":{"name":"$damage_absorption","objective":"gm4_sr_data"},"color":"white"}] +execute if score $damage_absorption gm4_sr_data matches 1.. run function gm4_survival_refightalized:player/absorption/eval_reduction with storage gm4_survival_refightalized:temp set +# red hearts +execute if score $damage_health gm4_sr_data matches 1.. run tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":" > Health: ","color":"gray"},{"score":{"name":"$damage_health","objective":"gm4_sr_data"},"color":"white"}] +execute if score $damage_health gm4_sr_data matches 1.. run function gm4_survival_refightalized:player/health/reduce/activate + +# advancement +execute if score $damage_armor gm4_sr_data matches 1.. run advancement grant @s only gm4:survival_refightalized_armor_damage diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/calculate_reduction.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/calculate_reduction.mcfunction new file mode 100644 index 0000000000..e3c7c8875d --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/calculate_reduction.mcfunction @@ -0,0 +1,41 @@ +# calculate damage reduction based on different factors - if armor is worn +# @s = damaged player +# at @s +# run from player/health/damaged/run + +# grab active effects to check for resistance later - can be skipped if this was already done for cave spider poison reduction +execute unless data storage gm4_survival_refightalized:temp active_effects run data modify storage gm4_survival_refightalized:temp active_effects set from entity @s active_effects + +# don't run if this resistance level is not due to armor (as the player will already have taken the damage) +# this should generally not run, and is mostly here as a fail-safe +execute store result score $resistance_level gm4_sr_data run data get storage gm4_survival_refightalized:temp active_effects[{id:"minecraft:resistance"}].amplifier +execute unless score $resistance_level gm4_sr_data matches -1 run return run scoreboard players reset @s gm4_sr_stat.damage_resisted + +# dev damage log +tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":"Base Damage Taken (x10): ","color":"gray"},{"score":{"name":"@s","objective":"gm4_sr_stat.damage_resisted"},"color":"white"}] + +# transfer damage resistance to damage to health score +scoreboard players operation $damage_total gm4_sr_data = @s gm4_sr_stat.damage_resisted + +# first check the resistance level besides from this module +# if this results in 100% damage reduction skip the rest of this function +execute store success score $resistance_damage_reduction gm4_sr_data if data storage gm4_survival_refightalized:temp active_effects[{id:"minecraft:resistance"}].hidden_effect.duration +execute if score $resistance_damage_reduction gm4_sr_data matches 1 store result score $resistance_damage_reduction gm4_sr_data run data get storage gm4_survival_refightalized:temp active_effects[{id:"minecraft:resistance"}].hidden_effect.amplifier 20 +execute if score $resistance_damage_reduction gm4_sr_data matches 1.. run scoreboard players add $resistance_damage_reduction gm4_sr_data 20 +execute unless score $resistance_damage_reduction gm4_sr_data matches 0..99 run return run data remove storage gm4_survival_refightalized:temp active_effects + +# | Reduce damage taken based on +# /!\ order for these is important! +# 1. armor toughness (only if player still has armor) +execute store result score $armor_toughness gm4_sr_data run attribute @s minecraft:armor_toughness get +execute if score $armor_toughness gm4_sr_data matches 1.. if score @s gm4_sr_stat.armor matches 1.. run function gm4_survival_refightalized:player/damage/reduction/armor_toughness + +# 2. enchantments +execute if entity @s[advancements={gm4_survival_refightalized:damaged={bypasses_enchantments=false}}] run function gm4_survival_refightalized:player/damage/reduction/enchantments/run + +# 3. resistance effect (uses highest level besides the one used for this module) +scoreboard players operation $resistance_damage_reduction_percentage gm4_sr_data = $resistance_damage_reduction gm4_sr_data +scoreboard players operation $resistance_damage_reduction gm4_sr_data *= $damage_total gm4_sr_data +scoreboard players operation $resistance_damage_reduction gm4_sr_data /= #100 gm4_sr_data +scoreboard players operation $damage_total gm4_sr_data -= $resistance_damage_reduction gm4_sr_data +execute if score $resistance_damage_reduction gm4_sr_data matches 1.. run tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":"Resistance: ","color":"gray"},{"text":"-","color":"white"},{"score":{"name":"$resistance_damage_reduction","objective":"gm4_sr_data"},"color":"white"},{"text":" = "},{"score":{"name":"$damage_total","objective":"gm4_sr_data"},"color":"white"},{"text":" (","color":"dark_gray"},{"score":{"name":"$resistance_damage_reduction_percentage","objective":"gm4_sr_data"},"color":"dark_gray"},{"text":"%)","color":"dark_gray"}] diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/cave_spider_poison_reduction.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/cave_spider_poison_reduction.mcfunction new file mode 100644 index 0000000000..a89d443c5b --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/cave_spider_poison_reduction.mcfunction @@ -0,0 +1,22 @@ +# reduce poison duration from cave spider attacks +# @s = damaged player +# at @s +# run from player/health/damaged/run + +# dont run on easy, no poison applied +execute store result score $worlddiff gm4_sr_data run difficulty +execute if score $worlddiff gm4_sr_data matches 1 run return 0 + +# get effect data +data modify storage gm4_survival_refightalized:temp active_effects set from entity @s active_effects +execute store result score $poison.amplifier gm4_sr_data run data get storage gm4_survival_refightalized:temp active_effects[{id:"minecraft:poison"}].amplifier +execute store result score $poison.duration gm4_sr_data run data get storage gm4_survival_refightalized:temp active_effects[{id:"minecraft:poison"}].duration + +# dont run if there is a stronger poison running +execute unless score $poison.amplifier gm4_sr_data matches 0 run return 0 +execute unless score $poison.duration gm4_sr_data matches 299 unless score $poison.duration gm4_sr_data matches 139 run return 0 + +# reapply weaker poison, 1 damage for normal, 2 damage for hard +effect clear @s poison +execute if score $worlddiff gm4_sr_data matches 2 run effect give @s poison 2 0 +execute if score $worlddiff gm4_sr_data matches 3 run effect give @s poison 4 0 diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/reduction/armor_toughness.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/reduction/armor_toughness.mcfunction new file mode 100644 index 0000000000..60f3f8d4a4 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/reduction/armor_toughness.mcfunction @@ -0,0 +1,32 @@ +# reduce damage with armor toughness +# @s = damaged player +# at @s +# run from player/health/damaged/calculate_reduction + +# Formula: +# Damage reduction percentage = (damage * armor_toughness * 50) / ( damage * armor_toughness + 3500 ) + +# dividend = damage * armor_toughness * 50 +scoreboard players operation $armor_toughness.dividend gm4_sr_data = $damage_total gm4_sr_data +scoreboard players operation $armor_toughness.dividend gm4_sr_data *= $armor_toughness gm4_sr_data +scoreboard players operation $armor_toughness.dividend gm4_sr_data *= #50 gm4_sr_data + +# divisor = damage * armor_toughness + 3500 +scoreboard players operation $armor_toughness.divisor gm4_sr_data = $damage_total gm4_sr_data +scoreboard players operation $armor_toughness.divisor gm4_sr_data *= $armor_toughness gm4_sr_data +scoreboard players add $armor_toughness.divisor gm4_sr_data 3500 + +# dividend / divisor (this rounds down!), can max reduce damage by 25% +scoreboard players operation $armor_toughness.dividend gm4_sr_data /= $armor_toughness.divisor gm4_sr_data +scoreboard players operation $armor_toughness.dividend gm4_sr_data < #25 gm4_sr_data + +# get damage reduction +scoreboard players operation $armor_toughness_effect gm4_sr_data = $damage_total gm4_sr_data +scoreboard players operation $armor_toughness_effect gm4_sr_data *= $armor_toughness.dividend gm4_sr_data +scoreboard players operation $armor_toughness_effect gm4_sr_data /= #100 gm4_sr_data + +# reduce damage taken +scoreboard players operation $damage_total gm4_sr_data -= $armor_toughness_effect gm4_sr_data + +# dev damage log +tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":"Armor Toughness: ","color":"gray"},{"text":"-","color":"white"},{"score":{"name":"$armor_toughness_effect","objective":"gm4_sr_data"},"color":"white"},{"text":" = ","color":"gray"},{"score":{"name":"$damage_total","objective":"gm4_sr_data"},"color":"white"},{"text":" (","color":"dark_gray"},{"score":{"name":"$armor_toughness.dividend","objective":"gm4_sr_data"},"color":"dark_gray"},{"text":"%)","color":"dark_gray"}] diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/reduction/enchantments/blast_protection.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/reduction/enchantments/blast_protection.mcfunction new file mode 100644 index 0000000000..abc92dc984 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/reduction/enchantments/blast_protection.mcfunction @@ -0,0 +1,16 @@ +# reduce damage with blast protection +# @s = damaged player +# at @s +# run from player/health/damaged/enchantments + +execute store result score $enchant.blast_protection gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:0b}].components."minecraft:enchantments".levels."minecraft:blast_protection" 4 +execute store result score $enchant.blast_protection.add gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:1b}].components."minecraft:enchantments".levels."minecraft:blast_protection" 4 +scoreboard players operation $enchant.blast_protection gm4_sr_data += $enchant.blast_protection.add gm4_sr_data +execute store result score $enchant.blast_protection.add gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:2b}].components."minecraft:enchantments".levels."minecraft:blast_protection" 4 +scoreboard players operation $enchant.blast_protection gm4_sr_data += $enchant.blast_protection.add gm4_sr_data +execute store result score $enchant.blast_protection.add gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:3b}].components."minecraft:enchantments".levels."minecraft:blast_protection" 4 +scoreboard players operation $enchant.blast_protection gm4_sr_data += $enchant.blast_protection.add gm4_sr_data + +execute if score $enchant.damage_reduction gm4_sr_data matches 0 if score $enchant.blast_protection gm4_sr_data matches 1.. run tellraw @s[tag=gm4_sr_dev.damage_log] {"text":"Enchantments:","color":"gray"} +scoreboard players operation $enchant.damage_reduction gm4_sr_data += $enchant.blast_protection gm4_sr_data +execute if score $enchant.blast_protection gm4_sr_data matches 1.. run tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":" > Blast Protection: ","color":"gray"},{"score":{"name":"$enchant.blast_protection","objective":"gm4_sr_data"},"color":"white"},{"text":"%","color":"white"}] diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/reduction/enchantments/feather_falling.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/reduction/enchantments/feather_falling.mcfunction new file mode 100644 index 0000000000..333a71c89b --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/reduction/enchantments/feather_falling.mcfunction @@ -0,0 +1,16 @@ +# reduce damage with feather falling +# @s = damaged player +# at @s +# run from player/health/damaged/enchantments + +execute store result score $enchant.feather_falling gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:0b}].components."minecraft:enchantments".levels."minecraft:feather_falling" 12 +execute store result score $enchant.feather_falling.add gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:1b}].components."minecraft:enchantments".levels."minecraft:feather_falling" 12 +scoreboard players operation $enchant.feather_falling gm4_sr_data += $enchant.feather_falling.add gm4_sr_data +execute store result score $enchant.feather_falling.add gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:2b}].components."minecraft:enchantments".levels."minecraft:feather_falling" 12 +scoreboard players operation $enchant.feather_falling gm4_sr_data += $enchant.feather_falling.add gm4_sr_data +execute store result score $enchant.feather_falling.add gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:3b}].components."minecraft:enchantments".levels."minecraft:feather_falling" 12 +scoreboard players operation $enchant.feather_falling gm4_sr_data += $enchant.feather_falling.add gm4_sr_data + +execute if score $enchant.damage_reduction gm4_sr_data matches 0 if score $enchant.feather_falling gm4_sr_data matches 1.. run tellraw @s[tag=gm4_sr_dev.damage_log] {"text":"Enchantments:","color":"gray"} +scoreboard players operation $enchant.damage_reduction gm4_sr_data += $enchant.feather_falling gm4_sr_data +execute if score $enchant.feather_falling gm4_sr_data matches 1.. run tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":" > Feather Falling: ","color":"gray"},{"score":{"name":"$enchant.feather_falling","objective":"gm4_sr_data"},"color":"white"},{"text":"%","color":"white"}] diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/reduction/enchantments/fire_protection.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/reduction/enchantments/fire_protection.mcfunction new file mode 100644 index 0000000000..a9715186cb --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/reduction/enchantments/fire_protection.mcfunction @@ -0,0 +1,16 @@ +# reduce damage with fire protection +# @s = damaged player +# at @s +# run from player/health/damaged/enchantments + +execute store result score $enchant.fire_protection gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:0b}].components."minecraft:enchantments".levels."minecraft:fire_protection" 4 +execute store result score $enchant.fire_protection.add gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:1b}].components."minecraft:enchantments".levels."minecraft:fire_protection" 4 +scoreboard players operation $enchant.fire_protection gm4_sr_data += $enchant.fire_protection.add gm4_sr_data +execute store result score $enchant.fire_protection.add gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:2b}].components."minecraft:enchantments".levels."minecraft:fire_protection" 4 +scoreboard players operation $enchant.fire_protection gm4_sr_data += $enchant.fire_protection.add gm4_sr_data +execute store result score $enchant.fire_protection.add gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:3b}].components."minecraft:enchantments".levels."minecraft:fire_protection" 4 +scoreboard players operation $enchant.fire_protection gm4_sr_data += $enchant.fire_protection.add gm4_sr_data + +execute if score $enchant.damage_reduction gm4_sr_data matches 0 if score $enchant.fire_protection gm4_sr_data matches 1.. run tellraw @s[tag=gm4_sr_dev.damage_log] {"text":"Enchantments:","color":"gray"} +scoreboard players operation $enchant.damage_reduction gm4_sr_data += $enchant.fire_protection gm4_sr_data +execute if score $enchant.fire_protection gm4_sr_data matches 1.. run tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":" > Fire Protection: ","color":"gray"},{"score":{"name":"$enchant.fire_protection","objective":"gm4_sr_data"},"color":"white"},{"text":"%","color":"white"}] diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/reduction/enchantments/projectile_protection.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/reduction/enchantments/projectile_protection.mcfunction new file mode 100644 index 0000000000..122cecf099 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/reduction/enchantments/projectile_protection.mcfunction @@ -0,0 +1,16 @@ +# reduce damage with projectile protection +# @s = damaged player +# at @s +# run from player/health/damaged/enchantments + +execute store result score $enchant.projectile_protection gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:0b}].components."minecraft:enchantments".levels."minecraft:projectile_protection" 4 +execute store result score $enchant.projectile_protection.add gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:1b}].components."minecraft:enchantments".levels."minecraft:projectile_protection" 4 +scoreboard players operation $enchant.projectile_protection gm4_sr_data += $enchant.projectile_protection.add gm4_sr_data +execute store result score $enchant.projectile_protection.add gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:2b}].components."minecraft:enchantments".levels."minecraft:projectile_protection" 4 +scoreboard players operation $enchant.projectile_protection gm4_sr_data += $enchant.projectile_protection.add gm4_sr_data +execute store result score $enchant.projectile_protection.add gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:3b}].components."minecraft:enchantments".levels."minecraft:projectile_protection" 4 +scoreboard players operation $enchant.projectile_protection gm4_sr_data += $enchant.projectile_protection.add gm4_sr_data + +execute if score $enchant.damage_reduction gm4_sr_data matches 0 if score $enchant.projectile_protection gm4_sr_data matches 1.. run tellraw @s[tag=gm4_sr_dev.damage_log] {"text":"Enchantments:","color":"gray"} +scoreboard players operation $enchant.damage_reduction gm4_sr_data += $enchant.projectile_protection gm4_sr_data +execute if score $enchant.projectile_protection gm4_sr_data matches 1.. run tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":" > Projectile Protection: ","color":"gray"},{"score":{"name":"$enchant.projectile_protection","objective":"gm4_sr_data"},"color":"white"},{"text":"%","color":"white"}] diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/reduction/enchantments/run.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/reduction/enchantments/run.mcfunction new file mode 100644 index 0000000000..32ad7e6f99 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/reduction/enchantments/run.mcfunction @@ -0,0 +1,52 @@ +# reduce damage with enchantments +# @s = damaged player +# at @s +# run from player/health/damaged/calculate_reduction + +# get required data +item replace block 29999998 1 7134 container.0 from entity @s armor.head +item replace block 29999998 1 7134 container.1 from entity @s armor.chest +item replace block 29999998 1 7134 container.2 from entity @s armor.legs +item replace block 29999998 1 7134 container.3 from entity @s armor.feet +data modify storage gm4_survival_refightalized:temp Items set from block 29999998 1 7134 Items +data remove block 29999998 1 7134 Items + +# enchantments have been nerfed! Protection values are: +# 1% per level of Protection +# 4% per level of Fire / Blast / Projectile Protection + +scoreboard players set $enchant.damage_reduction gm4_sr_data 0 + +# generic protection enchantment +execute store result score $enchant.protection gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:0b}].components."minecraft:enchantments".levels."minecraft:protection" 1 +execute store result score $enchant.protection.add gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:1b}].components."minecraft:enchantments".levels."minecraft:protection" 1 +scoreboard players operation $enchant.protection gm4_sr_data += $enchant.protection.add gm4_sr_data +execute store result score $enchant.protection.add gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:2b}].components."minecraft:enchantments".levels."minecraft:protection" 1 +scoreboard players operation $enchant.protection gm4_sr_data += $enchant.protection.add gm4_sr_data +execute store result score $enchant.protection.add gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:3b}].components."minecraft:enchantments".levels."minecraft:protection" 1 +scoreboard players operation $enchant.protection gm4_sr_data += $enchant.protection.add gm4_sr_data + +execute if score $enchant.damage_reduction gm4_sr_data matches 0 if score $enchant.protection gm4_sr_data matches 1.. run tellraw @s[tag=gm4_sr_dev.damage_log] {"text":"Enchantments:","color":"gray"} +scoreboard players operation $enchant.damage_reduction gm4_sr_data += $enchant.protection gm4_sr_data +execute if score $enchant.protection gm4_sr_data matches 1.. run tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":" > Protection: ","color":"gray"},{"score":{"name":"$enchant.protection","objective":"gm4_sr_data"},"color":"white"},{"text":"%","color":"white"}] + +# check if specific protection enchants would apply +scoreboard players set $enchant.fire_protection gm4_sr_data 0 +scoreboard players set $enchant.blast_protection gm4_sr_data 0 +scoreboard players set $enchant.projectile_protection gm4_sr_data 0 +scoreboard players set $enchant.feather_falling gm4_sr_data 0 +execute if entity @s[advancements={gm4_survival_refightalized:damaged={is_fire=true}}] run function gm4_survival_refightalized:player/damage/reduction/enchantments/fire_protection +execute if entity @s[advancements={gm4_survival_refightalized:damaged={is_explosion=true}}] run function gm4_survival_refightalized:player/damage/reduction/enchantments/blast_protection +execute if entity @s[advancements={gm4_survival_refightalized:damaged={is_projectile=true}}] run function gm4_survival_refightalized:player/damage/reduction/enchantments/projectile_protection +execute if entity @s[advancements={gm4_survival_refightalized:damaged={is_fall=true}}] run function gm4_survival_refightalized:player/damage/reduction/enchantments/feather_falling + +scoreboard players operation $enchant.damage_reduction gm4_sr_data < #80 gm4_sr_data +scoreboard players operation $enchant.damage_reduction_percentage gm4_sr_data = $enchant.damage_reduction gm4_sr_data +scoreboard players operation $enchant.damage_reduction gm4_sr_data *= $damage_total gm4_sr_data +scoreboard players operation $enchant.damage_reduction gm4_sr_data /= #100 gm4_sr_data +scoreboard players operation $damage_total gm4_sr_data -= $enchant.damage_reduction gm4_sr_data + +execute if score $enchant.damage_reduction gm4_sr_data matches 1.. run tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":" >> Total: ","color":"gray"},{"text":"-","color":"white"},{"score":{"name":"$enchant.damage_reduction","objective":"gm4_sr_data"},"color":"white"},{"text":" = ","color":"gray"},{"score":{"name":"$damage_total","objective":"gm4_sr_data"},"color":"white"},{"text":" (","color":"dark_gray"},{"score":{"name":"$enchant.damage_reduction_percentage","objective":"gm4_sr_data"},"color":"dark_gray"},{"text":"%)","color":"dark_gray"}] + +# cleanup +data remove storage gm4_survival_refightalized:temp Items diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/run.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/run.mcfunction new file mode 100644 index 0000000000..ff21fee8f9 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/run.mcfunction @@ -0,0 +1,66 @@ +# stop regen when player gets damaged +# @s = damaged player +# at @s +# run from tick + +# dev damage log +tellraw @s[tag=gm4_sr_dev.damage_log] {"text":"-- Damage Log --"} + +# prep scores +function gm4_survival_refightalized:player/health/calculate_hp +scoreboard players set $damage_armor gm4_sr_data 0 +scoreboard players set $damage_absorption gm4_sr_data 0 +scoreboard players set $damage_health gm4_sr_data 0 +scoreboard players set $damage_total gm4_sr_data 0 + +### TEMP - paper fix - damage resist score gets multiplied by 51.2, so we need to revert that or the player instantly dies +### this currently breaks if a player takes a multiple of 51.2 damage, but that should be rare enough +scoreboard players set #512 gm4_sr_data 512 +execute if score $on_paper gm4_sr_data matches 1 run tellraw @s[tag=gm4_sr_dev.damage_log] {"text":"Paper Bug - divided damage by 51.2","color":"red","italic":true} +execute if score $on_paper gm4_sr_data matches 1 run scoreboard players operation @s gm4_sr_stat.damage_resisted *= #10 gm4_sr_data +execute if score $on_paper gm4_sr_data matches 1 run scoreboard players operation @s gm4_sr_stat.damage_resisted /= #512 gm4_sr_data + +# disable shield if damage was blocked, don't run the rest of this function +execute unless score @s[scores={gm4_sr_shield.timer=1..2,gm4_sr_shield.use_ticks=1..}] gm4_sr_stat.damage_taken matches 1.. unless score @s gm4_sr_stat.damage_absorbed matches 1.. run return run function gm4_survival_refightalized:player/damage/shield/blocked_damage + +# cave spider / witch poison reduction +execute if entity @s[advancements={gm4_survival_refightalized:damaged={cave_spider=true}}] run function gm4_survival_refightalized:player/damage/cave_spider_poison_reduction +execute if entity @s[advancements={gm4_survival_refightalized:damaged={witch=true}}] run function gm4_survival_refightalized:player/damage/witch_poison_reduction + +# dev damage log +tellraw @s[tag=gm4_sr_dev.damage_log,advancements={gm4_survival_refightalized:damaged={combat_damage=false}}] {"text":"Non-Combat Damage","color":"dark_gray","italic":true} + +# calculate damage if player has armor +execute if score @s gm4_sr_stat.armor matches 1.. run function gm4_survival_refightalized:player/damage/calculate_reduction +execute unless score @s gm4_sr_stat.armor matches 1.. run tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":"No Armor - Damage (x10): ","color":"gray"},{"score":{"name":"@s","objective":"gm4_sr_stat.damage_taken"},"color":"white"}] + +# set combat regeneration timers, allow to be altered by function call +scoreboard players operation $set gm4_sr_armor.reduction_timer = $armor_recharge_timer gm4_sr_config +scoreboard players operation $set gm4_sr_health.regeneration_timer = $combat_regen_timer gm4_sr_config + +# function call +# called after damage is calculated but before it is applied (unless there was no armor, then it is applied before) +function #gm4_survival_refightalized:damage_taken + +# divide the damage taken between armor, absorption and health +execute if score $damage_total gm4_sr_data matches 1.. run function gm4_survival_refightalized:player/damage/calculate_damage + +# apply armor recharge timer, /5 if damage was non-combat, 0 if damage did not apply to armor +execute if entity @s[advancements={gm4_survival_refightalized:damaged={combat_damage=false}}] run scoreboard players operation $set gm4_sr_armor.reduction_timer /= #5 gm4_sr_data +execute if score $damage_armor gm4_sr_data matches 1.. run scoreboard players operation @s gm4_sr_armor.reduction_timer > $set gm4_sr_armor.reduction_timer +# apply durability damage to armor unless it was armor piercing damage +execute if entity @s[advancements={gm4_survival_refightalized:damaged={armor_piercing=false,armor_piercing_mob=false}}] run function gm4_survival_refightalized:player/armor/durability/check + +# apply health regeneration timer, /5 if damage was non-combat, 0 if damage did not apply to health +execute if entity @s[advancements={gm4_survival_refightalized:damaged={combat_damage=false}}] run scoreboard players operation $set gm4_sr_health.regeneration_timer /= #5 gm4_sr_data +execute if score $damage_health gm4_sr_data matches 1.. run scoreboard players operation @s gm4_sr_health.regeneration_timer > $set gm4_sr_health.regeneration_timer +scoreboard players operation @s[scores={gm4_sr_stat.damage_taken=1..}] gm4_sr_health.regeneration_timer > $set gm4_sr_health.regeneration_timer + +# cleanup +scoreboard players reset @s gm4_sr_stat.damage_taken +scoreboard players reset @s gm4_sr_stat.damage_absorbed +scoreboard players reset @s gm4_sr_stat.damage_resisted +scoreboard players reset @s gm4_sr_stat.damage_blocked +advancement revoke @s only gm4_survival_refightalized:damaged +data remove storage gm4_survival_refightalized:temp active_effects +data remove storage gm4_survival_refightalized:temp set diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/blocked_damage.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/blocked_damage.mcfunction new file mode 100644 index 0000000000..cf8be13861 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/blocked_damage.mcfunction @@ -0,0 +1,27 @@ +# disable shield if it blocked damage +# @s = damaged player +# at @s +# run from player/health/damaged/run + +# revoke advancement as it's not needed for shield blocking +advancement revoke @s only gm4_survival_refightalized:damaged + +# non-player attacker is weak for 1 second so they don't immediatly hit again +execute on attacker run effect give @s[type=!player] weakness 1 9 true + +# apply durability damage to shield if needed +execute unless score @s gm4_sr_stat.damage_blocked matches 1.. run function gm4_survival_refightalized:player/damage/shield/durability/run + +# parried +execute if score @s gm4_sr_shield.use_ticks matches ..5 run return run function gm4_survival_refightalized:player/damage/shield/parry + +# disable shield +function gm4_survival_refightalized:player/damage/shield/disable + +# dev damage log +tellraw @s[tag=gm4_sr_dev.damage_log] {"text":"Damage blocked by shield","color":"dark_gray"} + +# cleanup +scoreboard players reset @s gm4_sr_stat.damage_resisted +scoreboard players reset @s gm4_sr_stat.damage_blocked +advancement revoke @s only gm4_survival_refightalized:damaged diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/disable.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/disable.mcfunction new file mode 100644 index 0000000000..0495c98ca4 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/disable.mcfunction @@ -0,0 +1,8 @@ +# damage the player from an axe to disable their shield +# @s = armor stand +# at @s +# run from + +tag @s add gm4_sr_target +execute at @s anchored eyes positioned ^ ^ ^1 summon armor_stand run return run function gm4_survival_refightalized:player/damage/shield/disabling_hit +tag @s remove gm4_sr_target diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/disabling_hit.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/disabling_hit.mcfunction new file mode 100644 index 0000000000..598eea07f8 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/disabling_hit.mcfunction @@ -0,0 +1,8 @@ +# damage the player from an axe to disable their shield +# @s = armor stand +# at @s +# run from + +item replace entity @s weapon.mainhand with iron_axe +damage @p[tag=gm4_sr_target] 0.01 mob_attack by @s +kill @s diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/durability/break.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/durability/break.mcfunction new file mode 100644 index 0000000000..24bde1e5f9 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/durability/break.mcfunction @@ -0,0 +1,4 @@ + +playsound minecraft:item.shield.break player @s ~ ~ ~ 1 1 +execute if score $mainhand_shield gm4_sr_data matches 1 run item replace entity @s weapon.mainhand with air +execute if score $mainhand_shield gm4_sr_data matches 0 run item replace entity @s weapon.offhand with air diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/durability/calculate.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/durability/calculate.mcfunction new file mode 100644 index 0000000000..fdfaac727e --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/durability/calculate.mcfunction @@ -0,0 +1,45 @@ + +# if unbreakable don't run +execute if data storage gm4_survival_refightalized:temp Items[{Slot:4b}].components."minecraft:unbreakable" run return 0 + +# if incoming damage is less than 3 don't run +execute if score @s gm4_sr_stat.damage_resisted matches ..29 run return 0 + +tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":"dam: ","color":"gray"},{"score":{"name":"@s","objective":"gm4_sr_stat.damage_resisted"},"color":"white"}] + +# calculate incoming damage based on unbreaking +execute store result score $unbreaking_level gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:4b}].components."minecraft:enchantments".levels."minecraft:unbreaking" +scoreboard players add $unbreaking_level gm4_sr_data 1 +scoreboard players set $damage_chance gm4_sr_data 100 +scoreboard players operation $damage_chance gm4_sr_data /= $unbreaking_level gm4_sr_data +scoreboard players operation $damage_opportunities gm4_sr_data = @s gm4_sr_stat.damage_resisted +scoreboard players add $damage_opportunities gm4_sr_data 5 +scoreboard players operation $damage_opportunities gm4_sr_data /= #10 gm4_sr_data +execute store result score $incoming_damage gm4_sr_data run loot spawn 29999998 1 7133 loot gm4_survival_refightalized:technical/roll_damage +# TODO: remove (spigot bug) +execute positioned 29999998 1 7133 run kill @e[type=item,distance=..2] + +# dev damage log +tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":"Shield Damage Base: ","color":"gray"},{"score":{"name":"$damage_opportunities","objective":"gm4_sr_data"},"color":"white"}] +tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":"Shield Damage Final: ","color":"gray"},{"score":{"name":"$incoming_damage","objective":"gm4_sr_data"},"color":"white"}] + +# if no damage is going to be applied cancel function +execute unless score $incoming_damage gm4_sr_data matches 1.. run return 0 + +# find the total durability of this item +execute store result score $total_durability gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:4b}].components."minecraft:max_damage" +execute if score $total_durability gm4_sr_data matches 0 run scoreboard players set $total_durability gm4_sr_data 336 +execute if score $total_durability gm4_sr_data matches 0 run return 0 + +# add incoming damage to the current damage +execute store result score $current_damage gm4_sr_data run data get storage gm4_survival_refightalized:temp Items[{Slot:4b}].components."minecraft:damage" +scoreboard players operation $current_damage gm4_sr_data += $incoming_damage gm4_sr_data +execute if score $current_damage gm4_sr_data > $total_durability gm4_sr_data run return run function gm4_survival_refightalized:player/damage/shield/durability/break + +# apply to shield +execute store result storage gm4_survival_refightalized:temp set.damage int 1 run scoreboard players get $current_damage gm4_sr_data +function gm4_survival_refightalized:player/damage/shield/durability/eval with storage gm4_survival_refightalized:temp set + +# cleanup +data remove storage gm4_survival_refightalized:temp set +scoreboard players reset $total_durability gm4_sr_data diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/durability/eval.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/durability/eval.mcfunction new file mode 100644 index 0000000000..8978ca5e29 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/durability/eval.mcfunction @@ -0,0 +1,3 @@ + +$execute if score $mainhand_shield gm4_sr_data matches 1 run item modify entity @s weapon.mainhand {function:"minecraft:set_components",components:{"minecraft:damage":$(damage)}} +$execute if score $mainhand_shield gm4_sr_data matches 0 run item modify entity @s weapon.offhand {function:"minecraft:set_components",components:{"minecraft:damage":$(damage)}} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/durability/run.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/durability/run.mcfunction new file mode 100644 index 0000000000..f306e6a477 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/durability/run.mcfunction @@ -0,0 +1,8 @@ + +scoreboard players set $mainhand_shield gm4_sr_data 0 +item replace block 29999998 1 7134 container.4 from entity @s weapon.offhand +execute unless items block 29999998 1 7134 container.4 shield store result score $mainhand_shield gm4_sr_data run item replace block 29999998 1 7134 container.4 from entity @s weapon.mainhand +data modify storage gm4_survival_refightalized:temp Items set from block 29999998 1 7134 Items +function gm4_survival_refightalized:player/damage/shield/durability/calculate +data remove block 29999998 1 7134 Items +data remove storage gm4_survival_refightalized:temp Items diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/parry.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/parry.mcfunction new file mode 100644 index 0000000000..f37051b331 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/parry.mcfunction @@ -0,0 +1,25 @@ + +tag @s add gm4_sr_parried + +playsound minecraft:item.shield.block player @a ~ ~ ~ 1 1.5 +stopsound @s player minecraft:entity.player.hurt + +# advancements +advancement grant @s only gm4:survival_refightalized_parry +execute store result score $lethal_damage gm4_sr_data run attribute @s minecraft:armor get 10 +scoreboard players operation $lethal_damage gm4_sr_data += @s gm4_sr_stat.current_health +scoreboard players operation $lethal_damage gm4_sr_data += @s gm4_sr_stat.current_absorption +execute if score @s gm4_sr_stat.damage_resisted >= $lethal_damage gm4_sr_data run advancement grant @s only gm4:survival_refightalized_parry_lethal_damage + +# stop attacker for a bit +tag @s add gm4_sr_parrier +execute on attacker run function gm4_survival_refightalized:player/damage/shield/parry_effect +tag @s remove gm4_sr_parrier + +# dev damage log +tellraw @s[tag=gm4_sr_dev.damage_log] {"text":"Parry","color":"dark_gray"} + +# cleanup +scoreboard players reset @s gm4_sr_stat.damage_resisted +scoreboard players reset @s gm4_sr_stat.damage_blocked +advancement revoke @s only gm4_survival_refightalized:damaged diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/parry_effect.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/parry_effect.mcfunction new file mode 100644 index 0000000000..a42680884f --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/parry_effect.mcfunction @@ -0,0 +1,7 @@ + +# weakness is applied on any block +stopsound @s player minecraft:entity.player.hurt +effect give @s[distance=..3] nausea 1 0 +effect give @s[distance=..3,type=!player] slowness 1 9 true +effect give @s[distance=..3,type=player] slowness 1 0 true +damage @s[distance=..3] 0.01 player_attack by @p[tag=gm4_sr_parrier] diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/remove_using.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/remove_using.mcfunction new file mode 100644 index 0000000000..91e2a9091f --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/remove_using.mcfunction @@ -0,0 +1,5 @@ + +attribute @s minecraft:knockback_resistance modifier remove gm4_survival_refightalized:using_shield +scoreboard players add @s gm4_sr_shield.use_ticks 999 + +tag @s remove gm4_sr_parried diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/using.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/using.mcfunction new file mode 100644 index 0000000000..f2b7c3997f --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/shield/using.mcfunction @@ -0,0 +1,13 @@ + +advancement revoke @s only gm4_survival_refightalized:using_shield + +# if player parried disable the shield if it is held for 0.25 seconds total +execute if entity @s[tag=gm4_sr_parried,scores={gm4_sr_shield.use_ticks=5..}] run return run function gm4_survival_refightalized:player/damage/shield/disable + +# give a short burst +execute unless score @s gm4_sr_shield.timer matches 1.. run attribute @s minecraft:knockback_resistance modifier add gm4_survival_refightalized:using_shield 1 add_value +execute unless score @s gm4_sr_shield.timer matches 1.. run effect give @s resistance 1 255 true + +execute unless score @s gm4_sr_shield.timer matches 1.. run scoreboard players set @s gm4_sr_shield.use_ticks 0 +scoreboard players add @s gm4_sr_shield.use_ticks 1 +scoreboard players set @s gm4_sr_shield.timer 2 diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/witch_poison_reduction.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/witch_poison_reduction.mcfunction new file mode 100644 index 0000000000..fbeb7fcac6 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/damage/witch_poison_reduction.mcfunction @@ -0,0 +1,31 @@ +# reduce poison duration from witch potions +# @s = damaged player +# at @s +# run from player/health/damaged/run + +# get effect data +data modify storage gm4_survival_refightalized:temp active_effects set from entity @s active_effects +execute store result score $poison.amplifier gm4_sr_data run data get storage gm4_survival_refightalized:temp active_effects[{id:"minecraft:poison"}].amplifier +execute store result score $poison.duration gm4_sr_data run data get storage gm4_survival_refightalized:temp active_effects[{id:"minecraft:poison"}].duration + +# dont run if there is a stronger poison running +execute unless score $poison.amplifier gm4_sr_data matches 0 run return 0 +execute unless score $poison.duration gm4_sr_data matches ..900 run return 0 + +# reapply shorter poison by dividing duration by 3 (60 as it is in ticks), at least 2 seconds +effect clear @s poison +scoreboard players operation $poison.duration gm4_sr_data /= #60 gm4_sr_data +execute if score $poison.duration gm4_sr_data matches 15.. run return run effect give @s poison 15 0 +execute if score $poison.duration gm4_sr_data matches 14 run return run effect give @s poison 14 0 +execute if score $poison.duration gm4_sr_data matches 13 run return run effect give @s poison 13 0 +execute if score $poison.duration gm4_sr_data matches 12 run return run effect give @s poison 12 0 +execute if score $poison.duration gm4_sr_data matches 11 run return run effect give @s poison 11 0 +execute if score $poison.duration gm4_sr_data matches 10 run return run effect give @s poison 10 0 +execute if score $poison.duration gm4_sr_data matches 9 run return run effect give @s poison 9 0 +execute if score $poison.duration gm4_sr_data matches 8 run return run effect give @s poison 8 0 +execute if score $poison.duration gm4_sr_data matches 7 run return run effect give @s poison 7 0 +execute if score $poison.duration gm4_sr_data matches 6 run return run effect give @s poison 6 0 +execute if score $poison.duration gm4_sr_data matches 5 run return run effect give @s poison 5 0 +execute if score $poison.duration gm4_sr_data matches 4 run return run effect give @s poison 4 0 +execute if score $poison.duration gm4_sr_data matches 3 run return run effect give @s poison 3 0 +execute if score $poison.duration gm4_sr_data matches ..2 run effect give @s poison 2 0 diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/death.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/death.mcfunction new file mode 100644 index 0000000000..4d5a75aa9d --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/death.mcfunction @@ -0,0 +1,9 @@ + +# reset scores +scoreboard players set @s gm4_sr_stat.deaths 0 +scoreboard players set @s gm4_sr_armor.reduction 0 +scoreboard players set @s gm4_sr_armor.reduction_timer 0 +scoreboard players set @s gm4_sr_health.restoration 0 + +# remove armor reduction so player respawns with full armor in case of KeepInventory +attribute @s minecraft:armor modifier remove gm4_survival_refightalized:armor_reduced diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/calculate_hp.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/calculate_hp.mcfunction new file mode 100644 index 0000000000..8b015951f4 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/calculate_hp.mcfunction @@ -0,0 +1,27 @@ +# calculate the red health of player calling this function and store in scoreboards +# @s = player to calculate health from +# at unspecified +# run from player/health/detect_sleep +# run from player/health/regen_combat_health +# run from player/health/regen_fast_health +# run from player/health/heal/heal_calc +# run from player/health/reduce/activate +# called from expansion modules to get player health stats + +# get max health x10 +execute store result score @s gm4_sr_stat.max_health run attribute @s minecraft:max_health get 10 + +# calculate current health x10 (only red hearts) +# add healstore as that will be added to health this tick and should be counted +execute store result score @s gm4_sr_stat.current_health run data get entity @s Health 10 +scoreboard players operation @s gm4_sr_stat.current_health += @s gm4_sr_health.restoration + +# calculate percentage of max health +# this uses the rounded values displayed to the player +scoreboard players operation @s gm4_sr_stat.health_percentage = @s gm4_sr_stat.current_health +scoreboard players operation @s gm4_sr_stat.health_percentage *= #100 gm4_sr_data +scoreboard players operation @s gm4_sr_stat.health_percentage /= @s gm4_sr_stat.max_health + +# calculate absorption health same as red hearts +execute store result score @s gm4_sr_stat.max_absorption run attribute @s minecraft:max_absorption get 10 +execute store result score @s gm4_sr_stat.current_absorption run data get entity @s AbsorptionAmount 10 diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/heal/activate.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/heal/activate.mcfunction new file mode 100644 index 0000000000..68dae5e655 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/heal/activate.mcfunction @@ -0,0 +1,26 @@ +# code taken from sweethearts +# @s = player to heal +# at unspecified +# run from any armor/active/heal/heal_calc + +# calculate health +function gm4_survival_refightalized:player/health/calculate_hp + +# calculate max health to get player to new health +# we can use stat.current_health as that already has the restoration added to it +scoreboard players operation $remove_health gm4_sr_data = @s gm4_sr_stat.max_health +scoreboard players operation $remove_health gm4_sr_data -= @s gm4_sr_stat.current_health +execute store result storage gm4_survival_refightalized:temp heal_player.remove_health float 0.1 run scoreboard players get $remove_health gm4_sr_data + +execute unless score $remove_health gm4_sr_data matches 0 run function gm4_survival_refightalized:player/health/heal/eval with storage gm4_survival_refightalized:temp heal_player +data remove storage gm4_survival_refightalized:temp heal_player + +# prepare reverting +tag @s add gm4_sr_healed +schedule function gm4_survival_refightalized:player/health/heal/context 1t + +# heal player +effect give @s minecraft:instant_health 1 10 true + +# cleanup +scoreboard players reset @s gm4_sr_health.restoration diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/heal/context.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/heal/context.mcfunction new file mode 100644 index 0000000000..e9f4b881e7 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/heal/context.mcfunction @@ -0,0 +1,6 @@ +# code taken from sweethearts +# @s = unspecified +# at unspecified +# run from armor/type/heal/activate + +execute as @a[tag=gm4_sr_healed] run function gm4_survival_refightalized:player/health/heal/revert diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/heal/eval.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/heal/eval.mcfunction new file mode 100644 index 0000000000..288d06da3c --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/heal/eval.mcfunction @@ -0,0 +1,6 @@ +# reduce max health of player to their new health +# @s = player to heal +# at unspecified +# run from armor/type/heal/activate + +$attribute @s minecraft:max_health modifier add gm4_survival_refightalized:remove_health.healing -$(remove_health) add_value diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/heal/revert.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/heal/revert.mcfunction new file mode 100644 index 0000000000..ee9325003b --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/heal/revert.mcfunction @@ -0,0 +1,8 @@ +# code taken from sweethearts +# @s = player to revert max health +# at unspecified +# run from armor/type/heal/context + +# revert max health +attribute @s minecraft:max_health modifier remove gm4_survival_refightalized:remove_health.healing +tag @s remove gm4_sr_healed diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/reduce/activate.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/reduce/activate.mcfunction new file mode 100644 index 0000000000..02a78e3157 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/reduce/activate.mcfunction @@ -0,0 +1,27 @@ +# code taken from sweethearts +# @s = player to damage +# at unspecified +# run from player/health/damaged/calculate_reduction + +# calc hp and remove the healstore to get the actual current health +function gm4_survival_refightalized:player/health/calculate_hp +scoreboard players operation @s gm4_sr_stat.current_health -= @s gm4_sr_health.restoration + +# calculate max health to get player to new health +scoreboard players operation $remove_health gm4_sr_data = @s gm4_sr_stat.max_health +scoreboard players operation $remove_health gm4_sr_data -= @s gm4_sr_stat.current_health +scoreboard players operation $remove_health gm4_sr_data += $damage_health gm4_sr_data + +# if player died play custom death message +execute if score $remove_health gm4_sr_data >= @s gm4_sr_stat.max_health run return run function gm4_survival_refightalized:player/health/reduce/death + +execute store result storage gm4_survival_refightalized damage_player.remove_health float 0.1 run scoreboard players get $remove_health gm4_sr_data +execute unless score $remove_health gm4_sr_data matches 0 run function gm4_survival_refightalized:player/health/reduce/eval with storage gm4_survival_refightalized damage_player +data remove storage gm4_survival_refightalized damage_player + +# heal player to set their health +effect give @s minecraft:instant_health 1 10 true + +# prepare reverting +tag @s add gm4_sr_damaged +schedule function gm4_survival_refightalized:player/health/reduce/context 2t diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/reduce/context.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/reduce/context.mcfunction new file mode 100644 index 0000000000..a6eee557ef --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/reduce/context.mcfunction @@ -0,0 +1,6 @@ +# code taken from sweethearts +# @s = unspecified +# at unspecified +# schedule from player/health/reduce/activate + +execute as @a[tag=gm4_sr_damaged] run function gm4_survival_refightalized:player/health/reduce/revert diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/reduce/death.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/reduce/death.mcfunction new file mode 100644 index 0000000000..001682460c --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/reduce/death.mcfunction @@ -0,0 +1,15 @@ +# kill the player if they get reduced to 0 health +# @s = player to damage +# at unspecified +# run from player/health/reduced/activate + +execute if predicate gm4_survival_refightalized:technical/holding_totem_of_undying run return run function gm4_survival_refightalized:player/health/reduce/totem_of_undying + +tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":"Custom Death Message:","color":"gray"}] + +# kill player with custom death message +execute store result score $death_messages gm4_sr_data run gamerule showDeathMessages +gamerule showDeathMessages false +kill @s +tellraw @a ["",{"selector":"@s"},{"translate":"text.gm4.survival_refightalized.death","fallback":" ran out of health"}] +execute if score $death_messages gm4_sr_data matches 1 run gamerule showDeathMessages true diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/reduce/eval.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/reduce/eval.mcfunction new file mode 100644 index 0000000000..7ec2445782 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/reduce/eval.mcfunction @@ -0,0 +1,6 @@ +# reduce max health of player to their new health +# @s = player to heal +# at unspecified +# run from player/health/reduce/activate + +$attribute @s minecraft:max_health modifier add gm4_survival_refightalized:remove_health.damaging -$(remove_health) add_value diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/reduce/revert.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/reduce/revert.mcfunction new file mode 100644 index 0000000000..1c986876b4 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/reduce/revert.mcfunction @@ -0,0 +1,8 @@ +# code taken from sweethearts +# @s = player to revert max health +# at unspecified +# run from player/health/reduce/context + +# revert max health +attribute @s minecraft:max_health modifier remove gm4_survival_refightalized:remove_health.damaging +tag @s remove gm4_sr_damaged diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/reduce/totem_of_undying.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/reduce/totem_of_undying.mcfunction new file mode 100644 index 0000000000..d4dd0451cf --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/reduce/totem_of_undying.mcfunction @@ -0,0 +1,10 @@ + +# if player has resistance from module remove said resistance +execute store result score $resistance_level gm4_sr_data run data get storage gm4_survival_refightalized:temp active_effects[{id:"minecraft:resistance"}].amplifier +execute if score $resistance_level gm4_sr_data matches -1 run function gm4_survival_refightalized:player/resistance/remove + +# damage player to trigger totem +damage @s 99999999999999 generic + +# dev damage log +tellraw @s[tag=gm4_sr_dev.damage_log] [{"text":"Triggered Totem","color":"gray"}] diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/regeneration/combat_health.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/regeneration/combat_health.mcfunction new file mode 100644 index 0000000000..d82b88633e --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/regeneration/combat_health.mcfunction @@ -0,0 +1,10 @@ +# check if player can get some healing +# @s = player to regenerate +# at unspecified +# run from player/process + +function gm4_survival_refightalized:player/health/calculate_hp +execute unless score @s gm4_sr_stat.current_health < @s gm4_sr_stat.max_health run return 0 + +scoreboard players add @s gm4_sr_health.restoration 10 +function #gm4_survival_refightalized:combat_regeneration diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/regeneration/timer.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/regeneration/timer.mcfunction new file mode 100644 index 0000000000..f5bf820a42 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/health/regeneration/timer.mcfunction @@ -0,0 +1,13 @@ +# process the player's combat regen timer +# @s = player +# at @s +# run from player_submain + +# gm4_sr_stat.regeneration_rate_change is normally 0, but can be changed by expansions +scoreboard players set $regeneration_timer gm4_sr_data 100 +scoreboard players operation $regeneration_timer gm4_sr_data += @s gm4_sr_stat.regeneration_rate_change +scoreboard players operation $regeneration_timer gm4_sr_data > #0 gm4_sr_data +scoreboard players operation @s[scores={gm4_sr_health.regeneration_timer=1..}] gm4_sr_health.regeneration_timer -= $regeneration_timer gm4_sr_data + +# regenerate HP (can be altered by expansions) +execute unless score @s gm4_sr_health.regeneration_timer matches 1.. unless score @s gm4_sr_stat.hunger matches ..6 run function gm4_survival_refightalized:player/health/regeneration/combat_health diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/reach_tier/diamond_netherite.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/reach_tier/diamond_netherite.mcfunction new file mode 100644 index 0000000000..b0efb77429 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/reach_tier/diamond_netherite.mcfunction @@ -0,0 +1,6 @@ +# improve the gear mobs can use +# @s = player with diamond / netherite gear +# at unspecified +# run from advancement reach_tier/diamond_netherite + +scoreboard players operation @s gm4_sr_armor.tier > #2 gm4_sr_data diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/reach_tier/iron_golden.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/reach_tier/iron_golden.mcfunction new file mode 100644 index 0000000000..81a650cc3c --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/reach_tier/iron_golden.mcfunction @@ -0,0 +1,6 @@ +# improve the gear mobs can use +# @s = player with iron / golden gear +# at unspecified +# run from advancement reach_tier/iron_golden + +scoreboard players operation @s gm4_sr_armor.tier > #1 gm4_sr_data diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/resistance/reapply_loop.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/resistance/reapply_loop.mcfunction new file mode 100644 index 0000000000..100aab9827 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/resistance/reapply_loop.mcfunction @@ -0,0 +1,23 @@ +# reapply resistance effects that the player had besides the one from this module +# @s = damaged player +# at @s +# run from player/health/damaged/resistance_remove +# run from here + +# reapply +$execute unless score $duration gm4_sr_data matches 0..19 run effect give @s resistance $(duration_set) $(amplifier) $(show_icon) + +# check if this should keep looping +execute unless data storage gm4_survival_refightalized:temp reapply_resistance.hidden_effect run return 0 + +data modify storage gm4_survival_refightalized:temp reapply_resistance set from storage gm4_survival_refightalized:temp reapply_resistance.hidden_effect + +execute store result score $show_particles gm4_sr_data run data get storage gm4_survival_refightalized:temp reapply_resistance.show_icon +execute if score $show_particles gm4_sr_data matches 0 run data modify storage gm4_survival_refightalized:temp reapply_resistance.show_icon set value "true" +execute if score $show_particles gm4_sr_data matches 1 run data modify storage gm4_survival_refightalized:temp reapply_resistance.show_icon set value "false" + +execute store result score $duration gm4_sr_data run data get storage gm4_survival_refightalized:temp reapply_resistance.duration +execute if score $duration gm4_sr_data matches 20.. store result storage gm4_survival_refightalized:temp reapply_resistance.duration_set int 0.05 run scoreboard players get $duration gm4_sr_data +execute if score $duration gm4_sr_data matches -1 run data modify storage gm4_survival_refightalized:temp reapply_resistance.duration_set set value "infinite" + +function gm4_survival_refightalized:player/resistance/reapply_loop with storage gm4_survival_refightalized:temp reapply_resistance diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/resistance/remove.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/resistance/remove.mcfunction new file mode 100644 index 0000000000..01717dcb97 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player/resistance/remove.mcfunction @@ -0,0 +1,27 @@ +# remove resistance from armor if armor is broken +# @s = damaged player +# at @s +# run from player/health/damaged/calculate_reduction + +# check if player actually has resistance that should be removed +execute store result score $resistance_level gm4_sr_data run data get storage gm4_survival_refightalized:temp active_effects[{id:"minecraft:resistance"}].amplifier +execute unless score $resistance_level gm4_sr_data matches -1 run return 0 + +# clear resistance to remove the immunite from armor +effect clear @s resistance + +# check if the player had additional resistance levels +execute unless data storage gm4_survival_refightalized:temp active_effects[{id:"minecraft:resistance"}].hidden_effect run return 0 + +# reapply the resistance levels that should stay +data modify storage gm4_survival_refightalized:temp reapply_resistance set from storage gm4_survival_refightalized:temp active_effects[{id:"minecraft:resistance"}].hidden_effect + +execute store result score $show_particles gm4_sr_data run data get storage gm4_survival_refightalized:temp reapply_resistance.show_icon +execute if score $show_particles gm4_sr_data matches 0 run data modify storage gm4_survival_refightalized:temp reapply_resistance.show_icon set value "true" +execute if score $show_particles gm4_sr_data matches 1 run data modify storage gm4_survival_refightalized:temp reapply_resistance.show_icon set value "false" + +execute store result score $duration gm4_sr_data run data get storage gm4_survival_refightalized:temp reapply_resistance.duration +execute if score $duration gm4_sr_data matches 20.. store result storage gm4_survival_refightalized:temp reapply_resistance.duration_set int 0.05 run scoreboard players get $duration gm4_sr_data +execute if score $duration gm4_sr_data matches -1 run data modify storage gm4_survival_refightalized:temp reapply_resistance.duration_set set value "infinite" + +function gm4_survival_refightalized:player/resistance/reapply_loop with storage gm4_survival_refightalized:temp reapply_resistance diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player_submain.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player_submain.mcfunction new file mode 100644 index 0000000000..8d0d45c1c0 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/player_submain.mcfunction @@ -0,0 +1,32 @@ +# process anything player related +# @s = unspecified +# at unspecified +# scheduled from main (8t) + +## /!\ +# This function is NOT run as the player because the order of some of these functions is important + +# DEV: trigger for players with `gm4_sr_dev.damage_log` tag +execute as @a[tag=gm4_sr_dev.mob_stats] at @s as @e[type=#gm4_survival_refightalized:modify,limit=1,sort=nearest] run function gm4_survival_refightalized:debug/dont_run/dev + +# process players that died +execute as @a[scores={gm4_sr_stat.deaths=1..}] run function gm4_survival_refightalized:player/death + +# reset regeneration and armor recharge changes, can be set again from the function tag +scoreboard players set @a gm4_sr_stat.armor_recharge_change 0 +scoreboard players set @a gm4_sr_stat.regeneration_rate_change 0 + +# function tag call for expansions to keep clocks sync'd +function #gm4_survival_refightalized:player_submain + +# armor recharge timer +execute as @a[gamemode=!spectator,tag=gm4_sr_armor.reduction] run function gm4_survival_refightalized:player/armor/timer +# health regen timer +execute unless score $natural_regen gm4_sr_config matches -1 store result score $natural_regen gm4_sr_config run gamerule naturalRegeneration +execute if score $natural_regen gm4_sr_config matches 0 as @a[gamemode=!spectator] run function gm4_survival_refightalized:player/health/regeneration/timer + +# if player has armor use new damage calculation +effect give @a[gamemode=!spectator,scores={gm4_sr_stat.armor=1..}] resistance 2 255 true + +# heal players if they have stored health +execute as @a[gamemode=!spectator,scores={gm4_sr_health.restoration=1..}] run function gm4_survival_refightalized:player/health/heal/activate diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/slow_clock.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/slow_clock.mcfunction new file mode 100644 index 0000000000..009ab13e56 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/slow_clock.mcfunction @@ -0,0 +1,8 @@ +schedule function gm4_survival_refightalized:slow_clock 30s + +# get moon cycle (0 = new moon, 4 = full moon) +execute store result score $moon gm4_sr_data run time query day +scoreboard players operation $moon gm4_sr_data %= #8 gm4_sr_data +scoreboard players set $8 gm4_sr_data 8 +execute if score $moon gm4_sr_data matches ..3 store result score $moon gm4_sr_data run scoreboard players operation $8 gm4_sr_data -= $moon gm4_sr_data +scoreboard players remove $moon gm4_sr_data 4 diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/function/tick.mcfunction b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/tick.mcfunction new file mode 100644 index 0000000000..7a4c425d54 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/function/tick.mcfunction @@ -0,0 +1,11 @@ +schedule function gm4_survival_refightalized:tick 1t + +# check for player damage +execute as @a[advancements={gm4_survival_refightalized:damaged=true}] at @s run function gm4_survival_refightalized:player/damage/run + +# check for projectiles +execute as @e[type=#gm4_survival_refightalized:arrow,tag=!gm4_sr_arrow_checked,tag=!smithed.strict,tag=!smithed.entity] run function gm4_survival_refightalized:check_arrow + +# shield parry +execute as @a[scores={gm4_sr_shield.timer=1}] run function gm4_survival_refightalized:player/damage/shield/remove_using +scoreboard players remove @a[scores={gm4_sr_shield.timer=1..}] gm4_sr_shield.timer 1 diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/guidebook/survival_refightalized.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/guidebook/survival_refightalized.json new file mode 100644 index 0000000000..ef74c1f0ee --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/guidebook/survival_refightalized.json @@ -0,0 +1,165 @@ +{ + "id": "survival_refightalized", + "name": "Survival Refightalized", + "module_type": "module", + "icon": { + "id": "minecraft:leather_chestplate" + }, + "criteria": { + "equip_armor": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "player": [ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "feet": { + "items": "#gm4_survival_refightalized:armor" + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "legs": { + "items": "#gm4_survival_refightalized:armor" + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "chest": { + "items": "#gm4_survival_refightalized:armor" + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "head": { + "items": "#gm4_survival_refightalized:armor" + } + } + } + } + ] + } + ] + } + }, + "obtain_shield": { + "trigger": "minecraft:inventory_changed", + "conditions": { + "player": [], + "items": [ + { + "items": "minecraft:shield" + } + ] + } + }, + "kill_hostile": { + "trigger": "minecraft:player_hurt_entity", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type_specific": { + "type": "player", + "advancements": { + "minecraft:adventure/kill_a_mob": true + } + } + } + } + ] + } + } + }, + "sections": [ + { + "name": "health", + "enable": [], + "requirements": [], + "pages": [ + [ + { + "insert": "title" + }, + { + "translate": "text.gm4.guidebook.survival_refightalized.description.health", + "fallback": "Damage taken is split in combat and non-combat damage.\nCombat damage regenerates every 60 seconds, while non-combat damage regenerates rapidly when out of combat." + } + ] + ] + }, + { + "name": "armor", + "enable": [], + "requirements": [ + [ + "equip_armor" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.survival_refightalized.description.armor", + "fallback": "Armor no longer reduces damage taken, instead serving as a second health bar. Armor recharges rapidly shortly after it takes damage.\nProtection enchantments have reduced effectiveness." + } + ] + ] + }, + { + "name": "shield", + "enable": [], + "requirements": [ + [ + "obtain_shield" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.survival_refightalized.description.shield", + "fallback": "Shields will go on cooldown after blocking any damage.\n\nBlocking damage within 0.25s of holding the Shield performs a Parry, releasing the Shield within that 0.25s will not disable it." + } + ] + ] + }, + { + "name": "mobs", + "enable": [], + "requirements": [ + [ + "kill_hostile" + ] + ], + "pages": [ + [ + { + "translate": "text.gm4.guidebook.survival_refightalized.description.mobs", + "fallback": "Mobs are stronger based on their environment, such as being outside during a thunderstorm or full moon, or being deep underground.\nSome mobs are altered, such as Skeletons firing slower, and Phantoms drowning." + } + ] + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/generic/chest.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/generic/chest.json new file mode 100644 index 0000000000..1cf5959e69 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/generic/chest.json @@ -0,0 +1,115 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "name": "minecraft:diamond_chestplate", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/diamond" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "golden_chestplate", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/golden" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 1 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "iron_chestplate", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/iron" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 1 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "chainmail_chestplate", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/chainmail" + } + ] + }, + { + "type": "minecraft:item", + "name": "leather_chestplate" + } + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_chance" + }, + "score": "gm4_sr_data", + "scale": 0.05 + } + } + ] + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/generic/feet.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/generic/feet.json new file mode 100644 index 0000000000..124f009e71 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/generic/feet.json @@ -0,0 +1,115 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "name": "diamond_boots", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/diamond" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "golden_boots", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/golden" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 1 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "iron_boots", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/iron" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 1 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "chainmail_boots", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/chainmail" + } + ] + }, + { + "type": "minecraft:item", + "name": "leather_boots" + } + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_chance" + }, + "score": "gm4_sr_data", + "scale": 0.05 + } + } + ] + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/generic/head.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/generic/head.json new file mode 100644 index 0000000000..6cb672e21d --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/generic/head.json @@ -0,0 +1,125 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "name": "turtle_helmet", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/turtle_helmet" + } + ] + }, + { + "type": "minecraft:item", + "name": "diamond_helmet", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/diamond" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "golden_helmet", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/golden" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 1 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "iron_helmet", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/iron" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 1 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "chainmail_helmet", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/chainmail" + } + ] + }, + { + "type": "minecraft:item", + "name": "leather_helmet" + } + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_chance" + }, + "score": "gm4_sr_data", + "scale": 0.05 + } + } + ] + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/generic/legs.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/generic/legs.json new file mode 100644 index 0000000000..89ec7e19c4 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/generic/legs.json @@ -0,0 +1,115 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "name": "diamond_leggings", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/diamond" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 2 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "golden_leggings", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/golden" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 1 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "iron_leggings", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/iron" + }, + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_tier" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 1 + } + } + ] + }, + { + "type": "minecraft:item", + "name": "chainmail_leggings", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/chainmail" + } + ] + }, + { + "type": "minecraft:item", + "name": "leather_leggings" + } + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$armor_chance" + }, + "score": "gm4_sr_data", + "scale": 0.05 + } + } + ] + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/piglin/chest.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/piglin/chest.json new file mode 100644 index 0000000000..527ee03dd9 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/piglin/chest.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "golden_chestplate", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.5 + } + ] + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/piglin/feet.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/piglin/feet.json new file mode 100644 index 0000000000..338385a00b --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/piglin/feet.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "golden_boots", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.5 + } + ] + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/piglin/head.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/piglin/head.json new file mode 100644 index 0000000000..579f3e5cfd --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/piglin/head.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "golden_helmet", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.5 + } + ] + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/piglin/legs.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/piglin/legs.json new file mode 100644 index 0000000000..80fd604061 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/piglin/legs.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "golden_leggings", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.5 + } + ] + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/skeleton/weapon.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/skeleton/weapon.json new file mode 100644 index 0000000000..dda4a2636a --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/skeleton/weapon.json @@ -0,0 +1,30 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:bow", + "functions": [ + { + "function": "minecraft:enchant_with_levels", + "levels": { + "min": 0, + "max": 20 + }, + "options": "#minecraft:non_treasure", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.15 + } + ] + } + ] + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/wither_skeleton/arrow.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/wither_skeleton/arrow.json new file mode 100644 index 0000000000..1a97fcd783 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/wither_skeleton/arrow.json @@ -0,0 +1,67 @@ +{ + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:tipped_arrow", + "functions": [ + { + "function": "minecraft:set_components", + "components": { + "minecraft:potion_contents": { + "custom_color": 7561558, + "custom_effects": [ + { + "id": "minecraft:wither", + "amplifier": 0, + "duration": 200, + "show_particles": true, + "show_icon": true, + "ambient": false + } + ] + }, + "minecraft:hide_additional_tooltip": {} + } + }, + { + "function": "minecraft:set_lore", + "mode": "append", + "lore": [ + { + "translate": "potion.withDuration", + "with": [ + { + "translate": "effect.minecraft.wither" + }, + "0:10" + ], + "color": "red", + "italic": false + } + ] + }, + { + "function": "minecraft:set_name", + "target": "item_name", + "name": { + "translate": "item.gm4.survival_refightalized.lore.wither_arrow", + "fallback": "Arrow of Wither", + "italic": false + } + }, + { + "function": "minecraft:set_count", + "count": { + "min": 1, + "max": 4 + } + } + ] + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/wither_skeleton/chest.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/wither_skeleton/chest.json new file mode 100644 index 0000000000..6f9311acd0 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/wither_skeleton/chest.json @@ -0,0 +1,45 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "name": "iron_chestplate", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/iron" + } + ] + }, + { + "type": "minecraft:item", + "name": "chainmail_chestplate", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/chainmail" + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4:empty" + } + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.666 + } + ] + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/wither_skeleton/feet.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/wither_skeleton/feet.json new file mode 100644 index 0000000000..f38584fcbb --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/wither_skeleton/feet.json @@ -0,0 +1,45 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "name": "iron_boots", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/iron" + } + ] + }, + { + "type": "minecraft:item", + "name": "chainmail_boots", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/chainmail" + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4:empty" + } + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.666 + } + ] + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/wither_skeleton/head.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/wither_skeleton/head.json new file mode 100644 index 0000000000..078e98895b --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/wither_skeleton/head.json @@ -0,0 +1,45 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "name": "iron_helmet", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/iron" + } + ] + }, + { + "type": "minecraft:item", + "name": "chainmail_helmet", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/chainmail" + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4:empty" + } + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.666 + } + ] + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/wither_skeleton/legs.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/wither_skeleton/legs.json new file mode 100644 index 0000000000..19a8a64fa6 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/wither_skeleton/legs.json @@ -0,0 +1,45 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "name": "iron_leggings", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/iron" + } + ] + }, + { + "type": "minecraft:item", + "name": "chainmail_leggings", + "conditions": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/material_check/chainmail" + } + ] + }, + { + "type": "minecraft:loot_table", + "value": "gm4:empty" + } + ], + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.666 + } + ] + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/wither_skeleton/weapon.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/wither_skeleton/weapon.json new file mode 100644 index 0000000000..1deb5b837a --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/mob/wither_skeleton/weapon.json @@ -0,0 +1,29 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "name": "minecraft:bow", + "conditions": [ + { + "condition": "minecraft:random_chance", + "chance": 0.4 + } + ] + }, + { + "type": "minecraft:item", + "name": "stone_sword" + } + ] + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/randomize_stats/damage.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/randomize_stats/damage.json new file mode 100644 index 0000000000..1498f01404 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/randomize_stats/damage.json @@ -0,0 +1,62 @@ +{ + "pools": [ + { + "rolls": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$mob_damage" + }, + "score": "gm4_sr_data", + "scale": 0.15 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ] + }, + { + "rolls": { + "min": 1, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$mob_damage" + }, + "score": "gm4_sr_data", + "scale": 0.35 + } + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ] + }, + { + "rolls": { + "type": "minecraft:binomial", + "n": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$mob_damage" + }, + "score": "gm4_sr_data", + "scale": 0.5 + }, + "p": 0.5 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/randomize_stats/health.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/randomize_stats/health.json new file mode 100644 index 0000000000..c8f0888b27 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/randomize_stats/health.json @@ -0,0 +1,42 @@ +{ + "pools": [ + { + "rolls": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$mob_health" + }, + "score": "gm4_sr_data", + "scale": 0.5 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ] + }, + { + "rolls": { + "type": "minecraft:binomial", + "n": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$mob_health" + }, + "score": "gm4_sr_data", + "scale": 0.5 + }, + "p": 0.5 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/randomize_stats/speed.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/randomize_stats/speed.json new file mode 100644 index 0000000000..d7b50a0eef --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/randomize_stats/speed.json @@ -0,0 +1,45 @@ +{ + "pools": [ + { + "rolls": { + "min": 1, + "max": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$mob_speed" + }, + "score": "gm4_sr_data", + "scale": 0.5 + } + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ] + }, + { + "rolls": { + "type": "minecraft:binomial", + "n": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$mob_speed" + }, + "score": "gm4_sr_data", + "scale": 0.5 + }, + "p": 0.5 + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/technical/roll_damage.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/technical/roll_damage.json new file mode 100644 index 0000000000..32c37c83ff --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/loot_table/technical/roll_damage.json @@ -0,0 +1,33 @@ +{ + "type": "minecraft:generic", + "pools": [ + { + "rolls": { + "type": "minecraft:binomial", + "n": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$damage_opportunities" + }, + "score": "gm4_sr_data" + }, + "p": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$damage_chance" + }, + "score": "gm4_sr_data", + "scale": 0.01 + } + }, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:stone" + } + ] + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/has_weapon.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/has_weapon.json new file mode 100644 index 0000000000..8d9b27382b --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/has_weapon.json @@ -0,0 +1,11 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#gm4_survival_refightalized:weapon" + } + } + } +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/material_check/chainmail.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/material_check/chainmail.json new file mode 100644 index 0000000000..1400b12981 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/material_check/chainmail.json @@ -0,0 +1,4 @@ +{ + "condition": "minecraft:random_chance", + "chance": 0.45 +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/material_check/diamond.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/material_check/diamond.json new file mode 100644 index 0000000000..a030d4dfe2 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/material_check/diamond.json @@ -0,0 +1,20 @@ +[ + { + "condition": "minecraft:value_check", + "value": { + "type": "minecraft:score", + "target": { + "type": "minecraft:fixed", + "name": "$difficulty" + }, + "score": "gm4_sr_data" + }, + "range": { + "min": 25 + } + }, + { + "condition": "minecraft:random_chance", + "chance": 0.0075 + } +] diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/material_check/golden.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/material_check/golden.json new file mode 100644 index 0000000000..cdc78a55a0 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/material_check/golden.json @@ -0,0 +1,40 @@ +[ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:all_of", + "terms": [ + { + "condition": "minecraft:location_check", + "predicate": { + "biomes": "#minecraft:is_badlands" + } + }, + { + "condition": "minecraft:random_chance", + "chance": 0.30 + } + ] + }, + { + "condition": "minecraft:all_of", + "terms": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "predicate": { + "biomes": "#minecraft:is_badlands" + } + } + }, + { + "condition": "minecraft:random_chance", + "chance": 0.15 + } + ] + } + ] + } +] diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/material_check/iron.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/material_check/iron.json new file mode 100644 index 0000000000..991067b543 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/material_check/iron.json @@ -0,0 +1,36 @@ +[ + { + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:all_of", + "terms": [ + { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/underground" + }, + { + "condition": "minecraft:random_chance", + "chance": 0.55 + } + ] + }, + { + "condition": "minecraft:all_of", + "terms": [ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/underground" + } + }, + { + "condition": "minecraft:random_chance", + "chance": 0.35 + } + ] + } + ] + } +] diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/material_check/turtle_helmet.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/material_check/turtle_helmet.json new file mode 100644 index 0000000000..4ea708bae8 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/material_check/turtle_helmet.json @@ -0,0 +1,14 @@ +[ + { + "condition": "minecraft:random_chance", + "chance": 0.75 + }, + { + "condition": "minecraft:location_check", + "predicate": { + "fluid": { + "fluids": "#minecraft:water" + } + } + } +] diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/underground.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/underground.json new file mode 100644 index 0000000000..cb9dd3a090 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/mob/underground.json @@ -0,0 +1,22 @@ +[ + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:location_check", + "predicate": { + "block": { + "blocks": "#gm4:water" + } + } + } + }, + { + "condition": "minecraft:location_check", + "offsetY": 1, + "predicate": { + "light": { + "light": 0 + } + } + } +] diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/technical/holding_totem_of_undying.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/technical/holding_totem_of_undying.json new file mode 100644 index 0000000000..c837166714 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/technical/holding_totem_of_undying.json @@ -0,0 +1,27 @@ +{ + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "minecraft:totem_of_undying" + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "offhand": { + "items": "minecraft:totem_of_undying" + } + } + } + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/technical/in_witch_hut.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/technical/in_witch_hut.json new file mode 100644 index 0000000000..c45cbb3197 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/technical/in_witch_hut.json @@ -0,0 +1,6 @@ +{ + "condition": "minecraft:location_check", + "predicate": { + "structures": "minecraft:swamp_hut" + } +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/technical/night_time.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/technical/night_time.json new file mode 100644 index 0000000000..26225d2480 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/technical/night_time.json @@ -0,0 +1,8 @@ +{ + "condition": "minecraft:time_check", + "value": { + "min": 13188, + "max": 23031 + }, + "period": 24000 +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/technical/raining.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/technical/raining.json new file mode 100644 index 0000000000..5e9da27811 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/technical/raining.json @@ -0,0 +1,16 @@ +{ + "condition": "minecraft:all_of", + "terms": [ + { + "condition": "minecraft:weather_check", + "raining": true + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/underground" + } + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/technical/thundering.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/technical/thundering.json new file mode 100644 index 0000000000..e4afeb4bb6 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/predicate/technical/thundering.json @@ -0,0 +1,16 @@ +{ + "condition": "minecraft:all_of", + "terms": [ + { + "condition": "minecraft:weather_check", + "thundering": true + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:reference", + "name": "gm4_survival_refightalized:mob/underground" + } + } + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/damage_type/armor_piercing.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/damage_type/armor_piercing.json new file mode 100644 index 0000000000..d15286df1d --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/damage_type/armor_piercing.json @@ -0,0 +1,23 @@ +{ + "values": [ + "minecraft:on_fire", + "minecraft:in_wall", + "minecraft:cramming", + "minecraft:drown", + "minecraft:fly_into_wall", + "minecraft:generic", + "minecraft:wither", + "minecraft:dragon_breath", + "minecraft:starve", + "minecraft:fall", + "minecraft:freeze", + "minecraft:stalagmite", + "minecraft:magic", + "minecraft:indirect_magic", + "minecraft:out_of_world", + "minecraft:generic_kill", + "minecraft:sonic_boom", + "minecraft:outside_border" + ] + } + \ No newline at end of file diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/damage_type/combat.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/damage_type/combat.json new file mode 100644 index 0000000000..0e2442d628 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/damage_type/combat.json @@ -0,0 +1,33 @@ +{ + "values": [ + "minecraft:arrow", + "minecraft:bad_respawn_point", + "minecraft:dragon_breath", + "minecraft:falling_anvil", + "minecraft:falling_block", + "minecraft:falling_stalactite", + "minecraft:explosion", + "minecraft:hot_floor", + "minecraft:in_fire", + "minecraft:fireball", + "minecraft:lava", + "minecraft:magic", + "minecraft:fireworks", + "minecraft:indirect_magic", + "minecraft:lightning_bolt", + "minecraft:mob_attack_no_aggro", + "minecraft:out_of_world", + "minecraft:mob_attack", + "minecraft:mob_projectile", + "minecraft:player_attack", + "minecraft:player_explosion", + "minecraft:sonic_boom", + "minecraft:sting", + "minecraft:thorns", + "minecraft:thrown", + "minecraft:trident", + "minecraft:unattributed_fireball", + "minecraft:wither", + "minecraft:wither_skull" + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/damage_type/ignore.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/damage_type/ignore.json new file mode 100644 index 0000000000..7af2603929 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/damage_type/ignore.json @@ -0,0 +1,6 @@ +{ + "values": [ + "#minecraft:bypasses_invulnerability", + "#minecraft:bypasses_resistance" + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/entity_type/arrow.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/entity_type/arrow.json new file mode 100644 index 0000000000..2992991bd0 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/entity_type/arrow.json @@ -0,0 +1,6 @@ +{ + "values": [ + "minecraft:arrow", + "minecraft:spectral_arrow" + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/entity_type/can_fire_arrows.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/entity_type/can_fire_arrows.json new file mode 100644 index 0000000000..d33f3c5294 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/entity_type/can_fire_arrows.json @@ -0,0 +1,7 @@ +{ + "values": [ + "#gm4_survival_refightalized:skeleton_types", + "minecraft:drowned", + "minecraft:player" + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/entity_type/modify.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/entity_type/modify.json new file mode 100644 index 0000000000..9ec8e2d3ca --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/entity_type/modify.json @@ -0,0 +1,20 @@ +{ + "values": [ + "minecraft:bogged", + "minecraft:cave_spider", + "minecraft:creeper", + "minecraft:drowned", + "minecraft:enderman", + "minecraft:husk", + "minecraft:phantom", + "minecraft:piglin", + "minecraft:silverfish", + "minecraft:skeleton", + "minecraft:spider", + "minecraft:stray", + "minecraft:wither_skeleton", + "minecraft:zombie", + "minecraft:zombie_villager", + "minecraft:zombified_piglin" + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/entity_type/modify_in_air.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/entity_type/modify_in_air.json new file mode 100644 index 0000000000..e396af5310 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/entity_type/modify_in_air.json @@ -0,0 +1,8 @@ +{ + "values": [ + "minecraft:cave_spider", + "minecraft:drowned", + "minecraft:phantom", + "minecraft:silverfish" + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/entity_type/skeleton_types.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/entity_type/skeleton_types.json new file mode 100644 index 0000000000..0dbca73205 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/entity_type/skeleton_types.json @@ -0,0 +1,8 @@ +{ + "values": [ + "minecraft:bogged", + "minecraft:skeleton", + "minecraft:stray", + "minecraft:wither_skeleton" + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/entity_type/zombie_types.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/entity_type/zombie_types.json new file mode 100644 index 0000000000..d52516baa7 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/entity_type/zombie_types.json @@ -0,0 +1,8 @@ +{ + "values": [ + "minecraft:drowned", + "minecraft:husk", + "minecraft:zombie", + "minecraft:zombie_villager" + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/item/armor.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/item/armor.json new file mode 100644 index 0000000000..6286d505c1 --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/item/armor.json @@ -0,0 +1,30 @@ +{ + "values": [ + "chainmail_boots", + "chainmail_chestplate", + "chainmail_helmet", + "chainmail_leggings", + "diamond_boots", + "diamond_chestplate", + "diamond_helmet", + "diamond_leggings", + "golden_boots", + "golden_chestplate", + "golden_helmet", + "golden_leggings", + "iron_boots", + "iron_chestplate", + "iron_helmet", + "iron_leggings", + "leather_boots", + "leather_chestplate", + "leather_helmet", + "leather_leggings", + "netherite_boots", + "netherite_chestplate", + "netherite_helmet", + "netherite_leggings", + "player_head", + "turtle_helmet" + ] +} diff --git a/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/item/weapon.json b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/item/weapon.json new file mode 100644 index 0000000000..670df20aba --- /dev/null +++ b/gm4_survival_refightalized/data/gm4_survival_refightalized/tags/item/weapon.json @@ -0,0 +1,28 @@ +{ + "values": [ + "diamond_axe", + "diamond_pickaxe", + "diamond_shovel", + "diamond_sword", + "golden_axe", + "golden_pickaxe", + "golden_shovel", + "golden_sword", + "iron_axe", + "iron_pickaxe", + "iron_shovel", + "iron_sword", + "netherite_axe", + "netherite_pickaxe", + "netherite_shovel", + "netherite_sword", + "stone_axe", + "stone_pickaxe", + "stone_shovel", + "stone_sword", + "wooden_axe", + "wooden_pickaxe", + "wooden_shovel", + "wooden_sword" + ] +} diff --git a/gm4_survival_refightalized/data/minecraft/enchantment/blast_protection.json b/gm4_survival_refightalized/data/minecraft/enchantment/blast_protection.json new file mode 100644 index 0000000000..c0a0c885ad --- /dev/null +++ b/gm4_survival_refightalized/data/minecraft/enchantment/blast_protection.json @@ -0,0 +1,62 @@ +{ + "description": { + "translate": "enchantment.minecraft.blast_protection" + }, + "exclusive_set": "#minecraft:exclusive_set/armor", + "supported_items": "#minecraft:enchantable/armor", + "weight": 2, + "max_level": 4, + "min_cost": { + "base": 5, + "per_level_above_first": 8 + }, + "max_cost": { + "base": 13, + "per_level_above_first": 8 + }, + "anvil_cost": 4, + "slots": [ + "armor" + ], + "effects": { + "minecraft:attributes": [ + { + "id": "minecraft:enchantment.blast_protection", + "attribute": "minecraft:explosion_knockback_resistance", + "amount": { + "type": "minecraft:linear", + "base": 0.15, + "per_level_above_first": 0.15 + }, + "operation": "add_value" + } + ], + "minecraft:damage_protection": [ + { + "effect": { + "type": "minecraft:add", + "value": { + "type": "minecraft:linear", + "base": 1, + "per_level_above_first": 1 + } + }, + "requirements": { + "condition": "minecraft:damage_source_properties", + "predicate": { + "tags": [ + { + "id": "minecraft:is_explosion", + "expected": true + }, + { + "id": "minecraft:bypasses_invulnerability", + "expected": false + } + ] + } + } + } + ] + } +} diff --git a/gm4_survival_refightalized/data/minecraft/enchantment/fire_protection.json b/gm4_survival_refightalized/data/minecraft/enchantment/fire_protection.json new file mode 100644 index 0000000000..aa247b271a --- /dev/null +++ b/gm4_survival_refightalized/data/minecraft/enchantment/fire_protection.json @@ -0,0 +1,67 @@ +{ + "description": { + "translate": "enchantment.minecraft.fire_protection" + }, + "exclusive_set": "#minecraft:exclusive_set/armor", + "supported_items": "#minecraft:enchantable/armor", + "weight": 5, + "max_level": 4, + "min_cost": { + "base": 10, + "per_level_above_first": 8 + }, + "max_cost": { + "base": 18, + "per_level_above_first": 8 + }, + "anvil_cost": 2, + "slots": [ + "armor" + ], + "effects": { + "minecraft:attributes": [ + { + "id": "minecraft:enchantment.fire_protection", + "attribute": "minecraft:burning_time", + "amount": { + "type": "minecraft:linear", + "base": -0.15, + "per_level_above_first": -0.15 + }, + "operation": "add_multiplied_base" + } + ], + "minecraft:damage_protection": [ + { + "effect": { + "type": "minecraft:add", + "value": { + "type": "minecraft:linear", + "base": 1, + "per_level_above_first": 1 + } + }, + "requirements": { + "condition": "minecraft:all_of", + "terms": [ + { + "condition": "minecraft:damage_source_properties", + "predicate": { + "tags": [ + { + "id": "minecraft:is_fire", + "expected": true + }, + { + "id": "minecraft:bypasses_invulnerability", + "expected": false + } + ] + } + } + ] + } + } + ] + } +} diff --git a/gm4_survival_refightalized/data/minecraft/enchantment/projectile_protection.json b/gm4_survival_refightalized/data/minecraft/enchantment/projectile_protection.json new file mode 100644 index 0000000000..5e5d906297 --- /dev/null +++ b/gm4_survival_refightalized/data/minecraft/enchantment/projectile_protection.json @@ -0,0 +1,50 @@ +{ + "description": { + "translate": "enchantment.minecraft.projectile_protection" + }, + "exclusive_set": "#minecraft:exclusive_set/armor", + "supported_items": "#minecraft:enchantable/armor", + "weight": 5, + "max_level": 4, + "min_cost": { + "base": 3, + "per_level_above_first": 6 + }, + "max_cost": { + "base": 9, + "per_level_above_first": 6 + }, + "anvil_cost": 2, + "slots": [ + "armor" + ], + "effects": { + "minecraft:damage_protection": [ + { + "effect": { + "type": "minecraft:add", + "value": { + "type": "minecraft:linear", + "base": 1, + "per_level_above_first": 1 + } + }, + "requirements": { + "condition": "minecraft:damage_source_properties", + "predicate": { + "tags": [ + { + "id": "minecraft:is_projectile", + "expected": true + }, + { + "id": "minecraft:bypasses_invulnerability", + "expected": false + } + ] + } + } + } + ] + } +} diff --git a/gm4_survival_refightalized/data/minecraft/enchantment/protection.json b/gm4_survival_refightalized/data/minecraft/enchantment/protection.json new file mode 100644 index 0000000000..57caa44613 --- /dev/null +++ b/gm4_survival_refightalized/data/minecraft/enchantment/protection.json @@ -0,0 +1,46 @@ +{ + "description": { + "translate": "enchantment.minecraft.protection" + }, + "exclusive_set": "#minecraft:exclusive_set/armor", + "supported_items": "#minecraft:enchantable/armor", + "weight": 10, + "max_level": 4, + "min_cost": { + "base": 1, + "per_level_above_first": 11 + }, + "max_cost": { + "base": 12, + "per_level_above_first": 11 + }, + "anvil_cost": 1, + "slots": [ + "armor" + ], + "effects": { + "minecraft:damage_protection": [ + { + "effect": { + "type": "minecraft:add", + "value": { + "type": "minecraft:linear", + "base": 0.25, + "per_level_above_first": 0.25 + } + }, + "requirements": { + "condition": "minecraft:damage_source_properties", + "predicate": { + "tags": [ + { + "id": "minecraft:bypasses_invulnerability", + "expected": false + } + ] + } + } + } + ] + } +} diff --git a/gm4_survival_refightalized/data/minecraft/tags/damage_type/bypasses_armor.json b/gm4_survival_refightalized/data/minecraft/tags/damage_type/bypasses_armor.json new file mode 100644 index 0000000000..0627d47997 --- /dev/null +++ b/gm4_survival_refightalized/data/minecraft/tags/damage_type/bypasses_armor.json @@ -0,0 +1,54 @@ +{ + "replace": true, + "values": [ + "minecraft:arrow", + "minecraft:bad_respawn_point", + "minecraft:cactus", + "minecraft:campfire", + "minecraft:cramming", + "minecraft:dragon_breath", + "minecraft:drown", + "minecraft:dry_out", + "minecraft:explosion", + "minecraft:fall", + "minecraft:falling_anvil", + "minecraft:falling_block", + "minecraft:falling_stalactite", + "minecraft:fireball", + "minecraft:fireworks", + "minecraft:fireworks", + "minecraft:fly_into_wall", + "minecraft:freeze", + "minecraft:generic", + "minecraft:generic_kill", + "minecraft:hot_floor", + "minecraft:in_fire", + "minecraft:in_wall", + "minecraft:indirect_magic", + "minecraft:lava", + "minecraft:lightning_bolt", + "minecraft:magic", + "minecraft:mob_attack", + "minecraft:mob_attack_no_aggro", + "minecraft:mob_projectile", + "minecraft:on_fire", + "minecraft:out_of_world", + "minecraft:outside_border", + "minecraft:player_attack", + "minecraft:player_explosion", + "minecraft:sonic_boom", + "minecraft:spit", + "minecraft:stalagmite", + "minecraft:starve", + "minecraft:sting", + "minecraft:sweet_berry_bush", + "minecraft:thorns", + "minecraft:thrown", + "minecraft:trident", + "minecraft:unattributed_fireball", + "minecraft:wind_charge", + "minecraft:wither", + "minecraft:wither_skull" + ] + } + \ No newline at end of file diff --git a/gm4_survival_refightalized/data/minecraft/tags/damage_type/bypasses_shield.json b/gm4_survival_refightalized/data/minecraft/tags/damage_type/bypasses_shield.json new file mode 100644 index 0000000000..02dc32c006 --- /dev/null +++ b/gm4_survival_refightalized/data/minecraft/tags/damage_type/bypasses_shield.json @@ -0,0 +1,25 @@ +{ + "replace": true, + "values": [ + "minecraft:falling_stalactite", + "minecraft:falling_anvil", + "minecraft:on_fire", + "minecraft:in_wall", + "minecraft:cramming", + "minecraft:drown", + "minecraft:fly_into_wall", + "minecraft:generic", + "minecraft:wither", + "minecraft:dragon_breath", + "minecraft:starve", + "minecraft:fall", + "minecraft:freeze", + "minecraft:stalagmite", + "minecraft:magic", + "minecraft:indirect_magic", + "minecraft:out_of_world", + "minecraft:generic_kill", + "minecraft:sonic_boom", + "minecraft:outside_border" + ] +} diff --git a/gm4_survival_refightalized/images/combat_expanded.png b/gm4_survival_refightalized/images/combat_expanded.png new file mode 100644 index 0000000000..113458931d Binary files /dev/null and b/gm4_survival_refightalized/images/combat_expanded.png differ diff --git a/gm4_survival_refightalized/pack.svg b/gm4_survival_refightalized/pack.svg new file mode 100644 index 0000000000..1c1522260c --- /dev/null +++ b/gm4_survival_refightalized/pack.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gm4_survival_refightalized/translations.csv b/gm4_survival_refightalized/translations.csv new file mode 100644 index 0000000000..71bb81caac --- /dev/null +++ b/gm4_survival_refightalized/translations.csv @@ -0,0 +1,12 @@ +key,en_us +advancement.gm4.survival_refightalized.armor_damage.title,Armor Up! +advancement.gm4.survival_refightalized.armor_damage.description,Discover that Armor works a bit differently now +advancement.gm4.survival_refightalized.parry.title,Not Today +advancement.gm4.survival_refightalized.parry.description,Parry with a Shield by blocking just before an attack +advancement.gm4.survival_refightalized.parry_lethal_damage.title,"Not Today, Either" +advancement.gm4.survival_refightalized.parry_lethal_damage.description,Block lethal damage with a Shield Parry +text.gm4.guidebook.module_desc.survival_refightalized,Use special armor and weapon modifiers to defend against mobs that grow ever stronger. +text.gm4.guidebook.survival_refightalized.description.health,"Damage taken is split in combat and non-combat damage.\nCombat damage regenerates every 60 seconds, while non-combat damage regenerates rapidly when out of combat.\nSleeping converts all combat damage to non-combat damage, once per night." +text.gm4.guidebook.survival_refightalized.description.mobs,"Mobs are stronger based on their environment, such as being outside during a thunderstorm or full moon, or being deep underground.\n\nCertain mobs have additional effects, such as Skeletons firing slower, and Phantoms drowning underwater." +item.gm4.survival_refightalized.lore.wither_arrow,Arrow of Wither +text.gm4.survival_refightalized.death, ran out of health