diff --git a/gm4/modeldata_registry.json b/gm4/modeldata_registry.json index 3887abd244..a203034a58 100644 --- a/gm4/modeldata_registry.json +++ b/gm4/modeldata_registry.json @@ -466,6 +466,7 @@ }, "elytra": { "gm4_end_fishing:gui/advancement/end_fishing_phantom": 1, + "gm4_horsemanship:item/horse_wings": 2, "gm4_end_fishing:item/captains_wings": 10, "gm4_end_fishing:item/ravaged_wings": 11, "gm4_metallurgy:shamir/moneo": 113, @@ -514,6 +515,10 @@ "experience_bottle": { "standard_liquids:gui/advancement/standard_liquids": 1 }, + "feather": { + "gm4_horsemanship:item/horse_wings": 2, + "gm4_horsemanship:item/horse_winged": 3 + }, "firework_rocket": { "gm4_phantom_scarecrows:gui/advancement/phantom_scarecrows": 1 }, @@ -1355,6 +1360,7 @@ }, "poisonous_potato": { "gm4_chairs:gui/advancement/chairs_sit": 1, + "gm4_horsemanship:item/horse_wings": 2, "gm4_heart_canisters:gui/advancement/heart_canisters_tier_1": 4, "gm4_heart_canisters:gui/advancement/heart_canisters_tier_2": 5, "gm4_heart_canisters:gui/advancement/heart_canisters_max": 6, @@ -1455,7 +1461,8 @@ }, "saddle": { "gm4_pig_tractors:gui/advancement/pig_tractors": 1, - "gm4_chairs:guidebook_icon/chairs": 2 + "gm4_chairs:guidebook_icon/chairs": 2, + "gm4_horsemanship:guidebook_icon/horsemanship": 3 }, "salmon_bucket": { "gm4_metallurgy:shamir/infinitas": 100 diff --git a/gm4_guidebook/triggers.json b/gm4_guidebook/triggers.json index 9d8930384d..3b3758f8be 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__": 122, + "__next__": 123, "animi_shamir": 91, "apple_trees": 83, "arborenda_shamir": 20, @@ -50,6 +50,7 @@ "heart_canisters": 15, "helious_shamir": 69, "holographic_tags": 94, + "horsemanship": 122, "hypexperia_shamir": 17, "iacio_shamir": 88, "icy_strays": 102, diff --git a/gm4_horsemanship/README.md b/gm4_horsemanship/README.md new file mode 100644 index 0000000000..1e23ae7224 --- /dev/null +++ b/gm4_horsemanship/README.md @@ -0,0 +1,10 @@ +# Horsemanship + +Level up your Horses as you use them! Adds level-ups, stamina mechanics, additional foods and more! + +Horse in flight + +### Features +- Horses will grow stronger with use, while keeping breeding mechanics. +- New item crafted with Horse Armor and Elytra to allow your horse to fly! +- Allow horses to graze grass and add a variety of new food items you can feed them. diff --git a/gm4_horsemanship/assets/gm4_horsemanship/equipment/wings.json b/gm4_horsemanship/assets/gm4_horsemanship/equipment/wings.json new file mode 100644 index 0000000000..6036a37e7e --- /dev/null +++ b/gm4_horsemanship/assets/gm4_horsemanship/equipment/wings.json @@ -0,0 +1,9 @@ +{ + "layers": { + "horse_body": [ + { + "texture": "gm4_horsemanship:wings" + } + ] + } +} diff --git a/gm4_horsemanship/assets/gm4_horsemanship/items/horse_winged.json b/gm4_horsemanship/assets/gm4_horsemanship/items/horse_winged.json new file mode 100644 index 0000000000..5ffc508316 --- /dev/null +++ b/gm4_horsemanship/assets/gm4_horsemanship/items/horse_winged.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "gm4_horsemanship:item/horse_winged" + } +} diff --git a/gm4_horsemanship/assets/gm4_horsemanship/items/horse_wings.json b/gm4_horsemanship/assets/gm4_horsemanship/items/horse_wings.json new file mode 100644 index 0000000000..1ef9f8bd08 --- /dev/null +++ b/gm4_horsemanship/assets/gm4_horsemanship/items/horse_wings.json @@ -0,0 +1,6 @@ +{ + "model": { + "type": "minecraft:model", + "model": "gm4_horsemanship:item/horse_wings" + } +} diff --git a/gm4_horsemanship/assets/gm4_horsemanship/models/item/horse_winged.json b/gm4_horsemanship/assets/gm4_horsemanship/models/item/horse_winged.json new file mode 100644 index 0000000000..30c0e01517 --- /dev/null +++ b/gm4_horsemanship/assets/gm4_horsemanship/models/item/horse_winged.json @@ -0,0 +1,53 @@ +{ + "format_version": "1.21.6", + "textures": { + "0": "gm4_horsemanship:item/horse_winged", + "particle": "gm4_horsemanship:item/horse_winged" + }, + "elements": [ + { + "from": [2.40317, -5.58211, 8], + "to": [18.40317, 10.41789, 8], + "rotation": {"angle": 22.5, "axis": "z", "origin": [3, 3, 8]}, + "faces": { + "north": {"uv": [16, 16, 0, 0], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 16], "texture": "#missing"}, + "south": {"uv": [0, 16, 16, 0], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 16], "texture": "#missing"}, + "up": {"uv": [16, 0, 0, 0], "texture": "#missing"}, + "down": {"uv": [16, 0, 0, 0], "texture": "#missing"} + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [0, 3, 1], + "scale": [0.55, 0.55, 0.55] + }, + "thirdperson_lefthand": { + "translation": [0, 3, 1], + "scale": [0.55, 0.55, 0.55] + }, + "firstperson_righthand": { + "rotation": [0, -90, 25], + "translation": [1.13, 3.2, 1.13], + "scale": [0.68, 0.68, 0.68] + }, + "firstperson_lefthand": { + "rotation": [0, -90, 25], + "translation": [1.13, 3.2, 1.13], + "scale": [0.68, 0.68, 0.68] + }, + "ground": { + "translation": [0, 2, 0], + "scale": [0.5, 0.5, 0.5] + }, + "head": { + "rotation": [0, -180, 0], + "translation": [0, 13, 7] + }, + "fixed": { + "rotation": [0, -180, 0] + } + } +} diff --git a/gm4_horsemanship/assets/gm4_horsemanship/models/item/horse_wings.json b/gm4_horsemanship/assets/gm4_horsemanship/models/item/horse_wings.json new file mode 100644 index 0000000000..59206c48a2 --- /dev/null +++ b/gm4_horsemanship/assets/gm4_horsemanship/models/item/horse_wings.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "gm4_horsemanship:item/horse_wings" + } +} diff --git a/gm4_horsemanship/assets/gm4_horsemanship/textures/entity/equipment/horse_body/wings.png b/gm4_horsemanship/assets/gm4_horsemanship/textures/entity/equipment/horse_body/wings.png new file mode 100644 index 0000000000..519ba44574 Binary files /dev/null and b/gm4_horsemanship/assets/gm4_horsemanship/textures/entity/equipment/horse_body/wings.png differ diff --git a/gm4_horsemanship/assets/gm4_horsemanship/textures/item/horse_winged.png b/gm4_horsemanship/assets/gm4_horsemanship/textures/item/horse_winged.png new file mode 100644 index 0000000000..a2d297df6f Binary files /dev/null and b/gm4_horsemanship/assets/gm4_horsemanship/textures/item/horse_winged.png differ diff --git a/gm4_horsemanship/assets/gm4_horsemanship/textures/item/horse_wings.png b/gm4_horsemanship/assets/gm4_horsemanship/textures/item/horse_wings.png new file mode 100644 index 0000000000..eafa4c3dee Binary files /dev/null and b/gm4_horsemanship/assets/gm4_horsemanship/textures/item/horse_wings.png differ diff --git a/gm4_horsemanship/assets/model_data.yaml b/gm4_horsemanship/assets/model_data.yaml new file mode 100644 index 0000000000..3d3bf520f7 --- /dev/null +++ b/gm4_horsemanship/assets/model_data.yaml @@ -0,0 +1,7 @@ +model_data: + - item: elytra + reference: item/horse_wings + template: custom + - item: feather + reference: item/horse_winged + template: custom diff --git a/gm4_horsemanship/assets/translations.csv b/gm4_horsemanship/assets/translations.csv new file mode 100644 index 0000000000..6722dca317 --- /dev/null +++ b/gm4_horsemanship/assets/translations.csv @@ -0,0 +1,2 @@ +key,en_us +gm4.horsemanship.item.horse_wings,Pegasuit diff --git a/gm4_horsemanship/beet.yaml b/gm4_horsemanship/beet.yaml new file mode 100644 index 0000000000..439ea2ab26 --- /dev/null +++ b/gm4_horsemanship/beet.yaml @@ -0,0 +1,30 @@ +id: gm4_horsemanship +name: Horsemanship +version: 1.0.X + +resource_pack: + load: . +data_pack: + load: . + +pipeline: + - gm4.plugins.extend.module + - gm4.plugins.include.lib_forceload + +meta: + gm4: + versioning: + required: + lib_forceload: 1.1.0 + schedule_loops: + - main + - tick + website: + description: Form a bond with your horses + recommended: [] + notes: [] + video: null + wiki: https://wiki.gm4.co/wiki/Horsemanship + credits: + Creator: + - Thanathor diff --git a/gm4_horsemanship/data/gm4_horsemanship/advancement/feed_horse.json b/gm4_horsemanship/data/gm4_horsemanship/advancement/feed_horse.json new file mode 100644 index 0000000000..d9d07a1676 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/advancement/feed_horse.json @@ -0,0 +1,179 @@ +{ + "criteria": { + "apple": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "item": { + "items": [ + "minecraft:apple" + ] + }, + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse\"]}" + } + } + ] + } + }, + "golden_apple": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "item": { + "items": [ + "minecraft:golden_apple" + ] + }, + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse\"]}" + } + } + ] + } + }, + "carrot": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "item": { + "items": [ + "minecraft:carrot" + ] + }, + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse\"]}" + } + } + ] + } + }, + "enchanted_golden_apple": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "item": { + "items": [ + "minecraft:enchanted_golden_apple" + ] + }, + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse\"]}" + } + } + ] + } + }, + "golden_carrot": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "item": { + "items": [ + "minecraft:golden_carrot" + ] + }, + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse\"]}" + } + } + ] + } + }, + "sugar": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "item": { + "items": [ + "minecraft:sugar" + ] + }, + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse\"]}" + } + } + ] + } + }, + "wheat": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "item": { + "items": [ + "minecraft:wheat" + ] + }, + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse\"]}" + } + } + ] + } + }, + "hay_block": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "item": { + "items": [ + "minecraft:hay_block" + ] + }, + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse\"]}" + } + } + ] + } + } + }, + "requirements": [ + [ + "apple", + "golden_apple", + "carrot", + "enchanted_golden_apple", + "golden_carrot", + "sugar", + "wheat", + "hay_block" + ] + ], + "rewards": { + "function": "gm4_horsemanship:horse_processing/food/feed_original_food" + } +} diff --git a/gm4_horsemanship/data/gm4_horsemanship/advancement/feed_untamed_horse.json b/gm4_horsemanship/data/gm4_horsemanship/advancement/feed_untamed_horse.json new file mode 100644 index 0000000000..d8cdad397c --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/advancement/feed_untamed_horse.json @@ -0,0 +1,259 @@ +{ + "criteria": { + "baked_potato": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "item": { + "items": [ + "minecraft:baked_potato" + ] + }, + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse\"]}" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_horse.tamed\"]}" + } + } + } + ] + } + }, + "beetroot": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "item": { + "items": [ + "minecraft:beetroot" + ] + }, + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse\"]}" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_horse.tamed\"]}" + } + } + } + ] + } + }, + "bread": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "item": { + "items": [ + "minecraft:bread" + ] + }, + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse\"]}" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_horse.tamed\"]}" + } + } + } + ] + } + }, + "chorus_fruit": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "item": { + "items": [ + "minecraft:chorus_fruit" + ] + }, + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse\"]}" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_horse.tamed\"]}" + } + } + } + ] + } + }, + "dried_kelp": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "item": { + "items": [ + "minecraft:dried_kelp" + ] + }, + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse\"]}" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_horse.tamed\"]}" + } + } + } + ] + } + }, + "glow_berries": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "item": { + "items": [ + "minecraft:glow_berries" + ] + }, + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse\"]}" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_horse.tamed\"]}" + } + } + } + ] + } + }, + "melon_slice": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "item": { + "items": [ + "minecraft:melon_slice" + ] + }, + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse\"]}" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_horse.tamed\"]}" + } + } + } + ] + } + }, + "sweet_berries": { + "trigger": "minecraft:player_interacted_with_entity", + "conditions": { + "item": { + "items": [ + "minecraft:sweet_berries" + ] + }, + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse\"]}" + } + }, + { + "condition": "minecraft:inverted", + "term": { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "nbt": "{Tags:[\"gm4_horse.tamed\"]}" + } + } + } + ] + } + } + }, + "requirements": [ + [ + "baked_potato", + "beetroot", + "bread", + "chorus_fruit", + "dried_kelp", + "glow_berries", + "melon_slice", + "sweet_berries" + ] + ], + "rewards": { + "function": "gm4_horsemanship:horse_processing/food/feed_added_food_untamed" + } +} diff --git a/gm4_horsemanship/data/gm4_horsemanship/advancement/start_riding_horse.json b/gm4_horsemanship/data/gm4_horsemanship/advancement/start_riding_horse.json new file mode 100644 index 0000000000..e1aa5708e5 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/advancement/start_riding_horse.json @@ -0,0 +1,24 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:started_riding", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "vehicle": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse\"]}" + } + } + } + ] + } + } + }, + "rewards": { + "function": "gm4_horsemanship:horse_processing/start_riding_horse" + } +} diff --git a/gm4_horsemanship/data/gm4_horsemanship/advancement/tame_horse.json b/gm4_horsemanship/data/gm4_horsemanship/advancement/tame_horse.json new file mode 100644 index 0000000000..df6c5f7ac1 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/advancement/tame_horse.json @@ -0,0 +1,21 @@ +{ + "criteria": { + "requirement": { + "trigger": "minecraft:tame_animal", + "conditions": { + "entity": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "#gm4_horsemanship:trainable" + } + } + ] + } + } + }, + "rewards": { + "function": "gm4_horsemanship:level/tame_horse" + } +} diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/cap_health.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/cap_health.mcfunction new file mode 100644 index 0000000000..313803a9e7 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/cap_health.mcfunction @@ -0,0 +1,10 @@ +# cap health just below the real max health +# @s = gm4_horse +# at unspecified +# run from horse_processing/general +# run from any in horse_processing/food/type/ + +execute store result score $max_health gm4_horse_data run attribute @s max_health get 100 +scoreboard players remove $max_health gm4_horse_data 101 +execute store result score $curr_health gm4_horse_data run data get entity @s Health 100 +execute if score $curr_health gm4_horse_data > $max_health gm4_horse_data store result entity @s Health float 0.01 run scoreboard players get $max_health gm4_horse_data diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/add_age.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/add_age.mcfunction new file mode 100644 index 0000000000..e71fedeacb --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/add_age.mcfunction @@ -0,0 +1,16 @@ +# add age to this foal +# @s = gm4_horse foal +# at @s +# run from horse_processing/food/type/baked_potato +# run from horse_processing/food/type/beetroot +# run from horse_processing/food/type/bread +# run from horse_processing/food/type/chorus_fruit +# run from horse_processing/food/type/dried_kelp +# run from horse_processing/food/type/glow_berries +# run from horse_processing/food/type/melon_slice +# run from horse_processing/food/type/short_grass +# run from horse_processing/food/type/sweet_berries + +scoreboard players operation $age gm4_horse_data += $add_age gm4_horse_data +scoreboard players operation $age gm4_horse_data < #0 gm4_horse_data +execute store result entity @s Age int 1 run scoreboard players get $age gm4_horse_data diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/check_horse.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/check_horse.mcfunction new file mode 100644 index 0000000000..1e949040ac --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/check_horse.mcfunction @@ -0,0 +1,11 @@ +# check if this gm4_horse was fed by checking if player is looking at it +# @s = gm4_horse +# at @s +# run from horse_processing/food/feed_added_food_untamed +# run from horse_processing/food/feed_original_food + +tag @s add gm4_horse_check +scoreboard players set $found_horse gm4_horse_data 0 +execute as @p[tag=gm4_horse_check_player] store success score $found_horse gm4_horse_data if predicate gm4_horsemanship:check_horse_looking_at +execute if score $found_horse gm4_horse_data matches 1 run tag @s add gm4_horse_target +tag @s remove gm4_horse_check diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/attempt.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/attempt.mcfunction new file mode 100644 index 0000000000..4604c7dc4b --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/attempt.mcfunction @@ -0,0 +1,19 @@ +# code taken from Orb of Ankou - expeditious +# @s = gm4_horse +# at @s +# run from horse_processing/food/chorus_warp/context + +tag @s remove gm4_horse_warp_target +tag @s add gm4_horse_warping +execute store result storage gm4_horsemanship:temp check.height float 0.016 run attribute @s scale get 100 +execute store result storage gm4_horsemanship:temp check.distance float 0.0069825 run attribute @s scale get 100 + +# effects where you leave +particle reverse_portal ~ ~0.8 ~ 0.2 0.4 0.2 0.1 16 +playsound entity.enderman.teleport player @a ~ ~ ~ 1 1.2 + +# teleport up to 8 blocks away +execute align y summon marker run function gm4_horsemanship:horse_processing/food/chorus_warp/spawn_marker + +data remove storage gm4_horsemanship:temp check +tag @s remove gm4_horse_warping diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/check_block.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/check_block.mcfunction new file mode 100644 index 0000000000..edcc22c498 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/check_block.mcfunction @@ -0,0 +1,11 @@ +# check if the horse would fit in this location +# @s = warp marker +# at @s offset to the corners of the horse hitbox +# run from horse_processing/food/chorus_warp/check_warp_location + +# at least one of the bottom 4 checks needs to have a full collision block below +execute if score $ground_found gm4_horse_data matches 0 if block ~ ~-0.1 ~ #gm4:full_collision run scoreboard players set $ground_found gm4_horse_data 1 + +# look for no collision that is not water or lava +execute if block ~ ~ ~ #gm4:no_collision unless block ~ ~ ~ #gm4:water unless block ~ ~ ~ lava run return 1 +return 0 diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/check_warp_location.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/check_warp_location.mcfunction new file mode 100644 index 0000000000..81f8fc22ab --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/check_warp_location.mcfunction @@ -0,0 +1,25 @@ +# check if the horse would fit in this location +# @s = warp marker +# at @s +# run from horse_processing/food/chorus_warp/set_ypos + +scoreboard players set $ground_found gm4_horse_data 0 + +$execute positioned ~$(distance) ~ ~$(distance) store result score $warp_safe gm4_horse_data run function gm4_horsemanship:horse_processing/food/chorus_warp/check_block +execute if score $warp_safe gm4_horse_data matches 0 run return 0 +$execute positioned ~-$(distance) ~ ~$(distance) store result score $warp_safe gm4_horse_data run function gm4_horsemanship:horse_processing/food/chorus_warp/check_block +execute if score $warp_safe gm4_horse_data matches 0 run return 0 +$execute positioned ~$(distance) ~ ~-$(distance) store result score $warp_safe gm4_horse_data run function gm4_horsemanship:horse_processing/food/chorus_warp/check_block +execute if score $warp_safe gm4_horse_data matches 0 run return 0 +$execute positioned ~-$(distance) ~ ~-$(distance) store result score $warp_safe gm4_horse_data run function gm4_horsemanship:horse_processing/food/chorus_warp/check_block +execute if score $warp_safe gm4_horse_data matches 0 run return 0 +execute if score $ground_found gm4_horse_data matches 0 run return 0 + +$execute positioned ~$(distance) ~$(height) ~$(distance) store result score $warp_safe gm4_horse_data run function gm4_horsemanship:horse_processing/food/chorus_warp/check_block +execute if score $warp_safe gm4_horse_data matches 0 run return 0 +$execute positioned ~-$(distance) ~$(height) ~$(distance) store result score $warp_safe gm4_horse_data run function gm4_horsemanship:horse_processing/food/chorus_warp/check_block +execute if score $warp_safe gm4_horse_data matches 0 run return 0 +$execute positioned ~$(distance) ~$(height) ~-$(distance) store result score $warp_safe gm4_horse_data run function gm4_horsemanship:horse_processing/food/chorus_warp/check_block +execute if score $warp_safe gm4_horse_data matches 0 run return 0 +$execute positioned ~-$(distance) ~$(height) ~-$(distance) store result score $warp_safe gm4_horse_data run function gm4_horsemanship:horse_processing/food/chorus_warp/check_block +return run scoreboard players get $warp_safe gm4_horse_data diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/context.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/context.mcfunction new file mode 100644 index 0000000000..9126095ea0 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/context.mcfunction @@ -0,0 +1,7 @@ +# schedule is needed to let teleport work, because minecraft, that's why +# @s = unspecified +# at unspecified +# run from horse_processing/food/type/chorus_fruit + +# regain context +execute as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_warp_target] at @s run function gm4_horsemanship:horse_processing/food/chorus_warp/attempt diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/randomize.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/randomize.mcfunction new file mode 100644 index 0000000000..1189ffe0fb --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/randomize.mcfunction @@ -0,0 +1,11 @@ +# code taken from Orb of Ankou - expeditious +# @s = warp marker +# at @s (original spawn location!) +# run from horse_processing/food/chorus_warp/spawn_marker +# run from horse_processing/food/chorus_warp/tp_marker + +tp @s ~-8 ~ ~-8 +execute store result score $randomX gm4_horse_data run random value 0..16 +execute store result score $randomZ gm4_horse_data run random value 0..16 + +function gm4_horsemanship:horse_processing/food/chorus_warp/tp_marker diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/set_ypos.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/set_ypos.mcfunction new file mode 100644 index 0000000000..d55dc24688 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/set_ypos.mcfunction @@ -0,0 +1,14 @@ +# code taken from Orb of Ankou - expeditious +# @s = warp marker +# at @s +# run from horse_processing/food/chorus_warp/tp_marker + +execute at @s run tp @s ~ ~-1 ~ +scoreboard players add $set_y gm4_horse_data 1 + +execute store result score $warp_safe gm4_horse_data run function gm4_horsemanship:horse_processing/food/chorus_warp/check_warp_location with storage gm4_horsemanship:temp check + +execute if score $warp_safe gm4_horse_data matches 1 as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_warping,limit=1] run function gm4_horsemanship:horse_processing/food/chorus_warp/tp_horse + +execute if score $warp_safe gm4_horse_data matches 1 run scoreboard players set $warp_attempt gm4_horse_data 33 +execute unless score $set_y gm4_horse_data matches 17.. at @s unless score $warp_safe gm4_horse_data matches 1 run function gm4_horsemanship:horse_processing/food/chorus_warp/set_ypos diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/spawn_marker.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/spawn_marker.mcfunction new file mode 100644 index 0000000000..8492bcf19a --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/spawn_marker.mcfunction @@ -0,0 +1,11 @@ +# spawn a marker and start the moving of it +# @s = warp marker +# at @s align y +# run from horse_processing/food/chorus_warp/attempt + +tag @s add gm4_horse_warp_marker +execute store result score $y_pos gm4_horse_data run data get entity @s Pos[1] +scoreboard players set $warp_attempt gm4_horse_data 0 + +execute at @s run function gm4_horsemanship:horse_processing/food/chorus_warp/randomize +kill @s diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/tp_horse.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/tp_horse.mcfunction new file mode 100644 index 0000000000..707ff5ec93 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/tp_horse.mcfunction @@ -0,0 +1,8 @@ +# code taken from Orb of Ankou - expeditious +# @s = gm4_horse +# at @s +# run from horse_processing/food/chorus_warp/set_ypos + +tp @s ~ ~0.1 ~ +playsound entity.enderman.teleport player @a ~ ~ ~ 1 0.8 +particle portal ~ ~0.8 ~ 0.2 0.4 0.2 1 16 diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/tp_marker.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/tp_marker.mcfunction new file mode 100644 index 0000000000..1780f011f0 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/chorus_warp/tp_marker.mcfunction @@ -0,0 +1,34 @@ +# code taken from Orb of Ankou - expeditious +# @s = warp marker +# at @s +# run from horse_processing/food/chorus_warp/randomize + +execute at @s if score $randomX gm4_horse_data matches 16.. run tp @s ~16 ~ ~ +execute if score $randomX gm4_horse_data matches 16.. run scoreboard players remove $randomX gm4_horse_data 16 +execute at @s if score $randomX gm4_horse_data matches 8.. run tp @s ~8 ~ ~ +execute if score $randomX gm4_horse_data matches 8.. run scoreboard players remove $randomX gm4_horse_data 8 +execute at @s if score $randomX gm4_horse_data matches 4.. run tp @s ~4 ~ ~ +execute if score $randomX gm4_horse_data matches 4.. run scoreboard players remove $randomX gm4_horse_data 4 +execute at @s if score $randomX gm4_horse_data matches 2.. run tp @s ~2 ~ ~ +execute if score $randomX gm4_horse_data matches 2.. run scoreboard players remove $randomX gm4_horse_data 2 +execute at @s if score $randomX gm4_horse_data matches 1.. run tp @s ~1 ~ ~ +execute if score $randomX gm4_horse_data matches 1.. run scoreboard players remove $randomX gm4_horse_data 1 + +execute at @s if score $randomZ gm4_horse_data matches 16.. run tp @s ~ ~ ~16 +execute if score $randomZ gm4_horse_data matches 16.. run scoreboard players remove $randomZ gm4_horse_data 16 +execute at @s if score $randomZ gm4_horse_data matches 8.. run tp @s ~ ~ ~8 +execute if score $randomZ gm4_horse_data matches 8.. run scoreboard players remove $randomZ gm4_horse_data 8 +execute at @s if score $randomZ gm4_horse_data matches 4.. run tp @s ~ ~ ~4 +execute if score $randomZ gm4_horse_data matches 4.. run scoreboard players remove $randomZ gm4_horse_data 4 +execute at @s if score $randomZ gm4_horse_data matches 2.. run tp @s ~ ~ ~2 +execute if score $randomZ gm4_horse_data matches 2.. run scoreboard players remove $randomZ gm4_horse_data 2 +execute at @s if score $randomZ gm4_horse_data matches 1.. run tp @s ~ ~ ~1 +execute if score $randomZ gm4_horse_data matches 1.. run scoreboard players remove $randomZ gm4_horse_data 1 + +execute store result entity @s Pos[1] double 1 run scoreboard players get $y_pos gm4_horse_data +execute at @s run tp @s ~ ~8 ~ +scoreboard players set $set_y gm4_horse_data 0 +execute at @s run function gm4_horsemanship:horse_processing/food/chorus_warp/set_ypos + +scoreboard players add $warp_attempt gm4_horse_data 1 +execute unless score $warp_attempt gm4_horse_data matches 33.. run function gm4_horsemanship:horse_processing/food/chorus_warp/randomize diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/feed_added_food.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/feed_added_food.mcfunction new file mode 100644 index 0000000000..10ace90aea --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/feed_added_food.mcfunction @@ -0,0 +1,26 @@ +# check feeding the gm4_horse a food item added by this module +# @s = player feeding the gm4_horse +# at @s +# run from horse_processing/start_riding_horse + +# check which item was fed +scoreboard players set $food_processed gm4_horse_data 0 +item replace block 29999998 1 7134 container.0 from entity @s weapon.mainhand +data modify storage gm4_horsemanship:temp item_id set from block 29999998 1 7134 Items[{Slot:0b}].id +execute if score $food_processed gm4_horse_data matches 0 if data storage gm4_horsemanship:temp {item_id:"minecraft:short_grass"} on vehicle run function gm4_horsemanship:horse_processing/food/type/short_grass +execute if score $food_processed gm4_horse_data matches 0 if data storage gm4_horsemanship:temp {item_id:"minecraft:sweet_berries"} on vehicle run function gm4_horsemanship:horse_processing/food/type/sweet_berries +execute if score $food_processed gm4_horse_data matches 0 if data storage gm4_horsemanship:temp {item_id:"minecraft:glow_berries"} on vehicle run function gm4_horsemanship:horse_processing/food/type/glow_berries +execute if score $food_processed gm4_horse_data matches 0 if data storage gm4_horsemanship:temp {item_id:"minecraft:chorus_fruit"} on vehicle run function gm4_horsemanship:horse_processing/food/type/chorus_fruit +execute if score $food_processed gm4_horse_data matches 0 if data storage gm4_horsemanship:temp {item_id:"minecraft:dried_kelp"} on vehicle run function gm4_horsemanship:horse_processing/food/type/dried_kelp +execute if score $food_processed gm4_horse_data matches 0 if data storage gm4_horsemanship:temp {item_id:"minecraft:melon_slice"} on vehicle run function gm4_horsemanship:horse_processing/food/type/melon_slice +execute if score $food_processed gm4_horse_data matches 0 if data storage gm4_horsemanship:temp {item_id:"minecraft:beetroot"} on vehicle run function gm4_horsemanship:horse_processing/food/type/beetroot +execute if score $food_processed gm4_horse_data matches 0 if data storage gm4_horsemanship:temp {item_id:"minecraft:bread"} on vehicle run function gm4_horsemanship:horse_processing/food/type/bread +execute if score $food_processed gm4_horse_data matches 0 if data storage gm4_horsemanship:temp {item_id:"minecraft:baked_potato"} on vehicle run function gm4_horsemanship:horse_processing/food/type/baked_potato +data remove storage gm4_horsemanship:temp item_id + +# playsound and remove the fed item +execute on vehicle at @s run playsound entity.horse.eat neutral @a ~ ~ ~ 1 1 +item modify entity @s[gamemode=!creative] weapon.mainhand {"function": "minecraft:set_count","count":-1,"add":true} + +# restore player location +function gm4_horsemanship:restore_location/prep diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/feed_added_food_untamed.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/feed_added_food_untamed.mcfunction new file mode 100644 index 0000000000..9b2f5cd75d --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/feed_added_food_untamed.mcfunction @@ -0,0 +1,27 @@ +# check feeding the gm4_horse a food item added by this module +# @s = player feeding the gm4_horse +# at @s +# run from advancement feed_untamed_horse + +# check nearby horses to find the one that was fed +tag @s add gm4_horse_check_player +execute as @e[type=#gm4_horsemanship:trainable,distance=..8] run function gm4_horsemanship:horse_processing/food/check_horse +tag @s remove gm4_horse_check_player + +## NOTE: Short Grass is not included in this list as it does not increase Temper (similar to Hay Bales) + +# check advancement criteria to find used food item +scoreboard players set $food_processed gm4_horse_data 0 +execute if score $food_processed gm4_horse_data matches 0 if entity @s[advancements={gm4_horsemanship:feed_untamed_horse={baked_potato=true}}] as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_target,distance=..8,limit=1] run function gm4_horsemanship:horse_processing/food/type/baked_potato +execute if score $food_processed gm4_horse_data matches 0 if entity @s[advancements={gm4_horsemanship:feed_untamed_horse={beetroot=true}}] as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_target,distance=..8,limit=1] run function gm4_horsemanship:horse_processing/food/type/beetroot +execute if score $food_processed gm4_horse_data matches 0 if entity @s[advancements={gm4_horsemanship:feed_untamed_horse={bread=true}}] as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_target,distance=..8,limit=1] run function gm4_horsemanship:horse_processing/food/type/bread +execute if score $food_processed gm4_horse_data matches 0 if entity @s[advancements={gm4_horsemanship:feed_untamed_horse={chorus_fruit=true}}] as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_target,distance=..8,limit=1] run function gm4_horsemanship:horse_processing/food/type/chorus_fruit +execute if score $food_processed gm4_horse_data matches 0 if entity @s[advancements={gm4_horsemanship:feed_untamed_horse={dried_kelp=true}}] as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_target,distance=..8,limit=1] run function gm4_horsemanship:horse_processing/food/type/dried_kelp +execute if score $food_processed gm4_horse_data matches 0 if entity @s[advancements={gm4_horsemanship:feed_untamed_horse={glow_berries=true}}] as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_target,distance=..8,limit=1] run function gm4_horsemanship:horse_processing/food/type/glow_berries +execute if score $food_processed gm4_horse_data matches 0 if entity @s[advancements={gm4_horsemanship:feed_untamed_horse={melon_slice=true}}] as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_target,distance=..8,limit=1] run function gm4_horsemanship:horse_processing/food/type/melon_slice +execute if score $food_processed gm4_horse_data matches 0 if entity @s[advancements={gm4_horsemanship:feed_untamed_horse={sweet_berries=true}}] as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_target,distance=..8,limit=1] run function gm4_horsemanship:horse_processing/food/type/sweet_berries +advancement revoke @s only gm4_horsemanship:feed_untamed_horse + +# playsound and remove the fed item +execute at @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_target,distance=..8,limit=1] run playsound entity.horse.eat neutral @a ~ ~ ~ 1 1 +item modify entity @s[gamemode=!creative] weapon.mainhand {"function": "minecraft:set_count","count":-1,"add":true} diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/feed_original_food.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/feed_original_food.mcfunction new file mode 100644 index 0000000000..3034b6b112 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/feed_original_food.mcfunction @@ -0,0 +1,22 @@ +# check feeding the gm4_horse an original food item +# @s = player feeding the gm4_horse +# at @s +# run from advancement feed_horse + +# check nearby horses to find the one that was fed +tag @s add gm4_horse_check_player +execute as @e[type=#gm4_horsemanship:trainable,distance=..8] run function gm4_horsemanship:horse_processing/food/check_horse +tag @s remove gm4_horse_check_player + +# check advancement criteria to find used food item +scoreboard players set $food_processed gm4_horse_data 0 +execute if score $food_processed gm4_horse_data matches 0 if entity @s[advancements={gm4_horsemanship:feed_horse={apple=true}}] as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_target,distance=..8,limit=1] run function gm4_horsemanship:horse_processing/food/type/apple +execute if score $food_processed gm4_horse_data matches 0 if entity @s[advancements={gm4_horsemanship:feed_horse={golden_apple=true}}] as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_target,distance=..8,limit=1] run function gm4_horsemanship:horse_processing/food/type/golden_apple +execute if score $food_processed gm4_horse_data matches 0 if entity @s[advancements={gm4_horsemanship:feed_horse={enchanted_golden_apple=true}}] as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_target,distance=..8,limit=1] run function gm4_horsemanship:horse_processing/food/type/enchanted_golden_apple +execute if score $food_processed gm4_horse_data matches 0 if entity @s[advancements={gm4_horsemanship:feed_horse={carrot=true}}] as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_target,distance=..8,limit=1] run function gm4_horsemanship:horse_processing/food/type/carrot +execute if score $food_processed gm4_horse_data matches 0 if entity @s[advancements={gm4_horsemanship:feed_horse={golden_carrot=true}}] as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_target,distance=..8,limit=1] run function gm4_horsemanship:horse_processing/food/type/golden_carrot +execute if score $food_processed gm4_horse_data matches 0 if entity @s[advancements={gm4_horsemanship:feed_horse={sugar=true}}] as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_target,distance=..8,limit=1] run function gm4_horsemanship:horse_processing/food/type/sugar +execute if score $food_processed gm4_horse_data matches 0 if entity @s[advancements={gm4_horsemanship:feed_horse={wheat=true}}] as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_target,distance=..8,limit=1] run function gm4_horsemanship:horse_processing/food/type/wheat +execute if score $food_processed gm4_horse_data matches 0 if entity @s[advancements={gm4_horsemanship:feed_horse={hay_block=true}}] as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse_target,distance=..8,limit=1] run function gm4_horsemanship:horse_processing/food/type/hay_block +advancement revoke @s only gm4_horsemanship:feed_horse + diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/apple.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/apple.mcfunction new file mode 100644 index 0000000000..6d7b26f6e9 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/apple.mcfunction @@ -0,0 +1,16 @@ +# process horse being fed food +# @s = gm4_horse +# at unspecified +# run from horse_processing/food/feed_original_food + +scoreboard players set $food_processed gm4_horse_data 1 +tag @s remove gm4_horse_target + +function gm4_horsemanship:horse_processing/cap_health + + +execute unless entity @s[tag=gm4_horse.tamed] run return 0 +scoreboard players operation $add_stamina gm4_horse_data = @s gm4_horse.level +scoreboard players add $add_stamina gm4_horse_data 15 +scoreboard players operation @s gm4_horse.stamina += $add_stamina gm4_horse_data +scoreboard players operation @s gm4_horse.stamina < @s gm4_horse.stamina_cap diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/baked_potato.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/baked_potato.mcfunction new file mode 100644 index 0000000000..1e3e56d1f3 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/baked_potato.mcfunction @@ -0,0 +1,28 @@ +# process horse being fed food +# @s = gm4_horse +# at unspecified +# run from horse_processing/food/feed_added_food +# run from horse_processing/food/feed_added_food_untamed + +scoreboard players set $food_processed gm4_horse_data 1 +tag @s remove gm4_horse_target + +execute store result score $health gm4_horse_data run data get entity @s Health 100 +execute store result score $age gm4_horse_data run data get entity @s Age +execute store result score $temper gm4_horse_data run data get entity @s Temper + +scoreboard players add $health gm4_horse_data 400 +scoreboard players set $add_age gm4_horse_data 1200 +scoreboard players add $temper gm4_horse_data 3 + + +execute store result entity @s Health float 0.01 run scoreboard players get $health gm4_horse_data +function gm4_horsemanship:horse_processing/cap_health +execute if score $age gm4_horse_data matches ..-1 run function gm4_horsemanship:horse_processing/food/add_age +execute store result entity @s Temper int 1 run scoreboard players get $temper gm4_horse_data + +execute unless entity @s[tag=gm4_horse.tamed] run return 0 +scoreboard players operation $add_stamina gm4_horse_data = @s gm4_horse.level +scoreboard players add $add_stamina gm4_horse_data 15 +scoreboard players operation @s gm4_horse.stamina += $add_stamina gm4_horse_data +scoreboard players operation @s gm4_horse.stamina < @s gm4_horse.stamina_cap diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/beetroot.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/beetroot.mcfunction new file mode 100644 index 0000000000..08d2097928 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/beetroot.mcfunction @@ -0,0 +1,28 @@ +# process horse being fed food +# @s = gm4_horse +# at unspecified +# run from horse_processing/food/feed_added_food +# run from horse_processing/food/feed_added_food_untamed + +scoreboard players set $food_processed gm4_horse_data 1 +tag @s remove gm4_horse_target + +execute store result score $health gm4_horse_data run data get entity @s Health 100 +execute store result score $age gm4_horse_data run data get entity @s Age +execute store result score $temper gm4_horse_data run data get entity @s Temper + +scoreboard players add $health gm4_horse_data 200 +scoreboard players set $add_age gm4_horse_data 400 +scoreboard players add $temper gm4_horse_data 3 + + +execute store result entity @s Health float 0.01 run scoreboard players get $health gm4_horse_data +function gm4_horsemanship:horse_processing/cap_health +execute if score $age gm4_horse_data matches ..-1 run function gm4_horsemanship:horse_processing/food/add_age +execute store result entity @s Temper int 1 run scoreboard players get $temper gm4_horse_data + +execute unless entity @s[tag=gm4_horse.tamed] run return 0 +scoreboard players operation $add_stamina gm4_horse_data = @s gm4_horse.level +scoreboard players add $add_stamina gm4_horse_data 15 +scoreboard players operation @s gm4_horse.stamina += $add_stamina gm4_horse_data +scoreboard players operation @s gm4_horse.stamina < @s gm4_horse.stamina_cap diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/bread.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/bread.mcfunction new file mode 100644 index 0000000000..9ea4a4ea30 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/bread.mcfunction @@ -0,0 +1,30 @@ +# process horse being fed food +# @s = gm4_horse +# at unspecified +# run from horse_processing/food/feed_added_food +# run from horse_processing/food/feed_added_food_untamed + +scoreboard players set $food_processed gm4_horse_data 1 +tag @s remove gm4_horse_target + +execute store result score $health gm4_horse_data run data get entity @s Health 100 +execute store result score $age gm4_horse_data run data get entity @s Age +execute store result score $temper gm4_horse_data run data get entity @s Temper + +scoreboard players add $health gm4_horse_data 800 +scoreboard players set $add_age gm4_horse_data 1600 +scoreboard players add $temper gm4_horse_data 12 + + +execute store result entity @s Health float 0.01 run scoreboard players get $health gm4_horse_data +function gm4_horsemanship:horse_processing/cap_health +execute if score $age gm4_horse_data matches ..-1 run function gm4_horsemanship:horse_processing/food/add_age +execute store result entity @s Temper int 1 run scoreboard players get $temper gm4_horse_data + + +execute unless entity @s[tag=gm4_horse.tamed] run return 0 +scoreboard players operation $add_stamina gm4_horse_data = @s gm4_horse.level +scoreboard players operation $add_stamina gm4_horse_data *= #4 gm4_horse_data +scoreboard players add $add_stamina gm4_horse_data 15 +scoreboard players operation @s gm4_horse.stamina += $add_stamina gm4_horse_data +scoreboard players operation @s gm4_horse.stamina < @s gm4_horse.stamina_cap diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/carrot.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/carrot.mcfunction new file mode 100644 index 0000000000..0ae410997a --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/carrot.mcfunction @@ -0,0 +1,15 @@ +# process horse being fed food +# @s = gm4_horse +# at unspecified +# run from horse_processing/food/feed_original_food + +scoreboard players set $food_processed gm4_horse_data 1 +tag @s remove gm4_horse_target + +function gm4_horsemanship:horse_processing/cap_health + +execute unless entity @s[tag=gm4_horse.tamed] run return 0 +scoreboard players operation $add_stamina gm4_horse_data = @s gm4_horse.level +scoreboard players add $add_stamina gm4_horse_data 15 +scoreboard players operation @s gm4_horse.stamina += $add_stamina gm4_horse_data +scoreboard players operation @s gm4_horse.stamina < @s gm4_horse.stamina_cap diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/chorus_fruit.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/chorus_fruit.mcfunction new file mode 100644 index 0000000000..914faaeea2 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/chorus_fruit.mcfunction @@ -0,0 +1,32 @@ +# process horse being fed food +# @s = gm4_horse +# at unspecified +# run from horse_processing/food/feed_added_food +# run from horse_processing/food/feed_added_food_untamed + +tag @s add gm4_horse_warp_target +schedule function gm4_horsemanship:horse_processing/food/chorus_warp/context 1t + +scoreboard players set $food_processed gm4_horse_data 1 +tag @s remove gm4_horse_target + +execute store result score $health gm4_horse_data run data get entity @s Health 100 +execute store result score $age gm4_horse_data run data get entity @s Age +execute store result score $temper gm4_horse_data run data get entity @s Temper + +scoreboard players add $health gm4_horse_data 100 +scoreboard players set $add_age gm4_horse_data 400 +scoreboard players add $temper gm4_horse_data 1 + + +execute store result entity @s Health float 0.01 run scoreboard players get $health gm4_horse_data +function gm4_horsemanship:horse_processing/cap_health +execute if score $age gm4_horse_data matches ..-1 run function gm4_horsemanship:horse_processing/food/add_age +execute store result entity @s Temper int 1 run scoreboard players get $temper gm4_horse_data + + +execute unless entity @s[tag=gm4_horse.tamed] run return 0 +scoreboard players operation $add_stamina gm4_horse_data = @s gm4_horse.level +scoreboard players add $add_stamina gm4_horse_data 5 +scoreboard players operation @s gm4_horse.stamina += $add_stamina gm4_horse_data +scoreboard players operation @s gm4_horse.stamina < @s gm4_horse.stamina_cap diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/dried_kelp.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/dried_kelp.mcfunction new file mode 100644 index 0000000000..8f2ae20db0 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/dried_kelp.mcfunction @@ -0,0 +1,28 @@ +# process horse being fed food +# @s = gm4_horse +# at unspecified +# run from horse_processing/food/feed_added_food +# run from horse_processing/food/feed_added_food_untamed + +scoreboard players set $food_processed gm4_horse_data 1 +tag @s remove gm4_horse_target + +execute store result score $health gm4_horse_data run data get entity @s Health 100 +execute store result score $age gm4_horse_data run data get entity @s Age +execute store result score $temper gm4_horse_data run data get entity @s Temper + +scoreboard players add $health gm4_horse_data 200 +scoreboard players set $add_age gm4_horse_data 600 +scoreboard players add $temper gm4_horse_data 1 + + +execute store result entity @s Health float 0.01 run scoreboard players get $health gm4_horse_data +function gm4_horsemanship:horse_processing/cap_health +execute if score $age gm4_horse_data matches ..-1 run function gm4_horsemanship:horse_processing/food/add_age +execute store result entity @s Temper int 1 run scoreboard players get $temper gm4_horse_data + + +execute unless entity @s[tag=gm4_horse.tamed] run return 0 +scoreboard players operation $add_stamina gm4_horse_data = @s gm4_horse.level +scoreboard players operation @s gm4_horse.stamina += $add_stamina gm4_horse_data +scoreboard players operation @s gm4_horse.stamina < @s gm4_horse.stamina_cap diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/enchanted_golden_apple.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/enchanted_golden_apple.mcfunction new file mode 100644 index 0000000000..661c70089a --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/enchanted_golden_apple.mcfunction @@ -0,0 +1,9 @@ +# process horse being fed food +# @s = gm4_horse +# at unspecified +# run from horse_processing/food/feed_original_food + +scoreboard players set $food_processed gm4_horse_data 1 +tag @s remove gm4_horse_target + +function gm4_horsemanship:horse_processing/cap_health diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/glow_berries.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/glow_berries.mcfunction new file mode 100644 index 0000000000..8da18d4524 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/glow_berries.mcfunction @@ -0,0 +1,31 @@ +# process horse being fed food +# @s = gm4_horse +# at unspecified +# run from horse_processing/food/feed_added_food +# run from horse_processing/food/feed_added_food_untamed + +effect give @s glowing 30 0 + +scoreboard players set $food_processed gm4_horse_data 1 +tag @s remove gm4_horse_target + +execute store result score $health gm4_horse_data run data get entity @s Health 100 +execute store result score $age gm4_horse_data run data get entity @s Age +execute store result score $temper gm4_horse_data run data get entity @s Temper + +scoreboard players add $health gm4_horse_data 100 +scoreboard players set $add_age gm4_horse_data 400 +scoreboard players add $temper gm4_horse_data 1 + + +execute store result entity @s Health float 0.01 run scoreboard players get $health gm4_horse_data +function gm4_horsemanship:horse_processing/cap_health +execute if score $age gm4_horse_data matches ..-1 run function gm4_horsemanship:horse_processing/food/add_age +execute store result entity @s Temper int 1 run scoreboard players get $temper gm4_horse_data + + +execute unless entity @s[tag=gm4_horse.tamed] run return 0 +scoreboard players operation $add_stamina gm4_horse_data = @s gm4_horse.level +scoreboard players add $add_stamina gm4_horse_data 5 +scoreboard players operation @s gm4_horse.stamina += $add_stamina gm4_horse_data +scoreboard players operation @s gm4_horse.stamina < @s gm4_horse.stamina_cap diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/golden_apple.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/golden_apple.mcfunction new file mode 100644 index 0000000000..661c70089a --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/golden_apple.mcfunction @@ -0,0 +1,9 @@ +# process horse being fed food +# @s = gm4_horse +# at unspecified +# run from horse_processing/food/feed_original_food + +scoreboard players set $food_processed gm4_horse_data 1 +tag @s remove gm4_horse_target + +function gm4_horsemanship:horse_processing/cap_health diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/golden_carrot.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/golden_carrot.mcfunction new file mode 100644 index 0000000000..661c70089a --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/golden_carrot.mcfunction @@ -0,0 +1,9 @@ +# process horse being fed food +# @s = gm4_horse +# at unspecified +# run from horse_processing/food/feed_original_food + +scoreboard players set $food_processed gm4_horse_data 1 +tag @s remove gm4_horse_target + +function gm4_horsemanship:horse_processing/cap_health diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/hay_block.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/hay_block.mcfunction new file mode 100644 index 0000000000..cbfce92917 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/hay_block.mcfunction @@ -0,0 +1,13 @@ +# process horse being fed food +# @s = gm4_horse +# at unspecified +# run from horse_processing/food/feed_original_food + +scoreboard players set $food_processed gm4_horse_data 1 +tag @s remove gm4_horse_target + +function gm4_horsemanship:horse_processing/cap_health + +execute unless entity @s[tag=gm4_horse.tamed] run return 0 +scoreboard players remove @s gm4_horse.stamina 25 +scoreboard players operation @s gm4_horse.stamina > #0 gm4_horse_data diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/melon_slice.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/melon_slice.mcfunction new file mode 100644 index 0000000000..3231bd9fe2 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/melon_slice.mcfunction @@ -0,0 +1,29 @@ +# process horse being fed food +# @s = gm4_horse +# at unspecified +# run from horse_processing/food/feed_added_food +# run from horse_processing/food/feed_added_food_untamed + +scoreboard players set $food_processed gm4_horse_data 1 +tag @s remove gm4_horse_target + +execute store result score $health gm4_horse_data run data get entity @s Health 100 +execute store result score $age gm4_horse_data run data get entity @s Age +execute store result score $temper gm4_horse_data run data get entity @s Temper + +scoreboard players add $health gm4_horse_data 100 +scoreboard players set $add_age gm4_horse_data 400 +scoreboard players add $temper gm4_horse_data 3 + + +execute store result entity @s Health float 0.01 run scoreboard players get $health gm4_horse_data +function gm4_horsemanship:horse_processing/cap_health +execute if score $age gm4_horse_data matches ..-1 run function gm4_horsemanship:horse_processing/food/add_age +execute store result entity @s Temper int 1 run scoreboard players get $temper gm4_horse_data + + +execute unless entity @s[tag=gm4_horse.tamed] run return 0 +scoreboard players operation $add_stamina gm4_horse_data = @s gm4_horse.level +scoreboard players add $add_stamina gm4_horse_data 5 +scoreboard players operation @s gm4_horse.stamina += $add_stamina gm4_horse_data +scoreboard players operation @s gm4_horse.stamina < @s gm4_horse.stamina_cap diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/short_grass.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/short_grass.mcfunction new file mode 100644 index 0000000000..185fc9196a --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/short_grass.mcfunction @@ -0,0 +1,24 @@ +# process horse being fed food +# @s = gm4_horse +# at unspecified +# run from horse_processing/food/feed_added_food +# run from horse_processing/food/feed_added_food_untamed + +scoreboard players set $food_processed gm4_horse_data 1 +tag @s remove gm4_horse_target + +execute store result score $health gm4_horse_data run data get entity @s Health 100 +execute store result score $age gm4_horse_data run data get entity @s Age + +scoreboard players add $health gm4_horse_data 100 +scoreboard players set $add_age gm4_horse_data 400 + + +execute store result entity @s Health float 0.01 run scoreboard players get $health gm4_horse_data +function gm4_horsemanship:horse_processing/cap_health +execute if score $age gm4_horse_data matches ..-1 run function gm4_horsemanship:horse_processing/food/add_age + + +execute unless entity @s[tag=gm4_horse.tamed] run return 0 +scoreboard players remove @s gm4_horse.stamina 10 +scoreboard players operation @s gm4_horse.stamina > #0 gm4_horse_data diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/sugar.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/sugar.mcfunction new file mode 100644 index 0000000000..8becf74b37 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/sugar.mcfunction @@ -0,0 +1,18 @@ +# process horse being fed food +# @s = gm4_horse +# at unspecified +# run from horse_processing/food/feed_original_food + +scoreboard players set $food_processed gm4_horse_data 1 +tag @s remove gm4_horse_target + +effect give @s speed 60 0 + +function gm4_horsemanship:horse_processing/cap_health + +execute unless entity @s[tag=gm4_horse.tamed] run return 0 +scoreboard players operation $add_stamina gm4_horse_data = @s gm4_horse.level +scoreboard players operation $add_stamina gm4_horse_data *= #3 gm4_horse_data +scoreboard players add $add_stamina gm4_horse_data 15 +scoreboard players operation @s gm4_horse.stamina += $add_stamina gm4_horse_data +scoreboard players operation @s gm4_horse.stamina < @s gm4_horse.stamina_cap diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/sweet_berries.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/sweet_berries.mcfunction new file mode 100644 index 0000000000..743a52c186 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/sweet_berries.mcfunction @@ -0,0 +1,29 @@ +# process horse being fed food +# @s = gm4_horse +# at unspecified +# run from horse_processing/food/feed_added_food +# run from horse_processing/food/feed_added_food_untamed + +scoreboard players set $food_processed gm4_horse_data 1 +tag @s remove gm4_horse_target + +execute store result score $health gm4_horse_data run data get entity @s Health 100 +execute store result score $age gm4_horse_data run data get entity @s Age +execute store result score $temper gm4_horse_data run data get entity @s Temper + +scoreboard players add $health gm4_horse_data 200 +scoreboard players set $add_age gm4_horse_data 400 +scoreboard players add $temper gm4_horse_data 3 + + +execute store result entity @s Health float 0.01 run scoreboard players get $health gm4_horse_data +function gm4_horsemanship:horse_processing/cap_health +execute if score $age gm4_horse_data matches ..-1 run function gm4_horsemanship:horse_processing/food/add_age +execute store result entity @s Temper int 1 run scoreboard players get $temper gm4_horse_data + + +execute unless entity @s[tag=gm4_horse.tamed] run return 0 +scoreboard players operation $add_stamina gm4_horse_data = @s gm4_horse.level +scoreboard players add $add_stamina gm4_horse_data 15 +scoreboard players operation @s gm4_horse.stamina += $add_stamina gm4_horse_data +scoreboard players operation @s gm4_horse.stamina < @s gm4_horse.stamina_cap diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/wheat.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/wheat.mcfunction new file mode 100644 index 0000000000..9b0fc4b1c5 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/food/type/wheat.mcfunction @@ -0,0 +1,14 @@ +# process horse being fed food +# @s = gm4_horse +# at unspecified +# run from horse_processing/food/feed_original_food + +scoreboard players set $food_processed gm4_horse_data 1 +tag @s remove gm4_horse_target + +function gm4_horsemanship:horse_processing/cap_health + + +execute unless entity @s[tag=gm4_horse.tamed] run return 0 +scoreboard players remove @s gm4_horse.stamina 5 +scoreboard players operation @s gm4_horse.stamina > #0 gm4_horse_data diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/general.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/general.mcfunction new file mode 100644 index 0000000000..2dcf55fe91 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/general.mcfunction @@ -0,0 +1,64 @@ +# process gm4 horses, variants, donkeys and mules +# @s = tamed gm4_horse +# at @s +# run from main + +# check health cap +function gm4_horsemanship:horse_processing/cap_health + +## | Health Status +# health should always be slightly below max, to allow for feeding the horse at any time +execute store result score $max_health gm4_horse_data run attribute @s max_health get 100 +scoreboard players remove $max_health gm4_horse_data 101 +execute store result score $curr_health gm4_horse_data run data get entity @s Health 100 +execute if score $curr_health gm4_horse_data > $max_health gm4_horse_data store result entity @s Health float 0.01 run scoreboard players get $max_health gm4_horse_data + +## | Riding Status +# stores all relevant statuses of the horse in scores +scoreboard players set $mounted gm4_horse_data 0 +scoreboard players set $riding gm4_horse_data 0 +execute store success score $mounted gm4_horse_data on controller if entity @s[type=player] +execute if score $mounted gm4_horse_data matches 1 on controller store result score $riding gm4_horse_data if predicate gm4_horsemanship:riding +execute store result score $on_ground gm4_horse_data run data get entity @s OnGround + +# give horses in love a speed boost (slow horses may fail to breed) +execute store result score $in_love gm4_horse_data run data get entity @s InLove +execute if score $in_love gm4_horse_data matches 1.. if score $mounted gm4_horse_data matches 0 run effect give @s speed 1 4 true + +# wearing glider +execute if items entity @s[tag=!gm4_horse.glider_disabled] armor.body *[custom_data~{gm4_horsemanship:{glider:{}}}] run function gm4_horsemanship:horse_processing/glider/process + +## | Stamina +# cap of 75 - 450 depending on level +# riding = -1 +# swimming = -1 +execute if score $riding gm4_horse_data matches 1 run scoreboard players remove @s[scores={gm4_horse.stamina=1..}] gm4_horse.stamina 1 +execute if entity @s[tag=gm4_horse.swimming] run scoreboard players remove @s[scores={gm4_horse.stamina=1..}] gm4_horse.stamina 1 +# mounted = +1 +# unmounted = +1 +level +execute if score $on_ground gm4_horse_data matches 1 if score $riding gm4_horse_data matches 0 run scoreboard players add @s gm4_horse.stamina 1 +execute if score $on_ground gm4_horse_data matches 1 if score $mounted gm4_horse_data matches 0 run scoreboard players operation @s gm4_horse.stamina += @s gm4_horse.level +scoreboard players operation @s gm4_horse.stamina < @s gm4_horse.stamina_cap +# tired +execute if score @s[tag=!gm4_horse.tired] gm4_horse.stamina matches 0 run function gm4_horsemanship:horse_processing/stamina/tired +execute if score @s[tag=gm4_horse.tired] gm4_horse.stamina matches 30.. run function gm4_horsemanship:horse_processing/stamina/rested +# effects +execute if entity @s[tag=gm4_horse.tired] run particle entity_effect{color:[0.290,0.259,0.090,0.75]} ~ ~1 ~ 0.5 0.5 0.5 1 4 normal +scoreboard players add $sfx_clock gm4_horse_data 1 +execute if score $sfx_clock gm4_horse_data matches 3.. run scoreboard players set $sfx_clock gm4_horse_data 0 +execute if score $sfx_clock gm4_horse_data matches 0 if score @s gm4_horse.stamina matches 0 run playsound entity.horse.breathe neutral @a ~ ~ ~ 1 0.95 +execute if score $sfx_clock gm4_horse_data matches 1 if score @s gm4_horse.stamina matches ..15 run playsound entity.horse.breathe neutral @a ~ ~ ~ 1 0.95 +execute if score $sfx_clock gm4_horse_data matches 2 if score @s gm4_horse.stamina matches ..30 run playsound entity.horse.breathe neutral @a ~ ~ ~ 1 0.95 + +# stop grazing if horse is being ridden +execute if score $riding gm4_horse_data matches 1 if entity @s[nbt={EatingHaystack:1b}] run function gm4_horsemanship:horse_processing/graze/cancel + +# copy frost walking level on rider's boots +execute store result score $stored_frost_walker_level gm4_horse_data run data get entity @s equipment.feet.components."minecraft:enchantments"."minecraft:frost_walker" +execute on passengers run item replace block 29999998 1 7134 container.0 from entity @s[type=player] armor.feet +execute store result score $set_frost_walker_level gm4_horse_data run data get block 29999998 1 7134 Items[0].components."minecraft:enchantments"."minecraft:frost_walker" +execute unless score $stored_frost_walker_level gm4_horse_data = $set_frost_walker_level gm4_horse_data store result entity @s equipment.feet.components."minecraft:enchantments"."minecraft:frost_walker" int 1 run scoreboard players operation $stored_frost_walker_level gm4_horse_data = $set_frost_walker_level gm4_horse_data + +# reduce experience to next level as horse is being ridden +execute if score $riding gm4_horse_data matches 1 run scoreboard players remove @s[tag=!gm4_horse.tired] gm4_horse.experience_to_level 1 +execute if score @s[tag=!gm4_horse.tired] gm4_horse.experience_to_level matches ..0 run function gm4_horsemanship:level/level_up diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/fly.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/fly.mcfunction new file mode 100644 index 0000000000..aeb441c52c --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/fly.mcfunction @@ -0,0 +1,22 @@ +# set this gm4_horses as flying +# @s = tamed gm4_horse +# at @s +# run from horse_processing/glider/process + +tag @s add gm4_horse.gliding + +data modify entity @s equipment.body.components."minecraft:custom_data".gm4_horsemanship.glider.grounded set value 0 +data modify entity @s equipment.body.components."minecraft:attribute_modifiers"[{"type":"minecraft:jump_strength","id":"gm4_horsemanship:horse_wings"}].amount set value -1 +data modify entity @s equipment.body.components."minecraft:attribute_modifiers"[{"type":"minecraft:movement_speed","id":"gm4_horsemanship:horse_wings"}].amount set value 1 +scoreboard players set $grounded gm4_horse_data 0 + +data modify entity @s equipment.body.components."minecraft:equippable".asset_id set value "minecraft:air" +playsound item.armor.equip_elytra player @a ~ ~ ~ 1 1 + +tag @s add gm4_horse.target +execute store result storage gm4_horsemanship:temp scale float 0.00001 run attribute @s scale get 100000 +summon item_display ~ ~ ~ {teleport_duration:1,Tags:["gm4_horse.glider_wing","gm4_horse.new_glider_wing","gm4_horse.glider_wing.right"],transformation:{scale:[2,2,2],left_rotation:[0,1,0,1],right_rotation:[-1,0,0,1],translation:[-0.75,0,0.75]},Rotation:[90,0],item:{id:"feather",count:1,components:{"minecraft:custom_model_data":"item/horse_winged"}}} +summon item_display ~ ~ ~ {teleport_duration:1,Tags:["gm4_horse.glider_wing","gm4_horse.new_glider_wing","gm4_horse.glider_wing.left"],transformation:{scale:[2,2,2],left_rotation:[0,1,0,1],right_rotation:[1,0,0,1],translation:[0.75,0,0.75]},Rotation:[-90,0],item:{id:"feather",count:1,components:{"minecraft:custom_model_data":"item/horse_winged"}}} +execute as @e[type=item_display,tag=gm4_horse.new_glider_wing,distance=..0.1] run function gm4_horsemanship:horse_processing/glider/wing/init +data remove storage gm4_horsemanship:temp scale +tag @s remove gm4_horse.target diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/ground.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/ground.mcfunction new file mode 100644 index 0000000000..b26f340ca1 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/ground.mcfunction @@ -0,0 +1,18 @@ +# set this gm4_horses as being on the ground +# @s = tamed gm4_horse +# at @s +# run from horse_processing/glider/process +# run from horse_processing/glider/unmounted + +tag @s remove gm4_horse.gliding + +data modify entity @s equipment.body.components."minecraft:equippable".asset_id set value "gm4_horsemanship:wings" +playsound item.armor.equip_elytra player @a ~ ~ ~ 1 1 + +data modify entity @s equipment.body.components."minecraft:custom_data".gm4_horsemanship.glider.grounded set value 1 +data modify entity @s equipment.body.components."minecraft:attribute_modifiers"[{"type":"minecraft:gravity","id":"gm4_horsemanship:horse_wings"}].amount set value 0 +data modify entity @s equipment.body.components."minecraft:attribute_modifiers"[{"type":"minecraft:jump_strength","id":"gm4_horsemanship:horse_wings"}].amount set value 0 +data modify entity @s equipment.body.components."minecraft:attribute_modifiers"[{"type":"minecraft:movement_speed","id":"gm4_horsemanship:horse_wings"}].amount set value 0 +scoreboard players set $grounded gm4_horse_data 1 + +execute on passengers run kill @s[type=item_display,tag=gm4_horse.glider_wing] diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/process.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/process.mcfunction new file mode 100644 index 0000000000..5b974596d0 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/process.mcfunction @@ -0,0 +1,37 @@ +# process gm4_horses wearing a glider +# @s = tamed gm4_horse +# at @s +# run from horse_processing/general + +# get stats from glider +execute store result score $grounded gm4_horse_data run data get entity @s equipment.body.components."minecraft:custom_data".gm4_horsemanship.glider.grounded + +# check if horse is even mounted +execute if score $mounted gm4_horse_data matches 0 run return run function gm4_horsemanship:horse_processing/glider/unmounted + +# get player pitch level, add deadzone +scoreboard players set $pitch_level gm4_horse_data 0 +execute on passengers if entity @s[type=player] store result score $pitch_level gm4_horse_data run data get entity @s Rotation[1] 0.1 +execute if score $pitch_level gm4_horse_data matches ..-1 run scoreboard players add $pitch_level gm4_horse_data 1 +execute if score $pitch_level gm4_horse_data matches 1.. run scoreboard players remove $pitch_level gm4_horse_data 1 + +# if not riding ignore pitch +execute if score $riding gm4_horse_data matches 0 run scoreboard players set $pitch_level gm4_horse_data 0 + +# out of stamina (fall down) +execute if entity @s[tag=gm4_horse.tired] run scoreboard players set $pitch_level gm4_horse_data 25 + +# check for a jump +execute on passengers if entity @s[type=player,predicate=gm4_horsemanship:jumping] + +# update glider +execute if score $grounded gm4_horse_data matches 0 if score $on_ground gm4_horse_data matches 1 unless score $pitch_level gm4_horse_data matches ..-1 run function gm4_horsemanship:horse_processing/glider/ground +execute if score $grounded gm4_horse_data matches 1 if score $pitch_level gm4_horse_data matches ..-2 run function gm4_horsemanship:horse_processing/glider/fly + +# if flying update Y motion based on looking direction +execute if score $grounded gm4_horse_data matches 1 run return 0 + +# set gravity based on pitch +scoreboard players operation $set_gravity gm4_horse_data = $pitch_level gm4_horse_data +scoreboard players remove $set_gravity gm4_horse_data 50 +execute store result entity @s equipment.body.components."minecraft:attribute_modifiers"[{"type":"minecraft:gravity","id":"gm4_horsemanship:horse_wings"}].amount float 0.02 run scoreboard players get $set_gravity gm4_horse_data diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/unmounted.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/unmounted.mcfunction new file mode 100644 index 0000000000..51a17a57f4 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/unmounted.mcfunction @@ -0,0 +1,7 @@ +# disable the glider if the gm4_horses is not mounted +# @s = tamed gm4_horse +# at @s +# run from horse_processing/glider/process + +execute if score $grounded gm4_horse_data matches 0 run function gm4_horsemanship:horse_processing/glider/ground +tag @s add gm4_horse.glider_disabled diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/wing/calculate_wing_pitch.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/wing/calculate_wing_pitch.mcfunction new file mode 100644 index 0000000000..54c6177805 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/wing/calculate_wing_pitch.mcfunction @@ -0,0 +1,38 @@ + +scoreboard players add @s gm4_horse.wing_timer 1 +execute on vehicle on passengers if entity @s[type=player] run scoreboard players operation $movement_speed gm4_horse_data = @s gm4_horse.horse_one_cm +scoreboard players operation $movement_speed gm4_horse_data /= #10 gm4_horse_data +execute if score $movement_speed gm4_horse_data matches 11.. run scoreboard players set $movement_speed gm4_horse_data 10 +scoreboard players operation @s gm4_horse.wing_timer += $movement_speed gm4_horse_data + +scoreboard players operation $period_x2 gm4_horse_data = #wing_period gm4_horse_data +scoreboard players operation $period_x2 gm4_horse_data *= #2 gm4_horse_data + +# drain extra stamina, play sound on every flap +execute if score @s[tag=gm4_horse.glider_wing.right] gm4_horse.wing_timer >= $period_x2 gm4_horse_data on vehicle run scoreboard players remove @s[scores={gm4_horse.stamina=1..}] gm4_horse.stamina 1 +execute if score @s[tag=gm4_horse.glider_wing.right] gm4_horse.wing_timer >= $period_x2 gm4_horse_data at @s run playsound minecraft:entity.phantom.flap neutral @a ~ ~ ~ 1 0.75 +execute if score @s gm4_horse.wing_timer >= $period_x2 gm4_horse_data run scoreboard players operation @s gm4_horse.wing_timer -= $period_x2 gm4_horse_data + +execute if score @s gm4_horse.wing_timer < #wing_period gm4_horse_data run scoreboard players operation $phase gm4_horse_data = @s gm4_horse.wing_timer +execute unless score @s gm4_horse.wing_timer < #wing_period gm4_horse_data run scoreboard players operation $phase gm4_horse_data = #wing_period gm4_horse_data +execute unless score @s gm4_horse.wing_timer < #wing_period gm4_horse_data run scoreboard players operation $phase gm4_horse_data *= #2 gm4_horse_data +execute unless score @s gm4_horse.wing_timer < #wing_period gm4_horse_data run scoreboard players remove $phase gm4_horse_data 1 +execute unless score @s gm4_horse.wing_timer < #wing_period gm4_horse_data run scoreboard players operation $phase gm4_horse_data -= @s gm4_horse.wing_timer + +scoreboard players operation $p_1 gm4_horse_data = $phase gm4_horse_data +scoreboard players operation $p_1 gm4_horse_data *= #2000 gm4_horse_data +scoreboard players operation $p_1 gm4_horse_data /= #wing_period gm4_horse_data +scoreboard players remove $p_1 gm4_horse_data 1000 + +scoreboard players operation $p_2 gm4_horse_data = $p_1 gm4_horse_data +scoreboard players operation $p_2 gm4_horse_data *= $p_2 gm4_horse_data +scoreboard players operation $p_2 gm4_horse_data /= #1000 gm4_horse_data + +scoreboard players set $shaped gm4_horse_data 1000 +scoreboard players operation $shaped gm4_horse_data -= $p_2 gm4_horse_data + +scoreboard players operation $pitch gm4_horse_data = $shaped gm4_horse_data +scoreboard players operation $pitch gm4_horse_data *= #3000 gm4_horse_data +execute unless score @s gm4_horse.wing_timer < #wing_period gm4_horse_data run scoreboard players operation $pitch gm4_horse_data *= #-1 gm4_horse_data + +return run scoreboard players operation $pitch gm4_horse_data /= #1000 gm4_horse_data diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/wing/init.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/wing/init.mcfunction new file mode 100644 index 0000000000..02790ba8e5 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/wing/init.mcfunction @@ -0,0 +1,17 @@ + + +execute store result entity @s transformation.scale[0] float 0.00002 run data get storage gm4_horsemanship:temp scale 100000 +execute store result entity @s transformation.scale[1] float 0.00002 run data get storage gm4_horsemanship:temp scale 100000 +execute store result entity @s transformation.scale[2] float 0.00002 run data get storage gm4_horsemanship:temp scale 100000 + + +# forward / side +execute store result entity @s[tag=gm4_horse.glider_wing.right] transformation.translation[0] float -0.00025 run data get storage gm4_horsemanship:temp scale 1000 +execute store result entity @s[tag=gm4_horse.glider_wing.left] transformation.translation[0] float 0.00025 run data get storage gm4_horsemanship:temp scale 1000 +execute store result entity @s transformation.translation[1] float -0.0001875 run data get storage gm4_horsemanship:temp scale 1000 +execute store result entity @s transformation.translation[2] float 0.00095 run data get storage gm4_horsemanship:temp scale 1000 + +tag @s remove gm4_horse.new_glider_wing +ride @s mount @e[type=#gm4_horsemanship:trainable,tag=gm4_horse.target,distance=..0.1,limit=1] + +scoreboard players set @s gm4_horse.wing_timer 0 diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/wing/update.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/wing/update.mcfunction new file mode 100644 index 0000000000..c042e18a64 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/glider/wing/update.mcfunction @@ -0,0 +1,7 @@ + +execute on vehicle store result score $set_yaw gm4_horse_data run data get entity @s Rotation[0] 100 +execute if entity @s[tag=gm4_horse.glider_wing.right] run scoreboard players add $set_yaw gm4_horse_data 8000 +execute if entity @s[tag=gm4_horse.glider_wing.left] run scoreboard players remove $set_yaw gm4_horse_data 8000 +execute store result entity @s Rotation[0] float 0.01 run scoreboard players get $set_yaw gm4_horse_data + +execute store result entity @s Rotation[1] float 0.01 run function gm4_horsemanship:horse_processing/glider/wing/calculate_wing_pitch diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/graze/cancel.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/graze/cancel.mcfunction new file mode 100644 index 0000000000..2e6c7e2adb --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/graze/cancel.mcfunction @@ -0,0 +1,7 @@ +# cancel grazing gm4_horses if they are being ridden +# @s = gm4_horse +# at @s +# run from horse_processsing/general + +tag @s remove gm4_horse.grazing +data modify entity @s EatingHaystack set value 0b diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/graze/complete.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/graze/complete.mcfunction new file mode 100644 index 0000000000..e47212b362 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/graze/complete.mcfunction @@ -0,0 +1,18 @@ +# process gm4_horses that completed grazing +# @s = gm4_horse +# at @s +# run from horse_processing/graze/tick + +tag @s remove gm4_horse.grazing + +# if this is a baby horse accelerate its growth by 10% (same effect as on sheep) +execute store result score $age gm4_horse_data run data get entity @s Age +execute if score $age gm4_horse_data matches ..-1 run function gm4_horsemanship:horse_processing/graze/foal + +# break grass (block) if mobGriefing is enabled +# horses can only eat grass or grass blocks but not flowers or tall grass, similar to sheep +execute store result score $mobGriefing gm4_horse_data run gamerule mobGriefing +execute if score $mobGriefing gm4_horse_data matches 1 unless block ~ ~ ~ short_grass run fill ~ ~ ~ ~ ~-1 ~ dirt replace grass_block +execute if score $mobGriefing gm4_horse_data matches 1 if block ~ ~ ~ short_grass run fill ~ ~ ~ ~ ~ ~ air replace short_grass +playsound minecraft:block.grass.break block @a ~ ~ ~ 1 1 +particle block{block_state:"grass_block"} ~ ~ ~ 0.2 0.05 0.2 0 4 diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/graze/foal.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/graze/foal.mcfunction new file mode 100644 index 0000000000..984326e781 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/graze/foal.mcfunction @@ -0,0 +1,8 @@ +# reduce remaining Age by 10% on foals that eat grass +# @s = gm4_horse +# at @s +# run from horse_processing/graze/tick + +# reduce remaining Age by 10% +execute store result score $age gm4_horse_data run data get entity @s Age +execute store result entity @s Age int 0.9 run scoreboard players get $age gm4_horse_data diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/graze/start.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/graze/start.mcfunction new file mode 100644 index 0000000000..62683867ee --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/graze/start.mcfunction @@ -0,0 +1,7 @@ +# mark this gm4_horse as grazing +# @s = gm4_horse +# at @s +# run from main + +schedule function gm4_horsemanship:horse_processing/graze/tick 1t +tag @s add gm4_horse.grazing diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/graze/tick.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/graze/tick.mcfunction new file mode 100644 index 0000000000..3894e4b551 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/graze/tick.mcfunction @@ -0,0 +1,8 @@ +# process grazing gm4_horses +# @s = unspecified +# at unspecified +# schedule from horse_processing/graze/start +# schedule from here + +execute as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse.grazing,nbt={EatingHaystack:0b}] at @s run function gm4_horsemanship:horse_processing/graze/complete +execute if entity @e[type=#gm4_horsemanship:trainable,tag=gm4_horse.grazing] run schedule function gm4_horsemanship:horse_processing/graze/tick 1t diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/stamina/rested.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/stamina/rested.mcfunction new file mode 100644 index 0000000000..061d2965dc --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/stamina/rested.mcfunction @@ -0,0 +1,8 @@ +# remove tired horse mark once needs are met again +# @s = gm4_horse +# at @s +# run from horse_processsing/general + +attribute @s movement_speed modifier remove gm4_horse.speed.tired +attribute @s jump_strength modifier remove gm4_horse.jump.tired +tag @s remove gm4_horse.tired diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/stamina/tired.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/stamina/tired.mcfunction new file mode 100644 index 0000000000..7926958e23 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/stamina/tired.mcfunction @@ -0,0 +1,8 @@ +# mark horse as tired if its needs are not met +# @s = gm4_horse +# at @s +# run from horse_processsing/general + +attribute @s movement_speed modifier add gm4_horse.speed.tired -0.5 add_multiplied_total +attribute @s jump_strength modifier add gm4_horse.jump.tired -0.5 add_multiplied_total +tag @s add gm4_horse.tired diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/start_riding_horse.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/start_riding_horse.mcfunction new file mode 100644 index 0000000000..adf10dc879 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/start_riding_horse.mcfunction @@ -0,0 +1,13 @@ +# process a player that just mounted a horse with gm4_horse tag (or equivalent) +# @s = player riding the horse +# at @s (before mounting) +advancement revoke @s only gm4_horsemanship:start_riding_horse + +# check if this horse has a feet item +execute on vehicle unless items entity @s armor.feet poisonous_potato[custom_data~{gm4_horsemanship:{}}] unless items entity @s armor.feet *[custom_data~{smithed:{ignore:{functionality:1b}}}] run item replace entity @s armor.feet with poisonous_potato[custom_data={smithed:{ignore:{functionality:1b}},gm4_horsemanship:{}},enchantments={},equippable={slot:"feet",allowed_entities:"#gm4_horsemanship:trainable"}] + +# check for food +execute if predicate gm4_horsemanship:holding_food run return run function gm4_horsemanship:horse_processing/food/feed_added_food + +# | If started riding properly +execute on vehicle run tag @s[tag=gm4_horse.glider_disabled] remove gm4_horse.glider_disabled diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/swim/process.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/swim/process.mcfunction new file mode 100644 index 0000000000..ca4374f43b --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/swim/process.mcfunction @@ -0,0 +1,10 @@ + +scoreboard players set $mounted gm4_horse_data 0 +execute store success score $mounted gm4_horse_data on controller if entity @s[type=player] + +execute if score $mounted gm4_horse_data matches 1 if entity @s[tag=!gm4_horse.swimming] if block ~ ~0.6 ~ water run tag @s add gm4_horse.swimming +execute if score $mounted gm4_horse_data matches 1 if entity @s[tag=gm4_horse.swimming] unless block ~ ~0.35 ~ water run tag @s remove gm4_horse.swimming +execute if score $mounted gm4_horse_data matches 0 if entity @s[tag=gm4_horse.swimming] run tag @s remove gm4_horse.swimming + +scoreboard players set @s[tag=!gm4_horse.swimming] gm4_horse.swim_power 0 +execute if entity @s[tag=gm4_horse.swimming,tag=!gm4_horse.tired] run function gm4_horsemanship:horse_processing/swim/upwards diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/swim/upwards.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/swim/upwards.mcfunction new file mode 100644 index 0000000000..e117b1b665 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/horse_processing/swim/upwards.mcfunction @@ -0,0 +1,7 @@ + +execute store result score $motion_y gm4_horse_data run data get entity @s Motion[1] 200 + +scoreboard players add @s[scores={gm4_horse.swim_power=..19}] gm4_horse.swim_power 1 + +execute if score $motion_y gm4_horse_data matches ..0 run scoreboard players operation $motion_y gm4_horse_data += @s gm4_horse.swim_power +execute store result entity @s Motion[1] double 0.005 run scoreboard players get $motion_y gm4_horse_data diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/init.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/init.mcfunction new file mode 100644 index 0000000000..6a14eaef9b --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/init.mcfunction @@ -0,0 +1,34 @@ +execute unless score horsemanship gm4_modules matches 1 run data modify storage gm4:log queue append value {type:"install",module:"Horsemanship"} +scoreboard players set horsemanship gm4_modules 1 + +# add scoreboards +scoreboard objectives add gm4_horse_data dummy +scoreboard objectives add gm4_horse.level dummy +scoreboard objectives add gm4_horse.speed_on_level dummy +scoreboard objectives add gm4_horse.jump_strength_on_level dummy +scoreboard objectives add gm4_horse.experience_to_level dummy +scoreboard objectives add gm4_horse.stamina dummy +scoreboard objectives add gm4_horse.stamina_cap dummy +scoreboard objectives add gm4_horse.swim_power dummy +scoreboard objectives add gm4_horse.wing_timer dummy +scoreboard objectives add gm4_horse.horse_one_cm custom:horse_one_cm + +# constants +scoreboard players set #-1 gm4_horse_data -1 +scoreboard players set #2 gm4_horse_data 2 +scoreboard players set #4 gm4_horse_data 4 +scoreboard players set #10 gm4_horse_data 10 +scoreboard players set #15 gm4_horse_data 15 +scoreboard players set #25 gm4_horse_data 25 +scoreboard players set #1000 gm4_horse_data 1000 +scoreboard players set #1405 gm4_horse_data 1405 +scoreboard players set #2000 gm4_horse_data 2000 +scoreboard players set #3000 gm4_horse_data 3000 +scoreboard players set #4216 gm4_horse_data 4216 + +scoreboard players set #wing_period gm4_horse_data 30 + +schedule function gm4_horsemanship:tick 1t +schedule function gm4_horsemanship:main 1t + +#$moduleUpdateList diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/level/init_horse.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/level/init_horse.mcfunction new file mode 100644 index 0000000000..36471f491c --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/level/init_horse.mcfunction @@ -0,0 +1,53 @@ +# init a new gm4_horse +# @s = new gm4_horse +# at @s +# run from main + +tag @s add gm4_horse + +# | Max Health & Scale +execute store result storage gm4_horsemanship:temp attribute.health_base float 0.01 run attribute @s max_health base get 100 +# 0.8 - 1.2 +execute store result score $scale gm4_horse_data run attribute @s scale base get 100 +execute store result score $scale_add gm4_horse_data run attribute @s max_health base get 2.666666666 +scoreboard players remove $scale gm4_horse_data 160 +scoreboard players operation $scale gm4_horse_data += $scale_add gm4_horse_data +execute store result storage gm4_horsemanship:temp attribute.scale float 0.01 run scoreboard players get $scale gm4_horse_data + +# | Movement Speed +execute store result storage gm4_horsemanship:temp attribute.speed_base float 0.00001 run attribute @s movement_speed base get 100000 +execute store result score $speed.start gm4_horse_data run attribute @s movement_speed base get 100000 +scoreboard players operation @s gm4_horse.speed_on_level = $speed.start gm4_horse_data +scoreboard players operation @s gm4_horse.speed_on_level *= #1405 gm4_horse_data +scoreboard players operation @s gm4_horse.speed_on_level /= #1000 gm4_horse_data + +scoreboard players add $speed.start gm4_horse_data 20000 +scoreboard players operation $speed.start gm4_horse_data *= #1000 gm4_horse_data +scoreboard players operation $speed.start gm4_horse_data /= #4216 gm4_horse_data +execute store result storage gm4_horsemanship:temp attribute.speed_start float 0.00001 run scoreboard players get $speed.start gm4_horse_data + +scoreboard players operation @s gm4_horse.speed_on_level -= $speed.start gm4_horse_data +scoreboard players operation @s gm4_horse.speed_on_level /= #15 gm4_horse_data + +# | Jump Strength (uses a lower scale to avoid going over the int limit) +execute store result storage gm4_horsemanship:temp attribute.jump_base float 0.00001 run attribute @s jump_strength base get 100000 +execute store result score $jump.start gm4_horse_data run attribute @s jump_strength base get 10000 +scoreboard players set @s gm4_horse.jump_strength_on_level 21000 +scoreboard players operation @s gm4_horse.jump_strength_on_level -= $jump.start gm4_horse_data +scoreboard players operation @s gm4_horse.jump_strength_on_level *= $jump.start gm4_horse_data +scoreboard players operation @s gm4_horse.jump_strength_on_level /= #1000 gm4_horse_data + +scoreboard players remove $jump.start gm4_horse_data 4000 +scoreboard players operation $jump.start gm4_horse_data *= #10 gm4_horse_data +scoreboard players operation $jump.start gm4_horse_data /= #4 gm4_horse_data +scoreboard players add $jump.start gm4_horse_data 44500 +execute store result storage gm4_horsemanship:temp attribute.jump_start float 0.00001 run scoreboard players get $jump.start gm4_horse_data + +scoreboard players operation @s gm4_horse.jump_strength_on_level -= $jump.start gm4_horse_data +scoreboard players operation @s gm4_horse.jump_strength_on_level /= #15 gm4_horse_data + +# modify attributes from storage +function gm4_horsemanship:level/init_horse_eval with storage gm4_horsemanship:temp attribute +#data remove storage gm4_horsemanship:temp attribute + +effect give @s regeneration 4 9 true diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/level/init_horse_eval.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/level/init_horse_eval.mcfunction new file mode 100644 index 0000000000..e1a8969cf2 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/level/init_horse_eval.mcfunction @@ -0,0 +1,21 @@ +# eval stats on this new horse +# @s = new gm4_horse +# at @s +# run from level/init_horse + +# remove base stats +$attribute @s max_health modifier add gm4_horse.health.remove_base -$(health_base) add_value +$attribute @s movement_speed modifier add gm4_horse.speed.remove_base -$(speed_base) add_value +$attribute @s jump_strength modifier add gm4_horse.jump.remove_base -$(jump_base) add_value + +# add boosts for wild horses +attribute @s max_health modifier add gm4_horse.untamed 10 add_value +$attribute @s movement_speed modifier add gm4_horse.untamed $(speed_base) add_value + +# add base stats +attribute @s max_health modifier add gm4_horse.health 11.01 add_value +$attribute @s movement_speed modifier add gm4_horse.speed $(speed_start) add_value +$attribute @s jump_strength modifier add gm4_horse.jump $(jump_start) add_value + +# randomize scale slightly +$attribute @s scale modifier add gm4_horse.scale $(scale) add_value diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/level/level_up.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/level/level_up.mcfunction new file mode 100644 index 0000000000..49d5bf46f5 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/level/level_up.mcfunction @@ -0,0 +1,56 @@ +# apply level-up to gm4_horse +# @s = gm4_horse +# at @s +# run from horse_processsing/general + +# ingore if max level +execute if score @s gm4_horse.level matches 15.. run return 0 + +# | Max Health +execute store result score $health gm4_horse_data run attribute @s max_health modifier value get gm4_horse.health 10 +scoreboard players add $health gm4_horse_data 20 +execute store result storage gm4_horsemanship:temp attribute.health float 0.1 run scoreboard players get $health gm4_horse_data + +# | Movement Speed +execute store result score $speed gm4_horse_data run attribute @s movement_speed modifier value get gm4_horse.speed 100000 +scoreboard players operation $speed gm4_horse_data += @s gm4_horse.speed_on_level +execute store result storage gm4_horsemanship:temp attribute.speed float 0.00001 run scoreboard players get $speed gm4_horse_data + +# | Jump Strength +execute store result score $jump gm4_horse_data run attribute @s jump_strength modifier value get gm4_horse.jump 100000 +scoreboard players operation $jump gm4_horse_data += @s gm4_horse.jump_strength_on_level +execute store result storage gm4_horsemanship:temp attribute.jump float 0.00001 run scoreboard players get $jump gm4_horse_data + +# | Scores +scoreboard players add @s gm4_horse.level 1 +scoreboard players operation @s gm4_horse.stamina_cap += #25 gm4_horse_data +scoreboard players operation @s gm4_horse.stamina += #25 gm4_horse_data +scoreboard players set @s gm4_horse.experience_to_level 0 + +# set new needed experience +execute if score @s gm4_horse.level matches 1 run scoreboard players set @s gm4_horse.experience_to_level 75 +execute if score @s gm4_horse.level matches 2 run scoreboard players set @s gm4_horse.experience_to_level 100 +execute if score @s gm4_horse.level matches 3 run scoreboard players set @s gm4_horse.experience_to_level 150 +execute if score @s gm4_horse.level matches 4 run scoreboard players set @s gm4_horse.experience_to_level 225 +execute if score @s gm4_horse.level matches 5 run scoreboard players set @s gm4_horse.experience_to_level 325 +execute if score @s gm4_horse.level matches 6 run scoreboard players set @s gm4_horse.experience_to_level 450 +execute if score @s gm4_horse.level matches 7 run scoreboard players set @s gm4_horse.experience_to_level 600 +execute if score @s gm4_horse.level matches 8 run scoreboard players set @s gm4_horse.experience_to_level 825 +execute if score @s gm4_horse.level matches 9 run scoreboard players set @s gm4_horse.experience_to_level 1125 +execute if score @s gm4_horse.level matches 10 run scoreboard players set @s gm4_horse.experience_to_level 1500 +execute if score @s gm4_horse.level matches 11 run scoreboard players set @s gm4_horse.experience_to_level 2100 +execute if score @s gm4_horse.level matches 12 run scoreboard players set @s gm4_horse.experience_to_level 3000 +execute if score @s gm4_horse.level matches 13 run scoreboard players set @s gm4_horse.experience_to_level 4500 +execute if score @s gm4_horse.level matches 14 run scoreboard players set @s gm4_horse.experience_to_level 6750 + +# modify attributes from storage +attribute @s max_health modifier remove gm4_horse.health +attribute @s movement_speed modifier remove gm4_horse.speed +attribute @s jump_strength modifier remove gm4_horse.jump +function gm4_horsemanship:level/level_up_eval with storage gm4_horsemanship:temp attribute +data remove storage gm4_horsemanship:temp attribute + +# vfx +particle happy_villager ~ ~1 ~ 1 1 1 0 16 +playsound entity.player.levelup neutral @a ~ ~1 ~ 0.7 1.6 +effect give @s minecraft:regeneration 3 1 diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/level/level_up_eval.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/level/level_up_eval.mcfunction new file mode 100644 index 0000000000..fc7ef04f40 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/level/level_up_eval.mcfunction @@ -0,0 +1,8 @@ +# eval stats on this new horse +# @s = new gm4_horse +# at @s +# run from level/level_up + +$attribute @s max_health modifier add gm4_horse.health $(health) add_value +$attribute @s movement_speed modifier add gm4_horse.speed $(speed) add_value +$attribute @s jump_strength modifier add gm4_horse.jump $(jump) add_value diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/level/tame_horse.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/level/tame_horse.mcfunction new file mode 100644 index 0000000000..9ad855dcb0 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/level/tame_horse.mcfunction @@ -0,0 +1,6 @@ +# process a player that just tamed a horse (or equivalent) +# @s = player taming the horse +# at @s +advancement revoke @s only gm4_horsemanship:tame_horse + +execute on vehicle if entity @s[type=#gm4_horsemanship:trainable,tag=gm4_horse,tag=!gm4_horse.tamed] run function gm4_horsemanship:level/tame_horse_init diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/level/tame_horse_init.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/level/tame_horse_init.mcfunction new file mode 100644 index 0000000000..e25efb2a28 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/level/tame_horse_init.mcfunction @@ -0,0 +1,15 @@ +# set scores and stats for tamed horse +# @s = tamed horse +# at unspecified +# run from level/tame_horse + +tag @s add gm4_horse.tamed + +scoreboard players set @s gm4_horse.level 0 +scoreboard players set @s gm4_horse.experience_to_level 60 +scoreboard players set @s gm4_horse.stamina_cap 75 +scoreboard players operation @s gm4_horse.stamina = @s gm4_horse.stamina_cap + +# remove wild horse boost +attribute @s max_health modifier remove gm4_horse.untamed +attribute @s movement_speed modifier remove gm4_horse.untamed diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/main.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/main.mcfunction new file mode 100644 index 0000000000..c5128ce355 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/main.mcfunction @@ -0,0 +1,14 @@ +schedule function gm4_horsemanship:main 16t + +# init new horses +execute as @e[type=#gm4_horsemanship:trainable,tag=!gm4_horse,tag=!smithed.entity] run function gm4_horsemanship:level/init_horse + +# horse processing +execute as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse.tamed] at @s run function gm4_horsemanship:horse_processing/general + +# horse grazing +execute as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse,tag=!gm4_horse.grazing,nbt={EatingHaystack:1b}] run function gm4_horsemanship:horse_processing/graze/start + + +# dev log +execute as @a[tag=gm4_horse_dev] at @s as @e[type=#gm4_horsemanship:trainable,limit=1,sort=nearest] run title @p actionbar [{text:"| Tracked Horse: "},{selector:"@s"},{text:" Stamina: ","color":"gray"},{"score":{"name":"@s","objective":"gm4_horse.stamina"},"color":"white"},{text:"/"},{"score":{"name":"@s","objective":"gm4_horse.stamina_cap"}},{text:" XP: ","color":"gray"},{"score":{"name":"@s","objective":"gm4_horse.experience_to_level"},"color":"white"},{"text":" |"}] diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/restore_location/prep.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/restore_location/prep.mcfunction new file mode 100644 index 0000000000..4fa3f48e6e --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/restore_location/prep.mcfunction @@ -0,0 +1,8 @@ +# prep restoring the location of this player +# @s = player that just mounted a gm4_horse +# at @s (before mounting) +# run from horse_processing/food/feed_added_food + +tag @s add gm4_horse_self +execute summon marker run function gm4_horsemanship:restore_location/restore +tag @s remove gm4_horse_self diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/restore_location/restore.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/restore_location/restore.mcfunction new file mode 100644 index 0000000000..4687b4fadb --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/restore_location/restore.mcfunction @@ -0,0 +1,7 @@ +# restore player location to before mounting +# @s = marker +# at @s +# run from restore_location/prep + +execute positioned as @s run tp @p[tag=gm4_horse_self] ~ ~ ~ +kill @s diff --git a/gm4_horsemanship/data/gm4_horsemanship/function/tick.mcfunction b/gm4_horsemanship/data/gm4_horsemanship/function/tick.mcfunction new file mode 100644 index 0000000000..36ad39531e --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/function/tick.mcfunction @@ -0,0 +1,8 @@ +schedule function gm4_horsemanship:tick 1t + +# swim +execute as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse.tamed] at @s run function gm4_horsemanship:horse_processing/swim/process + +# glider +execute as @e[type=#gm4_horsemanship:trainable,tag=gm4_horse.gliding] on passengers if entity @s[type=item_display,tag=gm4_horse.glider_wing] run function gm4_horsemanship:horse_processing/glider/wing/update +scoreboard players reset @a gm4_horse.horse_one_cm diff --git a/gm4_horsemanship/data/gm4_horsemanship/gm4_recipes/horse_wings.json b/gm4_horsemanship/data/gm4_horsemanship/gm4_recipes/horse_wings.json new file mode 100644 index 0000000000..5f0cff3dba --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/gm4_recipes/horse_wings.json @@ -0,0 +1,20 @@ +{ + "input": { + "type": "shapeless", + "ingredients": [ + { + "item": "minecraft:iron_horse_armor" + }, + { + "item": "minecraft:elytra" + } + ] + }, + "output": { + "result": { + "type": "loot_table", + "name": "gm4_horsemanship:technical/horse_wing_fake", + "count": 1 + } + } +} diff --git a/gm4_horsemanship/data/gm4_horsemanship/guidebook/horsemanship.json b/gm4_horsemanship/data/gm4_horsemanship/guidebook/horsemanship.json new file mode 100644 index 0000000000..6ef2a0daaa --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/guidebook/horsemanship.json @@ -0,0 +1,60 @@ +{ + "id": "horsemanship", + "name": "Horsemanship", + "module_type": "module", + "icon": { + "id": "minecraft:saddle" + }, + "criteria": { + "ride_horse": { + "trigger": "minecraft:started_riding", + "conditions": { + "player": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "vehicle": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse\"]}" + } + } + } + ] + } + } + }, + "sections": [ + { + "name": "description", + "enable": [], + "requirements": [ + [ + "ride_horse" + ] + ], + "pages": [ + [ + { + "insert": "title" + }, + { + "translate": "text.gm4.guidebook.horsemanship.description", + "fallback": "Horses can level up, indicated by their amount of hearts. Horses start at 5 hearts and will gain 1 for every level, up to a total of 20.\n\nWearing Frost Walker will also apply to any Horse you ride." + } + ], + [ + { + "translate": "text.gm4.guidebook.horsemanship.description_2", + "fallback": "A pegasuit allows your Horse to fly by looking up or down while riding." + }, + "\n", + { + "insert": "recipe", + "recipe": "gm4_horsemanship:horse_wings" + } + ] + ] + } + ] +} diff --git a/gm4_horsemanship/data/gm4_horsemanship/loot_table/technical/horse_wing_fake.json b/gm4_horsemanship/data/gm4_horsemanship/loot_table/technical/horse_wing_fake.json new file mode 100644 index 0000000000..7469a98698 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/loot_table/technical/horse_wing_fake.json @@ -0,0 +1,26 @@ +{ + "type": "minecraft:chest", + "pools": [ + { + "bonus_rolls": 0, + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:elytra", + "functions": [ + { + "function": "minecraft:set_name", + "entity": "this", + "name": { + "translate": "gm4.horsemanship.item.horse_wings", + "fallback": "Pegasuit", + "italic": false + } + } + ] + } + ], + "rolls": 1 + } + ] +} diff --git a/gm4_horsemanship/data/gm4_horsemanship/predicate/check_horse_looking_at.json b/gm4_horsemanship/data/gm4_horsemanship/predicate/check_horse_looking_at.json new file mode 100644 index 0000000000..69c8d45967 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/predicate/check_horse_looking_at.json @@ -0,0 +1,13 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type_specific": { + "type": "player", + "looking_at": { + "type": "#gm4_horsemanship:trainable", + "nbt": "{Tags:[\"gm4_horse_check\"]}" + } + } + } +} diff --git a/gm4_horsemanship/data/gm4_horsemanship/predicate/holding_food.json b/gm4_horsemanship/data/gm4_horsemanship/predicate/holding_food.json new file mode 100644 index 0000000000..dfbd928109 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/predicate/holding_food.json @@ -0,0 +1,11 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "equipment": { + "mainhand": { + "items": "#gm4_horsemanship:added_food" + } + } + } +} diff --git a/gm4_horsemanship/data/gm4_horsemanship/predicate/jumping.json b/gm4_horsemanship/data/gm4_horsemanship/predicate/jumping.json new file mode 100644 index 0000000000..2401f5ca1d --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/predicate/jumping.json @@ -0,0 +1,12 @@ +{ + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type_specific": { + "type": "minecraft:player", + "input": { + "jump": true + } + } + } +} diff --git a/gm4_horsemanship/data/gm4_horsemanship/predicate/riding.json b/gm4_horsemanship/data/gm4_horsemanship/predicate/riding.json new file mode 100644 index 0000000000..564aa541b4 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/predicate/riding.json @@ -0,0 +1,53 @@ +{ + "condition": "minecraft:any_of", + "terms": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type_specific": { + "type": "minecraft:player", + "input": { + "forward": true + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type_specific": { + "type": "minecraft:player", + "input": { + "backward": true + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type_specific": { + "type": "minecraft:player", + "input": { + "left": true + } + } + } + }, + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type_specific": { + "type": "minecraft:player", + "input": { + "right": true + } + } + } + } + ] +} diff --git a/gm4_horsemanship/data/gm4_horsemanship/recipe/horse_wings.json b/gm4_horsemanship/data/gm4_horsemanship/recipe/horse_wings.json new file mode 100644 index 0000000000..fb640eb0a5 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/recipe/horse_wings.json @@ -0,0 +1,76 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "equipment", + "ingredients": [ + "elytra", + "#gm4_horsemanship:horse_armor" + ], + "result": { + "components": { + "!food": {}, + "!consumable": {}, + "minecraft:attribute_modifiers": [ + { + "type": "minecraft:gravity", + "amount": 0, + "id": "gm4_horsemanship:horse_wings", + "operation": "add_multiplied_total", + "slot": "body" + }, + { + "type": "minecraft:fall_damage_multiplier", + "amount": -1, + "id": "gm4_horsemanship:horse_wings", + "operation": "add_multiplied_total", + "slot": "body" + }, + { + "type": "minecraft:jump_strength", + "amount": 0, + "id": "gm4_horsemanship:horse_wings", + "operation": "add_multiplied_total", + "slot": "body" + }, + { + "type": "minecraft:movement_speed", + "amount": 0, + "id": "gm4_horsemanship:horse_wings", + "operation": "add_multiplied_total", + "slot": "body" + } + ], + "minecraft:equippable": { + "allowed_entities": "#minecraft:can_wear_horse_armor", + "asset_id": "gm4_horsemanship:wings", + "can_be_sheared": true, + "damage_on_hurt": false, + "equip_sound": "minecraft:entity.horse.armor", + "shearing_sound": "minecraft:item.horse_armor.unequip", + "slot": "body" + }, + "minecraft:custom_model_data": "item/horse_wings", + "custom_data": { + "gm4_horsemanship": { + "glider": { + "grounded": 1 + } + } + }, + "minecraft:lore": [], + "minecraft:max_stack_size": 1, + "minecraft:rarity": "epic", + "minecraft:tooltip_display": { + "hidden_components": [ + "attribute_modifiers" + ] + }, + "minecraft:item_name": { + "translate": "gm4.horsemanship.item.horse_wings", + "fallback": "Pegasuit" + }, + "minecraft:item_model": "minecraft:elytra" + }, + "count": 1, + "id": "minecraft:poisonous_potato" + } +} diff --git a/gm4_horsemanship/data/gm4_horsemanship/tags/block/can_eat_through.json b/gm4_horsemanship/data/gm4_horsemanship/tags/block/can_eat_through.json new file mode 100644 index 0000000000..c55d1d1db2 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/tags/block/can_eat_through.json @@ -0,0 +1,6 @@ +{ + "values": [ + "#gm4:no_collision", + "snow" + ] +} diff --git a/gm4_horsemanship/data/gm4_horsemanship/tags/entity_type/trainable.json b/gm4_horsemanship/data/gm4_horsemanship/tags/entity_type/trainable.json new file mode 100644 index 0000000000..626ac89312 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/tags/entity_type/trainable.json @@ -0,0 +1,7 @@ +{ + "values": [ + "minecraft:donkey", + "minecraft:horse", + "minecraft:mule" + ] +} diff --git a/gm4_horsemanship/data/gm4_horsemanship/tags/item/added_food.json b/gm4_horsemanship/data/gm4_horsemanship/tags/item/added_food.json new file mode 100644 index 0000000000..302b5633f5 --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/tags/item/added_food.json @@ -0,0 +1,13 @@ +{ + "values": [ + "minecraft:short_grass", + "minecraft:sweet_berries", + "minecraft:glow_berries", + "minecraft:chorus_fruit", + "minecraft:dried_kelp", + "minecraft:melon_slice", + "minecraft:beetroot", + "minecraft:bread", + "minecraft:baked_potato" + ] +} diff --git a/gm4_horsemanship/data/gm4_horsemanship/tags/item/horse_armor.json b/gm4_horsemanship/data/gm4_horsemanship/tags/item/horse_armor.json new file mode 100644 index 0000000000..a800b27dfc --- /dev/null +++ b/gm4_horsemanship/data/gm4_horsemanship/tags/item/horse_armor.json @@ -0,0 +1,10 @@ +{ + "values": [ + "minecraft:leather_horse_armor", + {"id":"minecraft:copper_horse_armor","required":false}, + "minecraft:iron_horse_armor", + "minecraft:golden_horse_armor", + "minecraft:diamond_horse_armor", + {"id":"minecraft:netherite_horse_armor","required":false} + ] +} diff --git a/gm4_horsemanship/images/horsemanship.png b/gm4_horsemanship/images/horsemanship.png new file mode 100644 index 0000000000..0a7496b59f Binary files /dev/null and b/gm4_horsemanship/images/horsemanship.png differ