Skip to content
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
187 changes: 187 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,187 @@
{
"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\"]}"
}
}
]
}
},
"carrot": {
"trigger": "minecraft:player_interacted_with_entity",
"conditions": {
"player": [],
"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": {
"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",
"carrot",
"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
34 changes: 34 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,34 @@

execute store result score $age gm4_horse_data run data get entity @s Age
execute if score $age gm4_horse_data matches ..-1 run return run function gm4_horsemanship:dev/log_foal

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
scoreboard players operation $xp_conversion gm4_horse_data > #25 gm4_horse_data

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,20 @@


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 Foal: "},{selector:"@s"}]

tellraw @p ""

tellraw @p [{text:"Foal Potential: ","color":"gray"},{"score":{"name":"@s","objective":"gm4_horse_potential.foal"},"color":"white"},\
{text:"/33750"}]

tellraw @p ""

execute store result score $nearby_horses gm4_horse_data at @s if entity @e[type=#gm4_horsemanship:trainable,distance=0.01..24,limit=10]

tellraw @p [{text:"Grazes left: ","color":"gray"},{"score":{"name":"@s","objective":"gm4_horse_need.graze"},"color":"white"},\
{text:"/1 | Leash Time: "},{"score":{"name":"@s","objective":"gm4_horse_need.on_leash"},"color":"white"},\
{text:"/150 | Nearby Horses: "},{"score":{"name":"$nearby_horses","objective":"gm4_horse_data"},"color":"white"},\
{text:"/10"},\
]
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

# check for growing up
execute store result score $age gm4_horse_data run data get entity @s Age
execute if score $age gm4_horse_data matches 0.. run return run tag @s remove gm4_horse.foal

# | Increase enrichment
# max of 33750

# gain 11250 as base for being grown from a Foal
# from gm4_horsemanship:level/tame_horse

# nearby horses +1, up to +10, total max +7500
execute store result score $nearby_horses gm4_horse_data if entity @e[type=#gm4_horsemanship:trainable,distance=0.01..24,limit=10]
scoreboard players operation @s gm4_horse_potential.foal += $nearby_horses gm4_horse_data

# +50 if on leash, up to +7500
execute store success score $on_leash gm4_horse_data if data entity @s leash.UUID
execute if score $on_leash gm4_horse_data matches 1 run scoreboard players add @s[scores={gm4_horse_need.on_leash=1..}] gm4_horse_potential.foal 50
execute if score $on_leash gm4_horse_data matches 1 run scoreboard players remove @s[scores={gm4_horse_need.on_leash=1..}] gm4_horse_need.on_leash 1

# if a player is nearby +4, total max +3000
execute if entity @p[gamemode=!spectator,distance=..24] run scoreboard players add @s gm4_horse_potential.foal 4

# if allowed to graze +3000 once
# from gm4_horsemanship:need/graze/foal
Loading
Loading