Skip to content

Commit

Permalink
Everstone 1.21 (#1031)
Browse files Browse the repository at this point in the history
* Add Armadillo Support to Everstone

* Make converted mobs ride the vehicle

Converted mobs will now automatically mount the vehicle the original mob was riding

* fix typo in comment

* Simplify direct-sky predicates

* Use Biome Tags

- use tags to determine dry and frozen biomes
- introduce `c` tags for compatibility with other mods and datapacks

* Add Skeleton and Bogged Conversions

Skeleton to Bogged:
- Aging: in swamp and in water
- Deaging: not in swamp
- Average time: 1 hour

Bogged to Skeleton:
- Aging: sheared and not in swamp
- Deaging: in swamp
- Average time: 1 hour

* make passengers dismount

* move block checks higher

fixes some mobs not aging in minecarts
  • Loading branch information
BPR02 authored Oct 7, 2024
1 parent 1bba3f3 commit 182356c
Show file tree
Hide file tree
Showing 28 changed files with 225 additions and 13,826 deletions.
23 changes: 23 additions & 0 deletions gm4_everstone/data/c/tags/worldgen/biome/is_cold/overworld.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"values": [
"minecraft:taiga",
"minecraft:old_growth_pine_taiga",
"minecraft:snowy_plains",
"minecraft:ice_spikes",
"minecraft:grove",
"minecraft:snowy_slopes",
"minecraft:jagged_peaks",
"minecraft:frozen_peaks",
"minecraft:snowy_beach",
"minecraft:snowy_taiga",
"minecraft:frozen_river",
"minecraft:cold_ocean",
"minecraft:frozen_ocean",
"minecraft:deep_cold_ocean",
"minecraft:deep_frozen_ocean",
{
"id": "#c:climate_cold",
"required": false
}
]
}
15 changes: 15 additions & 0 deletions gm4_everstone/data/c/tags/worldgen/biome/is_dry/overworld.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"values": [
"minecraft:desert",
"minecraft:badlands",
"minecraft:wooded_badlands",
"minecraft:eroded_badlands",
"minecraft:savanna",
"minecraft:savanna_plateau",
"minecraft:windswept_savanna",
{
"id": "#c:climate_dry",
"required": false
}
]
}
6 changes: 6 additions & 0 deletions gm4_everstone/data/c/tags/worldgen/biome/is_swamp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"minecraft:mangrove_swamp",
"minecraft:swamp"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# converts skeleton into bogged
# @s = skeleton that reached the max age
# located at @s
# run from aging/update_age/skeleton

# summon new mob
summon minecraft:bogged ~ ~ ~ {Tags:[gm4_es_new_mob]}

# move mob to exact location of old mob
tp @e[type=bogged,tag=gm4_es_new_mob,limit=1,distance=..0.01] @s
tag @s add gm4_es_old_mob
execute on vehicle run ride @e[type=bogged,tag=gm4_es_new_mob,limit=1,distance=..0.01] mount @s
execute on vehicle run ride @e[type=skeleton,tag=gm4_es_old_mob,limit=1,distance=..0.01] dismount
execute on passengers run ride @s dismount

# transfer old nbt to new mob
effect give @s nausea 1 2
data merge entity @s {Tags:[]}
data modify entity @e[type=bogged,tag=gm4_es_new_mob,limit=1] {} merge from entity @s

# sound effects
playsound minecraft:entity.bogged.ambient hostile @a[distance=..16] ~ ~ ~ 0.5
playsound block.redstone_torch.burnout hostile @a[distance=..16] ~ ~ ~ 0.5 .1

# clean up
data merge entity @s {DeathTime:19s,Health:0,DeathLootTable:"minecraft:empty",HandDropChances:[-327.67F,-327.67F],ArmorDropChances:[-327.67F,-327.67F,-327.67F,-327.67F]}
tp @s ~ ~-5000 ~
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
# summon new mob
summon minecraft:elder_guardian ~ ~ ~ {Tags:[gm4_es_new_mob]}

# move mob to exact location of old mob
tp @e[type=elder_guardian,tag=gm4_es_new_mob,limit=1,distance=..0.01] @s
tag @s add gm4_es_old_mob
execute on vehicle run ride @e[type=elder_guardian,tag=gm4_es_new_mob,limit=1,distance=..0.01] mount @s
execute on vehicle run ride @e[type=guardian,tag=gm4_es_old_mob,limit=1,distance=..0.01] dismount
execute on passengers run ride @s dismount

# transfer old nbt to new mob
effect give @s nausea 1 2
data merge entity @s {Tags:[]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
# summon new mob
summon minecraft:evoker ~ ~ ~ {Tags:[gm4_es_new_mob]}

# move mob to exact location of old mob
tp @e[type=evoker,tag=gm4_es_new_mob,limit=1,distance=..0.01] @s
tag @s add gm4_es_old_mob
execute on vehicle run ride @e[type=evoker,tag=gm4_es_new_mob,limit=1,distance=..0.01] mount @s
execute on vehicle run ride @e[type=vindicator,tag=gm4_es_old_mob,limit=1,distance=..0.01] dismount
execute on passengers run ride @s dismount

# transfer old nbt to new mob
effect give @s nausea 1 2
data merge entity @s {Tags:[]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
# summon new mob
summon minecraft:husk ~ ~ ~ {Tags:[gm4_es_new_mob]}

# move mob to exact location of old mob
tp @e[type=husk,tag=gm4_es_new_mob,limit=1,distance=..0.01] @s
tag @s add gm4_es_old_mob
execute on vehicle run ride @e[type=husk,tag=gm4_es_new_mob,limit=1,distance=..0.01] mount @s
execute on vehicle run ride @e[type=zombie,tag=gm4_es_old_mob,limit=1,distance=..0.01] dismount
execute on passengers run ride @s dismount

# transfer old nbt to new mob
effect give @s nausea 1 2
data merge entity @s {Tags:[]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
# summon new mob
summon minecraft:magma_cube ~ ~ ~ {Tags:[gm4_es_new_mob]}

# move mob to exact location of old mob
tp @e[type=magma_cube,tag=gm4_es_new_mob,limit=1,distance=..0.01] @s
tag @s add gm4_es_old_mob
execute on vehicle run ride @e[type=magma_cube,tag=gm4_es_new_mob,limit=1,distance=..0.01] mount @s
execute on vehicle run ride @e[type=slime,tag=gm4_es_old_mob,limit=1,distance=..0.01] dismount
execute on passengers run ride @s dismount

# transfer old nbt to new mob
effect give @s nausea 1 2
data merge entity @s {Tags:[]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
# summon new mob
summon minecraft:piglin_brute ~ ~ ~ {Tags:[gm4_es_new_mob]}

# move mob to exact location of old mob
tp @e[type=piglin_brute,tag=gm4_es_new_mob,limit=1,distance=..0.01] @s
tag @s add gm4_es_old_mob
execute on vehicle run ride @e[type=piglin_brute,tag=gm4_es_new_mob,limit=1,distance=..0.01] mount @s
execute on vehicle run ride @e[type=piglin,tag=gm4_es_old_mob,limit=1,distance=..0.01] dismount
execute on passengers run ride @s dismount

# transfer old nbt to new mob
effect give @s nausea 1 2
data merge entity @s {Tags:[]}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# converts stray into skeleton
# converts stray or bogged into skeleton
# @s = stray that reached the max age
# located at @s
# run from aging/update_age/stray

# summon new mob
summon minecraft:skeleton ~ ~ ~ {Tags:[gm4_es_new_mob]}

# move mob to exact location of old mob
tp @e[type=skeleton,tag=gm4_es_new_mob,limit=1,distance=..0.01] @s
tag @s add gm4_es_old_mob
execute on vehicle run ride @e[type=skeleton,tag=gm4_es_new_mob,limit=1,distance=..0.01] mount @s
execute on vehicle run ride @e[tag=gm4_es_old_mob,limit=1,distance=..0.01] dismount
execute on passengers run ride @s dismount

# transfer old nbt to new mob
effect give @s nausea 1 2
data merge entity @s {Tags:[]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
# summon new mob
summon minecraft:stray ~ ~ ~ {Tags:[gm4_es_new_mob]}

# move mob to exact location of old mob
tp @e[type=stray,tag=gm4_es_new_mob,limit=1,distance=..0.01] @s
tag @s add gm4_es_old_mob
execute on vehicle run ride @e[type=stray,tag=gm4_es_new_mob,limit=1,distance=..0.01] mount @s
execute on vehicle run ride @e[type=skeleton,tag=gm4_es_old_mob,limit=1,distance=..0.01] dismount
execute on passengers run ride @s dismount

# transfer old nbt to new mob
effect give @s nausea 1 2
data merge entity @s {Tags:[]}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# checks aging conditions of the mob
# @s = aging bogged
# located at @s
# run from aging/update_age/check_mob

# add age if sheared and not in swamp biome
scoreboard players add @s[predicate=gm4_everstone:sheared_and_out_of_swamp] gm4_es_age 1

# deplete age if in swamp biome
scoreboard players remove @s[predicate=gm4_everstone:in_swamp,scores={gm4_es_age=1..}] gm4_es_age 1

# will take on average 1 hour to convert
execute if score @s gm4_es_age matches 12.. run function gm4_everstone:aging/convert/skeleton
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tag @e remove gm4_es_new_mob

function #gm4_everstone:update_age

execute if entity @s[type=bogged] run function gm4_everstone:aging/update_age/bogged
execute if entity @s[type=guardian] run function gm4_everstone:aging/update_age/guardian
execute if entity @s[type=piglin] run function gm4_everstone:aging/update_age/piglin
execute if entity @s[type=skeleton] run function gm4_everstone:aging/update_age/skeleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,18 @@
# located at @s
# run from aging/update_age/check_mob

# add age if in frozen biome with direct sky access
# stray conversion
## add age if in frozen biome with direct sky access
scoreboard players add @s[predicate=gm4_everstone:in_frozen_sunlight] gm4_es_age 1

# deplete age if not in frozen biome with direct sky access
## deplete age if not in frozen biome with direct sky access
scoreboard players remove @s[predicate=!gm4_everstone:in_frozen_sunlight,scores={gm4_es_age=1..}] gm4_es_age 1

# will take on average 30 minutes to convert
## will take on average 30 minutes to convert
execute if score @s gm4_es_age matches 6.. run function gm4_everstone:aging/convert/stray

# bogged conversion
## add age if in a swamp biome in water
scoreboard players add @s[predicate=gm4_everstone:in_swampy_water] gm4_es_age_alt 1
## deplete age if not in swamp biome
scoreboard players remove @s[predicate=!gm4_everstone:in_swamp,scores={gm4_es_age_alt=1..}] gm4_es_age_alt 1
## will take on average 1 hour to convert
execute if score @s gm4_es_age_alt matches 12.. run function gm4_everstone:aging/convert/bogged
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# run from aging/update_age/check_mob

# add age if in dry biome with direct sky access
execute unless block ~ ~ ~ water run scoreboard players add @s[predicate=gm4_everstone:in_dry_sunlight] gm4_es_age 1
execute unless block ~ ~0.5 ~ water run scoreboard players add @s[predicate=gm4_everstone:in_dry_sunlight] gm4_es_age 1

# deplete age if not in dry biome with direct sky access
scoreboard players remove @s[predicate=!gm4_everstone:in_dry_sunlight,scores={gm4_es_age=1..}] gm4_es_age 1
Expand Down
1 change: 1 addition & 0 deletions gm4_everstone/data/gm4_everstone/function/init.mcfunction
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
scoreboard objectives add gm4_es_data dummy
scoreboard objectives add gm4_es_age dummy
scoreboard objectives add gm4_es_age_alt dummy
scoreboard objectives add gm4_es_mine minecraft.mined:minecraft.stone
# set chance (out of 100) for a single mob to age every 30s
# 10 = on average, a mob ages every 5 minutes
Expand Down
Loading

0 comments on commit 182356c

Please sign in to comment.