Skip to content
Merged
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
1 change: 0 additions & 1 deletion gm4_balloon_animals/beet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ require:

meta:
gm4:
minecraft: []
versioning:
schedule_loops: [main]
website:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"criteria": {
"interacted": {
"trigger": "minecraft:player_interacted_with_entity",
"conditions": {
"entity": {
"type": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"minecraft:entity_type": "minecraft:wandering_trader",
"minecraft:entity_tags": {
"all_of": [
"gm4_balloon_animal_trader"
],
"none_of": [
"gm4_balloon_animal_offers_initialized",
"smithed.entity"
]
}
}
}
}
}
},
"rewards": {
"function": "gm4_balloon_animals:wandering_trader/interacted"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@ execute as @e[type=trader_llama,tag=!smithed.entity,distance=..6] run function g
tag @s remove gm4_balloon_animal_trader_new

# pick two animals and set up trades
data modify storage gm4_balloon_animals:temp trades set value []
function gm4_balloon_animals:wandering_trader/pick_two_animals

# copy trades list to entity custom data
data modify entity @s data.gm4_balloon_animals.trades set from storage gm4_balloon_animals:temp trades
data remove storage gm4_balloon_animals:temp trades
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# @s = wandering trader
# at @s
# run from wandering_trader/interacted

data modify entity @s Offers.Recipes append from entity @s data.gm4_balloon_animals.trades[]
data remove entity @s data.gm4_balloon_animals.trades

tag @s add gm4_balloon_animal_offers_initialized

particle minecraft:happy_villager ~ ~2 ~ 0.5 0.5 0.5 0 5
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# @s = player that just interacted with a non-processed wandering trader
# run from advancement gm4_balloon_animals:interacted

advancement revoke @s only gm4_balloon_animals:interacted

execute as @e[type=minecraft:wandering_trader,tag=gm4_balloon_animal_trader,tag=!gm4_balloon_animal_offers_initialized,tag=!smithed.entity] if data entity @s Offers.Recipes[0] if data entity @s data.gm4_balloon_animals.trades[0] at @s run function gm4_balloon_animals:wandering_trader/initialize_offers
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ for animal in ctx.meta['animals']:

execute if score $animal_id gm4_balloon_animals_data matches ctx.meta['enumeration'].index(animal['id']) summon animal['id'] run function f"gm4_balloon_animals:wandering_trader/trade/{animal['function']}"

data modify entity @s Offers.Recipes append from storage gm4_balloon_animals:temp trade
data modify storage gm4_balloon_animals:temp trades append from storage gm4_balloon_animals:temp trade
data remove storage gm4_balloon_animals:temp trade
2 changes: 2 additions & 0 deletions gm4_balloon_animals/mod.mcdoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ dispatch minecraft:storage[gm4_balloon_animals:temp] to struct {
dispatch mcdoc:custom_data[gm4_balloon_animals] to struct BalloonAnimalsData {
trade?: byte,
id?: int,
/// Recipe list stored on the wandering trader
trades?: [Recipe],
}
Loading