-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update merchant spawning code (Written by @ChickenAndTheSculkMan)
- Loading branch information
1 parent
c27acff
commit cb6ec76
Showing
8 changed files
with
38 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
spreadplayers ~ ~ 48 48 false @s | ||
execute at @s unless entity @a[distance=..10] run function aeternum:merchant/summon | ||
kill @s |
3 changes: 3 additions & 0 deletions
3
data/aeternum/function/merchant/marker/spawn_summon.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
kill @e[type=marker,tag=aeternum.merchant.unispawn] | ||
execute at @r run summon marker ~ ~ ~ {Tags:["aeternum.merchant.unispawn"]} | ||
execute as @e[type=marker,tag=aeternum.merchant.unispawn] at @s run function aeternum:merchant/test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
execute if score .merchant.rarity aeternum.global_config matches 0 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.0} run function aeternum:merchant/quest/summon | ||
execute if score .merchant.rarity aeternum.global_config matches 1 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.1} run function aeternum:merchant/quest/summon | ||
execute if score .merchant.rarity aeternum.global_config matches 2 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.2} run function aeternum:merchant/quest/summon | ||
execute if score .merchant.rarity aeternum.global_config matches 3 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.3} run function aeternum:merchant/quest/summon | ||
execute if score .merchant.rarity aeternum.global_config matches 4 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.4} run function aeternum:merchant/quest/summon | ||
execute if score .merchant.rarity aeternum.global_config matches 5 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.5} run function aeternum:merchant/quest/summon | ||
execute if score .merchant.rarity aeternum.global_config matches 6 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.6} run function aeternum:merchant/quest/summon | ||
execute if score .merchant.rarity aeternum.global_config matches 7 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.7} run function aeternum:merchant/quest/summon | ||
execute if score .merchant.rarity aeternum.global_config matches 8 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.8} run function aeternum:merchant/quest/summon | ||
execute if score .merchant.rarity aeternum.global_config matches 9 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.9} run function aeternum:merchant/quest/summon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
execute if score .merchant.rarity aeternum.global_config matches 0 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.0} run function aeternum:merchant/summon | ||
execute if score .merchant.rarity aeternum.global_config matches 1 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.1} run function aeternum:merchant/summon | ||
execute if score .merchant.rarity aeternum.global_config matches 2 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.2} run function aeternum:merchant/summon | ||
execute if score .merchant.rarity aeternum.global_config matches 3 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.3} run function aeternum:merchant/summon | ||
execute if score .merchant.rarity aeternum.global_config matches 4 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.4} run function aeternum:merchant/summon | ||
execute if score .merchant.rarity aeternum.global_config matches 5 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.5} run function aeternum:merchant/summon | ||
execute if score .merchant.rarity aeternum.global_config matches 6 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.6} run function aeternum:merchant/summon | ||
execute if score .merchant.rarity aeternum.global_config matches 7 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.7} run function aeternum:merchant/summon | ||
execute if score .merchant.rarity aeternum.global_config matches 8 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.8} run function aeternum:merchant/summon | ||
execute if score .merchant.rarity aeternum.global_config matches 9 as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest] at @s if predicate {"condition":"minecraft:random_chance","chance":0.9} run function aeternum:merchant/summon | ||
|
||
tag @s[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned] add aeternum.entity.spawned | ||
execute if score .merchant.rarity aeternum.global_config matches 0 at @s if predicate {"condition":"minecraft:random_chance","chance":0.0} run function aeternum:merchant/marker/decide | ||
execute if score .merchant.rarity aeternum.global_config matches 1 at @s if predicate {"condition":"minecraft:random_chance","chance":0.1} run function aeternum:merchant/marker/decide | ||
execute if score .merchant.rarity aeternum.global_config matches 2 at @s if predicate {"condition":"minecraft:random_chance","chance":0.2} run function aeternum:merchant/marker/decide | ||
execute if score .merchant.rarity aeternum.global_config matches 3 at @s if predicate {"condition":"minecraft:random_chance","chance":0.3} run function aeternum:merchant/marker/decide | ||
execute if score .merchant.rarity aeternum.global_config matches 4 at @s if predicate {"condition":"minecraft:random_chance","chance":0.4} run function aeternum:merchant/marker/decide | ||
execute if score .merchant.rarity aeternum.global_config matches 5 at @s if predicate {"condition":"minecraft:random_chance","chance":0.5} run function aeternum:merchant/marker/decide | ||
execute if score .merchant.rarity aeternum.global_config matches 6 at @s if predicate {"condition":"minecraft:random_chance","chance":0.6} run function aeternum:merchant/marker/decide | ||
execute if score .merchant.rarity aeternum.global_config matches 7 at @s if predicate {"condition":"minecraft:random_chance","chance":0.7} run function aeternum:merchant/marker/decide | ||
execute if score .merchant.rarity aeternum.global_config matches 8 at @s if predicate {"condition":"minecraft:random_chance","chance":0.8} run function aeternum:merchant/marker/decide | ||
execute if score .merchant.rarity aeternum.global_config matches 9 at @s if predicate {"condition":"minecraft:random_chance","chance":0.9} run function aeternum:merchant/marker/decide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
|
||
execute as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest,tag=!aeternum.entity.spawned] run function aeternum:merchant/test | ||
execute as @s[type=minecraft:wandering_trader,tag=!aeternum.entity.trader_dungeon,tag=!aeternum.entity.villager.quest,tag=!aeternum.entity.spawned] run function aeternum:merchant/quest/test | ||
execute as @s[type=minecraft:wandering_trader,tag=aeternum.entity.trader_dungeon] run function aeternum:merchant/display | ||
execute as @s[type=minecraft:wandering_trader,tag=aeternum.entity.villager.quest] run function aeternum:merchant/quest/display | ||
execute as @s[type=minecraft:wandering_trader,tag=aeternum.entity.villager.quest] run function aeternum:merchant/quest/display | ||
tag @e[type=minecraft:wandering_trader,tag=!aeternum.entity.spawned] add aeternum.entity.spawned |