Skip to content

Horsemanship #1138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions gm4_horsemanship/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Shapeless Portals<!--$headerTitle--><!--$pmc:delete-->

TODO!<!--$pmc:headerSize-->

<img src="images/shapeless_portals.png" alt="There is 1 portal among us" height="350"/> <!--$localAssetToURL--> <!--$modrinth:replaceWithVideo--> <!--$pmc:delete-->

### Features
- Light portals of any shape with Flint and Steel or Fire Charges.
- Portals can use Crying Obsidian.
28 changes: 28 additions & 0 deletions gm4_horsemanship/beet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
id: gm4_horsemanship
name: Horsemanship
version: 1.0.X

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
165 changes: 165 additions & 0 deletions gm4_horsemanship/data/gm4_horsemanship/advancement/feed_horse.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
{
"criteria": {
"apple": {
"trigger": "minecraft:player_interacted_with_entity",
"conditions": {
"player": [],
"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": {
"player": [],
"item": {
"items": [
"minecraft:golden_apple"
]
},
"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": {
"player": [],
"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": {
"player": [],
"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": {
"player": [],
"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": {
"player": [],
"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": {
"player": [],
"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",
"enchanted_golden_apple",
"golden_carrot",
"sugar",
"wheat",
"hay_block"
]
],
"rewards": {
"function": "gm4_horsemanship:need/food/feed_original_food"
}
}
Original file line number Diff line number Diff line change
@@ -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"
}
}
21 changes: 21 additions & 0 deletions gm4_horsemanship/data/gm4_horsemanship/advancement/tame_horse.json
Original file line number Diff line number Diff line change
@@ -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:horse_processing/tame_horse"
}
}
10 changes: 10 additions & 0 deletions gm4_horsemanship/data/gm4_horsemanship/function/dev.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

tellraw @s "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"

tellraw @s "-= HORSE STAT TRACKER =-"
tellraw @s {text:"click here to disable",color:"red","click_event":{action:"run_command",command:"tag @s remove gm4_horse_dev"}}
tellraw @s ""
tellraw @s {text:"Tracked Horse: ",color:"red","click_event":{action:"run_command",command:"tag @s remove gm4_horse_dev"}}


execute as @e[type=#gm4_horsemanship:trainable,limit=1,sort=nearest] run return 0
32 changes: 32 additions & 0 deletions gm4_horsemanship/data/gm4_horsemanship/function/dev/log.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@


tellraw @p "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"

tellraw @p [{text:"| Tracked Horse: "},{selector:"@s"}]
tellraw @p [{text:"Stamina: ","color":"gray"},{"score":{"name":"@s","objective":"gm4_horse_need.stamina"},"color":"white"},{text:"/"},{"score":{"name":"@s","objective":"gm4_horse.stamina_cap"}}]

tellraw @p ""

scoreboard players set $potential_loss.mult gm4_horse_data 1
execute unless score @s gm4_horse_need.brushing matches 50.. run scoreboard players add $potential_loss.mult gm4_horse_data 1
execute if entity @s[tag=gm4_horse.tired] run scoreboard players add $potential_loss.mult gm4_horse_data 1
execute unless score @s gm4_horse_need.graze matches 1.. run scoreboard players add $potential_loss.mult gm4_horse_data 1

scoreboard players operation $xp_conversion gm4_horse_data = @s gm4_horse_potential.realized
scoreboard players operation $xp_conversion gm4_horse_data /= @s gm4_horse_potential.total

tellraw @p [{text:"Level: ","color":"gray"},{"score":{"name":"@s","objective":"gm4_horse_level"},"color":"white"},\
{text:" XP: "},{"score":{"name":"@s","objective":"gm4_horse_experience"},"color":"white"},\
{text:" Potential: "},{"score":{"name":"@s","objective":"gm4_horse_potential.total"},"color":"white"},{text:"/1125 | "},{"score":{"name":"@s","objective":"gm4_horse_potential.realized"},"color":"white"},\
{"text":" (","color":"dark_gray"},{"score":{"name":"@s","objective":"gm4_horse_comfort"},"color":"dark_gray"},{"text":"% | ","color":"dark_gray"},{"score":{"name":"$potential_loss.mult","objective":"gm4_horse_data"},"color":"dark_gray"},{"text":"x | ","color":"dark_gray"},{"score":{"name":"$xp_conversion","objective":"gm4_horse_data"},"color":"dark_gray"},{"text":")","color":"dark_gray"}\
]


tellraw @p ""

tellraw @p [{text:"Graze: ","color":"gray"},{"score":{"name":"@s","objective":"gm4_horse_need.graze"},"color":"white"},\
{text:"/2160 | Brush: "},{"score":{"name":"@s","objective":"gm4_horse_need.brushing"},"color":"white"},\
{text:"/1500 | On Leash: "},{"score":{"name":"@s","objective":"gm4_horse_need.on_leash"},"color":"white"},\
{text:"/1125 | Fed Treat: "},{"score":{"name":"@s","objective":"gm4_horse_need.fed_treat"},"color":"white"},\
{text:"/15"},\
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# cap health just below the real max health
# @s = gm4_horse
# at @s
# run from horse_processing/general


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

tag @s remove gm4_horse.check_health
Loading
Loading