From 83e90d86c6916511c0b68ceb210273022deed4d8 Mon Sep 17 00:00:00 2001 From: Tschipcraft <78470530+Tschipcraft@users.noreply.github.com> Date: Fri, 22 Nov 2024 20:19:13 +0100 Subject: [PATCH] Support for 1.21.4 - Added support for Minecraft 1.21.4 - Re-enabled upside down spiders for 1.21.4+ as MC-128225 was fixed --- .spyglassrc.json | 5 +++++ CHANGES.md | 3 ++- data/more_mobs/function/install.mcfunction | 7 +++---- data/more_mobs/function/main.mcfunction | 6 +++--- data/more_mobs/function/settings/core.mcfunction | 10 +++++----- data/more_mobs/function/spider/inair.mcfunction | 5 +++-- data/more_mobs/function/version_checker.mcfunction | 2 +- data/more_mobs/functions/main.mcfunction | 7 ++++--- data/more_mobs/functions/settings/core.mcfunction | 2 +- data/more_mobs/functions/spider/inair.mcfunction | 1 - pack.mcmeta | 2 +- 11 files changed, 28 insertions(+), 22 deletions(-) create mode 100644 .spyglassrc.json diff --git a/.spyglassrc.json b/.spyglassrc.json new file mode 100644 index 0000000..274d9d5 --- /dev/null +++ b/.spyglassrc.json @@ -0,0 +1,5 @@ +{ + "env": { + "gameVersion": "1.21.4" + } +} diff --git a/CHANGES.md b/CHANGES.md index e63e8e9..a18f399 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1 +1,2 @@ -- **Added support for Minecraft 1.21.3** 💰 +- **Added support for Minecraft 1.21.4** 🪵 +- Re-enabled upside down spiders for 1.21.4+ as [MC-128225](https://bugs.mojang.com/browse/MC-128225) was fixed diff --git a/data/more_mobs/function/install.mcfunction b/data/more_mobs/function/install.mcfunction index af9e438..809ea8d 100644 --- a/data/more_mobs/function/install.mcfunction +++ b/data/more_mobs/function/install.mcfunction @@ -31,10 +31,9 @@ function more_mobs:settings/defaults advancement revoke @a only tschipcraft:menu # Team -# Spiders hanging from ceilings is broken since Snapshot 23w40a, no need to initialize the team -#team add ts.mm.nonametag -#team modify ts.mm.nonametag nametagVisibility never -#team join ts.mm.nonametag @e[type=#more_mobs:spider,tag=ts.mm.s_onceiling] +team add ts.mm.nonametag +team modify ts.mm.nonametag nametagVisibility never +team join ts.mm.nonametag @e[type=#more_mobs:spider,tag=ts.mm.s_onceiling] # Schedule schedule function more_mobs:general/effect_loop_trigger 1s diff --git a/data/more_mobs/function/main.mcfunction b/data/more_mobs/function/main.mcfunction index ffe85a2..8831a1f 100644 --- a/data/more_mobs/function/main.mcfunction +++ b/data/more_mobs/function/main.mcfunction @@ -1,9 +1,9 @@ ## by Tschipcraft -## Mobs +## Variated Mobs execute if score $global ts.mm.version matches 1933.. as @e[type=#more_mobs:parsable,tag=!ts.mm.parsed,tag=!ts.mm.exclude,tag=!smithed.entity,tag=!smithed.block,tag=!global.ignore,tag=!global.ignore.kill] at @s run function more_mobs:general/parse ## Upside Down Spiders -# Spiders hanging from ceilings is broken since Snapshot 23w40a, no need to check -#execute if score $global ts.mm.version matches 1933..3678 if score $upsided_s ts.mm.settings matches 1..2 as @e[type=#more_mobs:spider,tag=!ts.mm.exclude,tag=!smithed.entity,tag=!smithed.block,tag=!global.ignore,tag=!global.ignore.kill] at @s run function more_mobs:spider/main +# Disabled until 1.21.4-pre1, since it is impossible to delete an entities CustomName in these versions, see https://bugs.mojang.com/browse/MC-128225 +execute if score $global ts.mm.version matches 4179.. if score $upsided_s ts.mm.settings matches 1..2 as @e[type=#more_mobs:spider,tag=!ts.mm.exclude,tag=!smithed.entity,tag=!smithed.block,tag=!global.ignore,tag=!global.ignore.kill] at @s run function more_mobs:spider/main diff --git a/data/more_mobs/function/settings/core.mcfunction b/data/more_mobs/function/settings/core.mcfunction index 68985d6..3a38341 100644 --- a/data/more_mobs/function/settings/core.mcfunction +++ b/data/more_mobs/function/settings/core.mcfunction @@ -23,11 +23,11 @@ execute if score $val_loot ts.mm.settings matches 0 run tellraw @s ["",{"text": execute if score $val_loot ts.mm.settings matches -1 run tellraw @s [{"text":" └Add additional valuable loot [off]","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] execute if score $val_loot ts.mm.settings matches 2 run tellraw @s [{"text":" └Add additional valuable loot [on]","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] -execute unless score $global ts.mm.version matches 3679.. if score $upsided_s ts.mm.settings matches 1 run tellraw @s ["",{"text":"Upside Down Spiders","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, spiders will turn upside down when hanging on ceilings."}]}},{"text":" \u0020 "},{"text":"[on]","bold":true,"color":"green","clickEvent":{"action":"run_command","value":"/function more_mobs:settings/enable_spiders"}},{"text":" \u0020| \u0020"},{"text":"[off]","color":"dark_red","clickEvent":{"action":"run_command","value":"/function more_mobs:settings/disable_spiders"}}] -execute unless score $global ts.mm.version matches 3679.. if score $upsided_s ts.mm.settings matches 0 run tellraw @s ["",{"text":"Upside Down Spiders","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, spiders will turn upside down when hanging on ceilings."}]}},{"text":" \u0020 "},{"text":"[on]","color":"dark_green","clickEvent":{"action":"run_command","value":"/function more_mobs:settings/enable_spiders"}},{"text":" \u0020| \u0020"},{"text":"[off]","bold":true,"color":"red","clickEvent":{"action":"run_command","value":"/function more_mobs:settings/disable_spiders"}}] -execute unless score $global ts.mm.version matches 3679.. if score $upsided_s ts.mm.settings matches -1 run tellraw @s [{"text":"Upside Down Spiders [off]","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] -execute unless score $global ts.mm.version matches 3679.. if score $upsided_s ts.mm.settings matches 2 run tellraw @s [{"text":"Upside Down Spiders [on]","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] -execute if score $global ts.mm.version matches 3679.. run tellraw @s {"text":"Upside Down Spiders [on] | [off]","color":"gray","bold":false,"hoverEvent":{"action":"show_text","value":[{"text":"This feature is not available in this version due to MC-128225 not having a workaround anymore."}]},"clickEvent":{"action":"open_url","value":"https://bugs.mojang.com/browse/MC-128225"}} +execute if score $global ts.mm.version matches 4179.. if score $upsided_s ts.mm.settings matches 1 run tellraw @s ["",{"text":"Upside Down Spiders","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, spiders will turn upside down when hanging on ceilings."}]}},{"text":" \u0020 "},{"text":"[on]","bold":true,"color":"green","clickEvent":{"action":"run_command","value":"/function more_mobs:settings/enable_spiders"}},{"text":" \u0020| \u0020"},{"text":"[off]","color":"dark_red","clickEvent":{"action":"run_command","value":"/function more_mobs:settings/disable_spiders"}}] +execute if score $global ts.mm.version matches 4179.. if score $upsided_s ts.mm.settings matches 0 run tellraw @s ["",{"text":"Upside Down Spiders","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, spiders will turn upside down when hanging on ceilings."}]}},{"text":" \u0020 "},{"text":"[on]","color":"dark_green","clickEvent":{"action":"run_command","value":"/function more_mobs:settings/enable_spiders"}},{"text":" \u0020| \u0020"},{"text":"[off]","bold":true,"color":"red","clickEvent":{"action":"run_command","value":"/function more_mobs:settings/disable_spiders"}}] +execute if score $global ts.mm.version matches 4179.. if score $upsided_s ts.mm.settings matches -1 run tellraw @s [{"text":"Upside Down Spiders [off]","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $global ts.mm.version matches 4179.. if score $upsided_s ts.mm.settings matches 2 run tellraw @s [{"text":"Upside Down Spiders [on]","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute unless score $global ts.mm.version matches 4179.. run tellraw @s {"text":"Upside Down Spiders [on] | [off]","color":"gray","bold":false,"hoverEvent":{"action":"show_text","value":[{"text":"This feature is not available in this Minecraft version due to MC-128225."}]},"clickEvent":{"action":"open_url","value":"https://bugs.mojang.com/browse/MC-128225"}} execute if score $global ts.mm.version matches 3330.. if score $mobs_burn ts.mm.settings matches 1 run tellraw @s ["",{"text":"Let mobs with custom heads burn in daylight","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, undead mobs with custom heads will burn in the daylight."}]}},{"text":" \u0020 "},{"text":"[on]","bold":true,"color":"green","clickEvent":{"action":"run_command","value":"/function more_mobs:settings/enable_burning"}},{"text":" \u0020| \u0020"},{"text":"[off]","color":"dark_red","clickEvent":{"action":"run_command","value":"/function more_mobs:settings/disable_burning"}}] execute if score $global ts.mm.version matches 3330.. if score $mobs_burn ts.mm.settings matches 0 run tellraw @s ["",{"text":"Let mobs with custom heads burn in daylight","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, undead mobs with custom heads will burn in the daylight."}]}},{"text":" \u0020 "},{"text":"[on]","color":"dark_green","clickEvent":{"action":"run_command","value":"/function more_mobs:settings/enable_burning"}},{"text":" \u0020| \u0020"},{"text":"[off]","bold":true,"color":"red","clickEvent":{"action":"run_command","value":"/function more_mobs:settings/disable_burning"}}] diff --git a/data/more_mobs/function/spider/inair.mcfunction b/data/more_mobs/function/spider/inair.mcfunction index d3c3ed9..9b2cad8 100644 --- a/data/more_mobs/function/spider/inair.mcfunction +++ b/data/more_mobs/function/spider/inair.mcfunction @@ -1,6 +1,7 @@ ## by Tschipcraft tag @s remove ts.mm.s_onceiling -# TODO: Replace with data remove in future versions when https://bugs.mojang.com/browse/MC-128225 is fixed -execute if score $global ts.mm.version matches ..3678 run data merge entity @s {CustomNameVisible:0b,CustomName:""} +# https://bugs.mojang.com/browse/MC-128225 got fixed in 1.21.4-pre1 +execute if score $global ts.mm.version matches 4179.. run data remove entity @s CustomName +execute if score $global ts.mm.version matches 4179.. run data remove entity @s CustomNameVisible team leave @s diff --git a/data/more_mobs/function/version_checker.mcfunction b/data/more_mobs/function/version_checker.mcfunction index 6283b47..16dfa07 100644 --- a/data/more_mobs/function/version_checker.mcfunction +++ b/data/more_mobs/function/version_checker.mcfunction @@ -2,7 +2,7 @@ scoreboard objectives add ts.mm.version dummy execute store result score $global ts.mm.version run data get entity @r DataVersion -execute unless score $global tvc_ignore matches 1 if score $global ts.mm.version matches 4100.. run tellraw @a [{"text":"[More Mobs] ","color":"gray"},{"text":"?","bold":true,"color":"gold"},{"text":" Future unknown Minecraft version above 1.21.3 detected! This data pack/mod may not work correctly anymore! Please make sure to check for updates in the menu! (","color":"gold"},{"text":"/trigger tschipcraft.menu","underlined":true,"color":"gold","clickEvent":{"action":"run_command","value":"/trigger tschipcraft.menu"},"hoverEvent":{"action":"show_text","contents":"Click here"}},{"text":")","color":"gold"}] +execute unless score $global tvc_ignore matches 1 if score $global ts.mm.version matches 4200.. run tellraw @a [{"text":"[More Mobs] ","color":"gray"},{"text":"?","bold":true,"color":"gold"},{"text":" Future unknown Minecraft version above 1.21.4 detected! This data pack/mod may not work correctly anymore! Please make sure to check for updates in the menu! (","color":"gold"},{"text":"/trigger tschipcraft.menu","underlined":true,"color":"gold","clickEvent":{"action":"run_command","value":"/trigger tschipcraft.menu"},"hoverEvent":{"action":"show_text","contents":"Click here"}},{"text":")","color":"gold"}] # Note: 1.14x-1.20x uses the old folder names (function -> functions) execute unless score $global ts.mm.version matches 1.. run function more_mobs:version_checker/try_again diff --git a/data/more_mobs/functions/main.mcfunction b/data/more_mobs/functions/main.mcfunction index 39b7154..d1d0a8e 100644 --- a/data/more_mobs/functions/main.mcfunction +++ b/data/more_mobs/functions/main.mcfunction @@ -1,6 +1,6 @@ ## by Tschipcraft -## Mobs +## Variated Mobs execute if score $global ts.mm.version matches 1933.. as @e[type=#more_mobs:parsable,tag=!ts.mm.parsed,tag=!ts.mm.exclude,tag=!smithed.entity,tag=!smithed.block,tag=!global.ignore,tag=!global.ignore.kill] at @s run function more_mobs:general/parse ## Extension for 1.16 and above @@ -8,11 +8,12 @@ execute if score $global ts.mm.version matches 1933.. run function more_mobs:gen ## Upside Down Spiders -# Spider +# Disabled for 23w40a (1.20.3) until 1.21.4-pre1, since it is impossible to delete/reset an entities CustomName in these versions, see https://bugs.mojang.com/browse/MC-267259 execute if score $global ts.mm.version matches 1933..3678 if score $upsided_s ts.mm.settings matches 1..2 as @e[type=#more_mobs:spider,tag=!ts.mm.exclude,tag=!smithed.entity,tag=!smithed.block,tag=!global.ignore,tag=!global.ignore.kill] at @s run function more_mobs:spider/main -## Parse items (until 24w09a since custom names are stored in block entities now) +## Parse items +# Only necessary until 24w09a since custom names are stored in block entities now execute if score $global ts.mm.version matches ..3818 as @e[type=minecraft:item,tag=!ts.mm.parsed_item,tag=!smithed.entity,tag=!smithed.block,tag=!global.ignore] run function more_mobs:general/parse_head_items/check diff --git a/data/more_mobs/functions/settings/core.mcfunction b/data/more_mobs/functions/settings/core.mcfunction index 68985d6..949c1ee 100644 --- a/data/more_mobs/functions/settings/core.mcfunction +++ b/data/more_mobs/functions/settings/core.mcfunction @@ -27,7 +27,7 @@ execute unless score $global ts.mm.version matches 3679.. if score $upsided_s ts execute unless score $global ts.mm.version matches 3679.. if score $upsided_s ts.mm.settings matches 0 run tellraw @s ["",{"text":"Upside Down Spiders","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, spiders will turn upside down when hanging on ceilings."}]}},{"text":" \u0020 "},{"text":"[on]","color":"dark_green","clickEvent":{"action":"run_command","value":"/function more_mobs:settings/enable_spiders"}},{"text":" \u0020| \u0020"},{"text":"[off]","bold":true,"color":"red","clickEvent":{"action":"run_command","value":"/function more_mobs:settings/disable_spiders"}}] execute unless score $global ts.mm.version matches 3679.. if score $upsided_s ts.mm.settings matches -1 run tellraw @s [{"text":"Upside Down Spiders [off]","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] execute unless score $global ts.mm.version matches 3679.. if score $upsided_s ts.mm.settings matches 2 run tellraw @s [{"text":"Upside Down Spiders [on]","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] -execute if score $global ts.mm.version matches 3679.. run tellraw @s {"text":"Upside Down Spiders [on] | [off]","color":"gray","bold":false,"hoverEvent":{"action":"show_text","value":[{"text":"This feature is not available in this version due to MC-128225 not having a workaround anymore."}]},"clickEvent":{"action":"open_url","value":"https://bugs.mojang.com/browse/MC-128225"}} +execute if score $global ts.mm.version matches 3679.. run tellraw @s {"text":"Upside Down Spiders [on] | [off]","color":"gray","bold":false,"hoverEvent":{"action":"show_text","value":[{"text":"This feature is not available in this Minecraft version due to MC-128225 not having a workaround anymore."}]},"clickEvent":{"action":"open_url","value":"https://bugs.mojang.com/browse/MC-128225"}} execute if score $global ts.mm.version matches 3330.. if score $mobs_burn ts.mm.settings matches 1 run tellraw @s ["",{"text":"Let mobs with custom heads burn in daylight","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, undead mobs with custom heads will burn in the daylight."}]}},{"text":" \u0020 "},{"text":"[on]","bold":true,"color":"green","clickEvent":{"action":"run_command","value":"/function more_mobs:settings/enable_burning"}},{"text":" \u0020| \u0020"},{"text":"[off]","color":"dark_red","clickEvent":{"action":"run_command","value":"/function more_mobs:settings/disable_burning"}}] execute if score $global ts.mm.version matches 3330.. if score $mobs_burn ts.mm.settings matches 0 run tellraw @s ["",{"text":"Let mobs with custom heads burn in daylight","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, undead mobs with custom heads will burn in the daylight."}]}},{"text":" \u0020 "},{"text":"[on]","color":"dark_green","clickEvent":{"action":"run_command","value":"/function more_mobs:settings/enable_burning"}},{"text":" \u0020| \u0020"},{"text":"[off]","bold":true,"color":"red","clickEvent":{"action":"run_command","value":"/function more_mobs:settings/disable_burning"}}] diff --git a/data/more_mobs/functions/spider/inair.mcfunction b/data/more_mobs/functions/spider/inair.mcfunction index d3c3ed9..65a78dc 100644 --- a/data/more_mobs/functions/spider/inair.mcfunction +++ b/data/more_mobs/functions/spider/inair.mcfunction @@ -1,6 +1,5 @@ ## by Tschipcraft tag @s remove ts.mm.s_onceiling -# TODO: Replace with data remove in future versions when https://bugs.mojang.com/browse/MC-128225 is fixed execute if score $global ts.mm.version matches ..3678 run data merge entity @s {CustomNameVisible:0b,CustomName:""} team leave @s diff --git a/pack.mcmeta b/pack.mcmeta index bff1ce7..78a56e4 100644 --- a/pack.mcmeta +++ b/pack.mcmeta @@ -2,7 +2,7 @@ "id": "moremobs", "pack": { "pack_format": 15, - "supported_formats": [4,57], + "supported_formats": [4,60], "description": "Tschipcraft's More Mobs \n└ v${version} ● mc${mc_version}" }, "overlays": {