From 20de7bd4d12054fd2c2ad41fb4a1a353a191f663 Mon Sep 17 00:00:00 2001 From: Tschipcraft <78470530+Tschipcraft@users.noreply.github.com> Date: Sun, 20 Jul 2025 22:45:46 +0200 Subject: [PATCH 1/7] Improve activation logic and armor handling - Refactored entity activation distance calculations to bundle and cache position data retrieval calls, and updated batch activation logic for better performance (up to 1ms faster per tick!) - Fixed v0 save format not correctly upgrading to v1 from 24w11a to 24w20a (affecting major releases 1.20.5 and 1.20.6) - Improved armor save/resolve functions to include the vanishing curse enchantment in the root proxy chest item --- CHANGES.md | 4 +++- data/spawnanimations/function/install.mcfunction | 7 +++++++ .../function/internal/calc_activation.mcfunction | 16 ++++++++-------- .../entity/ehs/conflict/resolve.mcfunction | 2 +- .../internal/entity/ehs/save_armor.mcfunction | 2 +- .../entity/get_animation_speed.mcfunction | 2 +- .../internal/run_activation_batch.mcfunction | 12 +++++++----- data/spawnanimations/function/main.mcfunction | 2 +- .../function/uninstall.mcfunction | 3 +++ .../spawnanimations/functions/install.mcfunction | 7 +++++++ .../internal/calc_activation.mcfunction | 16 ++++++++-------- .../internal/entity/ehs/save_armor.mcfunction | 2 +- .../entity/get_animation_speed.mcfunction | 2 +- .../internal/run_activation_batch.mcfunction | 12 +++++++----- data/spawnanimations/functions/main.mcfunction | 2 +- .../functions/uninstall.mcfunction | 3 +++ .../entity/ehs/conflict/resolve.mcfunction | 2 +- .../internal/entity/ehs/save_armor.mcfunction | 2 +- ...ect_old_format.json => detect_v0_format.json} | 0 overlay_35/overrides.impdoc | 4 ++++ .../entity/ehs/conflict/resolve.mcfunction | 2 +- .../internal/entity/ehs/save_armor.mcfunction | 2 +- 22 files changed, 68 insertions(+), 38 deletions(-) rename overlay_35/data/spawnanimations/predicates/validate/{detect_old_format.json => detect_v0_format.json} (100%) create mode 100644 overlay_35/overrides.impdoc diff --git a/CHANGES.md b/CHANGES.md index 1d14339..9ada9f8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1 +1,3 @@ -- **Added support for Minecraft 1.21.7** 💿 +- Improved performance by refactoring entity activation distance calculations to bundle and cache position data retrieval calls, and updating batch activation logic (up to 1 ms faster per tick!) +- Fixed v0 save format not correctly upgrading to v1 from 24w11a to 24w20a (affecting major releases 1.20.5 and 1.20.6) +- Improved armor save/resolve functions to include the vanishing curse enchantment in the root proxy chest item diff --git a/data/spawnanimations/function/install.mcfunction b/data/spawnanimations/function/install.mcfunction index 7b180be..5e16ff4 100644 --- a/data/spawnanimations/function/install.mcfunction +++ b/data/spawnanimations/function/install.mcfunction @@ -5,9 +5,16 @@ scoreboard objectives add ts.sa.timer dummy scoreboard objectives add ts.sa.count dummy scoreboard objectives add ts.sa.welcome trigger +# Activation distance calculation scoreboard objectives add ts.sa.x dummy scoreboard objectives add ts.sa.y dummy scoreboard objectives add ts.sa.z dummy +scoreboard players set #minus ts.sa.x -1 + +# Escape protection for shrunk/emissive entities (see emissive_layer) +scoreboard objectives add ts.sa.prev_x dummy +scoreboard objectives add ts.sa.prev_y dummy +scoreboard objectives add ts.sa.prev_z dummy # Entity properties scoreboard objectives add ts.sa.e.y dummy diff --git a/data/spawnanimations/function/internal/calc_activation.mcfunction b/data/spawnanimations/function/internal/calc_activation.mcfunction index 87139df..a2a77f1 100644 --- a/data/spawnanimations/function/internal/calc_activation.mcfunction +++ b/data/spawnanimations/function/internal/calc_activation.mcfunction @@ -2,9 +2,10 @@ # @s/~ ~ ~ is tested entity; $global is player position # Get position -execute store result score @s ts.sa.x run data get entity @s Pos[0] -execute store result score @s ts.sa.y run data get entity @s Pos[1] -execute store result score @s ts.sa.z run data get entity @s Pos[2] +data modify storage spawnanimations:temp Pos set from entity @s Pos +execute store result score @s ts.sa.x run data get storage spawnanimations:temp Pos[0] +execute store result score @s ts.sa.y run data get storage spawnanimations:temp Pos[1] +execute store result score @s ts.sa.z run data get storage spawnanimations:temp Pos[2] # Calculate diff scoreboard players operation @s ts.sa.x -= $global ts.sa.x @@ -12,12 +13,11 @@ scoreboard players operation @s ts.sa.y -= $global ts.sa.y scoreboard players operation @s ts.sa.z -= $global ts.sa.z # Make sure value is positive -scoreboard players set $minus ts.sa.x -1 -execute if score @s ts.sa.x matches ..0 run scoreboard players operation @s ts.sa.x *= $minus ts.sa.x -execute if score @s ts.sa.y matches ..0 run scoreboard players operation @s ts.sa.y *= $minus ts.sa.x -execute if score @s ts.sa.z matches ..0 run scoreboard players operation @s ts.sa.z *= $minus ts.sa.x +execute if score @s ts.sa.x matches ..0 run scoreboard players operation @s ts.sa.x *= #minus ts.sa.x +execute if score @s ts.sa.y matches ..0 run scoreboard players operation @s ts.sa.y *= #minus ts.sa.x +execute if score @s ts.sa.z matches ..0 run scoreboard players operation @s ts.sa.z *= #minus ts.sa.x -# Add dis together +# Add distances together scoreboard players operation @s ts.sa.x += @s ts.sa.y scoreboard players operation @s ts.sa.x += @s ts.sa.z diff --git a/data/spawnanimations/function/internal/entity/ehs/conflict/resolve.mcfunction b/data/spawnanimations/function/internal/entity/ehs/conflict/resolve.mcfunction index dda401c..1eebf9c 100644 --- a/data/spawnanimations/function/internal/entity/ehs/conflict/resolve.mcfunction +++ b/data/spawnanimations/function/internal/entity/ehs/conflict/resolve.mcfunction @@ -7,7 +7,7 @@ data modify storage spawnanimations:temp equipment set value {} data modify storage spawnanimations:temp equipment set from entity @s equipment # Build entity data -data modify storage spawnanimations:temp equipment_build set value {body:{id:"minecraft:chest",count:1,components:{"minecraft:container":[{slot:0,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:1,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:2,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:3,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:4,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:5,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:6,item:{id:"minecraft:paper",count:1,components:{"minecraft:custom_data":{TsSaveFormat:2,TsSaRemove:1b}}}}],"minecraft:custom_data":{TsSaRemove:1b}}}} +data modify storage spawnanimations:temp equipment_build set value {body:{id:"minecraft:chest",count:1,components:{"minecraft:container":[{slot:0,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:1,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:2,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:3,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:4,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:5,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:6,item:{id:"minecraft:paper",count:1,components:{"minecraft:custom_data":{TsSaveFormat:2,TsSaRemove:1b}}}}],"minecraft:enchantments":{"minecraft:vanishing_curse":1},"minecraft:custom_data":{TsSaRemove:1b}}}} data modify storage spawnanimations:temp equipment_build.body merge from storage spawnanimations:temp equipment.body # Save new Armor Items diff --git a/data/spawnanimations/function/internal/entity/ehs/save_armor.mcfunction b/data/spawnanimations/function/internal/entity/ehs/save_armor.mcfunction index 5fb6d95..6f42205 100644 --- a/data/spawnanimations/function/internal/entity/ehs/save_armor.mcfunction +++ b/data/spawnanimations/function/internal/entity/ehs/save_armor.mcfunction @@ -8,7 +8,7 @@ data modify storage spawnanimations:temp equipment set value {} data modify storage spawnanimations:temp equipment set from entity @s equipment # Build entity data -data modify storage spawnanimations:temp equipment_build set value {body:{id:"minecraft:chest",count:1,components:{"minecraft:container":[{slot:0,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:1,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:2,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:3,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:4,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:5,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:6,item:{id:"minecraft:paper",count:1,components:{"minecraft:custom_data":{TsSaveFormat:2,TsSaRemove:1b}}}}],"minecraft:custom_data":{TsSaRemove:1b}}}} +data modify storage spawnanimations:temp equipment_build set value {body:{id:"minecraft:chest",count:1,components:{"minecraft:container":[{slot:0,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:1,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:2,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:3,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:4,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:5,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:6,item:{id:"minecraft:paper",count:1,components:{"minecraft:custom_data":{TsSaveFormat:2,TsSaRemove:1b}}}}],"minecraft:enchantments":{"minecraft:vanishing_curse":1},"minecraft:custom_data":{TsSaRemove:1b}}}} # Copy Armor Items in correct order execute if data storage spawnanimations:temp equipment.feet.id run function spawnanimations:internal/entity/ehs/build_data_entry/armor_0 diff --git a/data/spawnanimations/function/internal/entity/get_animation_speed.mcfunction b/data/spawnanimations/function/internal/entity/get_animation_speed.mcfunction index bba451c..f6c63b9 100644 --- a/data/spawnanimations/function/internal/entity/get_animation_speed.mcfunction +++ b/data/spawnanimations/function/internal/entity/get_animation_speed.mcfunction @@ -1,5 +1,5 @@ ##by Tschipcraft -# This function sets the ts.sa.e.speed scoreboard depending on speed and slowness effects of the current entity (@s) +# Sets the ts.sa.e.speed scoreboard value depending on speed and slowness effects of the current entity (@s) scoreboard players set @s ts.sa.e.speed 0 execute if predicate spawnanimations:animation_speed/speed0 run scoreboard players add @s ts.sa.e.speed 1 diff --git a/data/spawnanimations/function/internal/run_activation_batch.mcfunction b/data/spawnanimations/function/internal/run_activation_batch.mcfunction index e66a35e..b89ab19 100644 --- a/data/spawnanimations/function/internal/run_activation_batch.mcfunction +++ b/data/spawnanimations/function/internal/run_activation_batch.mcfunction @@ -1,9 +1,11 @@ ##by Tschipcraft -# Get pos -execute store result score $global ts.sa.x run data get entity @s Pos[0] -execute store result score $global ts.sa.y run data get entity @s Pos[1] -execute store result score $global ts.sa.z run data get entity @s Pos[2] +# Get player position +data modify storage spawnanimations:temp Pos set from entity @s Pos +execute store result score $global ts.sa.x run data get storage spawnanimations:temp Pos[0] +execute store result score $global ts.sa.y run data get storage spawnanimations:temp Pos[1] +execute store result score $global ts.sa.z run data get storage spawnanimations:temp Pos[2] # Activate entities -execute as @e[type=!#spawnanimations:exclude,tag=ts.sa.to_verify,distance=..100,limit=10,sort=random] at @s run function spawnanimations:internal/calc_activation +execute if score $activation_dist ts.sa.settings matches 25..100 as @e[type=!#spawnanimations:exclude,tag=ts.sa.to_verify,distance=..100,limit=5,sort=random] at @s run function spawnanimations:internal/calc_activation +execute if score $activation_dist ts.sa.settings matches 1..24 as @e[type=!#spawnanimations:exclude,tag=ts.sa.to_verify,distance=..25,limit=1,sort=random] at @s run function spawnanimations:internal/calc_activation diff --git a/data/spawnanimations/function/main.mcfunction b/data/spawnanimations/function/main.mcfunction index 756fc04..5dea781 100644 --- a/data/spawnanimations/function/main.mcfunction +++ b/data/spawnanimations/function/main.mcfunction @@ -13,7 +13,7 @@ execute if score $version ts.sa.settings matches 2587.. as @e[type=#spawnanimati # Player nearby execute if score $global ts.sa.count matches ..100 as @a[gamemode=!spectator,sort=random,limit=5] at @s run function spawnanimations:internal/run_activation_batch # Exclusion criteria -execute if score $global ts.sa.count matches ..100 as @e[type=!#spawnanimations:exclude,predicate=!spawnanimations:trigger,tag=ts.sa.to_verify,limit=10,sort=random] at @s run function spawnanimations:internal/animation/dig_up/start +execute if score $global ts.sa.count matches ..100 as @e[type=!#spawnanimations:exclude,tag=ts.sa.to_verify,limit=10,sort=random] as @s[predicate=!spawnanimations:trigger] at @s run function spawnanimations:internal/animation/dig_up/start ## Tick dig up animation diff --git a/data/spawnanimations/function/uninstall.mcfunction b/data/spawnanimations/function/uninstall.mcfunction index ff3f2b6..f188b4c 100644 --- a/data/spawnanimations/function/uninstall.mcfunction +++ b/data/spawnanimations/function/uninstall.mcfunction @@ -17,6 +17,9 @@ scoreboard objectives remove ts.sa.welcome scoreboard objectives remove ts.sa.x scoreboard objectives remove ts.sa.y scoreboard objectives remove ts.sa.z +scoreboard objectives remove ts.sa.prev_x +scoreboard objectives remove ts.sa.prev_y +scoreboard objectives remove ts.sa.prev_z scoreboard objectives remove ts.sa.settings scoreboard objectives remove ts.sa.distance diff --git a/data/spawnanimations/functions/install.mcfunction b/data/spawnanimations/functions/install.mcfunction index f8ada66..3e44c3f 100644 --- a/data/spawnanimations/functions/install.mcfunction +++ b/data/spawnanimations/functions/install.mcfunction @@ -5,9 +5,16 @@ scoreboard objectives add ts.sa.timer dummy scoreboard objectives add ts.sa.count dummy scoreboard objectives add ts.sa.welcome trigger +# Activation distance calculation scoreboard objectives add ts.sa.x dummy scoreboard objectives add ts.sa.y dummy scoreboard objectives add ts.sa.z dummy +scoreboard players set #minus ts.sa.x -1 + +# Escape protection for shrunk/emissive entities (see emissive_layer in overlay_33) +scoreboard objectives add ts.sa.prev_x dummy +scoreboard objectives add ts.sa.prev_y dummy +scoreboard objectives add ts.sa.prev_z dummy # Entity properties scoreboard objectives add ts.sa.e.y dummy diff --git a/data/spawnanimations/functions/internal/calc_activation.mcfunction b/data/spawnanimations/functions/internal/calc_activation.mcfunction index 87139df..a2a77f1 100644 --- a/data/spawnanimations/functions/internal/calc_activation.mcfunction +++ b/data/spawnanimations/functions/internal/calc_activation.mcfunction @@ -2,9 +2,10 @@ # @s/~ ~ ~ is tested entity; $global is player position # Get position -execute store result score @s ts.sa.x run data get entity @s Pos[0] -execute store result score @s ts.sa.y run data get entity @s Pos[1] -execute store result score @s ts.sa.z run data get entity @s Pos[2] +data modify storage spawnanimations:temp Pos set from entity @s Pos +execute store result score @s ts.sa.x run data get storage spawnanimations:temp Pos[0] +execute store result score @s ts.sa.y run data get storage spawnanimations:temp Pos[1] +execute store result score @s ts.sa.z run data get storage spawnanimations:temp Pos[2] # Calculate diff scoreboard players operation @s ts.sa.x -= $global ts.sa.x @@ -12,12 +13,11 @@ scoreboard players operation @s ts.sa.y -= $global ts.sa.y scoreboard players operation @s ts.sa.z -= $global ts.sa.z # Make sure value is positive -scoreboard players set $minus ts.sa.x -1 -execute if score @s ts.sa.x matches ..0 run scoreboard players operation @s ts.sa.x *= $minus ts.sa.x -execute if score @s ts.sa.y matches ..0 run scoreboard players operation @s ts.sa.y *= $minus ts.sa.x -execute if score @s ts.sa.z matches ..0 run scoreboard players operation @s ts.sa.z *= $minus ts.sa.x +execute if score @s ts.sa.x matches ..0 run scoreboard players operation @s ts.sa.x *= #minus ts.sa.x +execute if score @s ts.sa.y matches ..0 run scoreboard players operation @s ts.sa.y *= #minus ts.sa.x +execute if score @s ts.sa.z matches ..0 run scoreboard players operation @s ts.sa.z *= #minus ts.sa.x -# Add dis together +# Add distances together scoreboard players operation @s ts.sa.x += @s ts.sa.y scoreboard players operation @s ts.sa.x += @s ts.sa.z diff --git a/data/spawnanimations/functions/internal/entity/ehs/save_armor.mcfunction b/data/spawnanimations/functions/internal/entity/ehs/save_armor.mcfunction index 9d56b68..7cd7283 100644 --- a/data/spawnanimations/functions/internal/entity/ehs/save_armor.mcfunction +++ b/data/spawnanimations/functions/internal/entity/ehs/save_armor.mcfunction @@ -16,6 +16,6 @@ data modify storage spawnanimations:temp HandItems[0] merge value {Slot:0b} data modify storage spawnanimations:temp HandItems[1] merge value {Slot:1b} # Copy to entity -data merge entity @s {ArmorItems:[{id:"minecraft:chest",Count:1b,tag:{TsSaRemove:1b}},{id:"minecraft:chest",Count:1b,tag:{TsSaRemove:1b}},{},{}],HandItems:[]} +data merge entity @s {ArmorItems:[{id:"minecraft:chest",Count:1b,tag:{Enchantments:[{id:"minecraft:vanishing_curse",lvl:1s}],TsSaRemove:1b}},{id:"minecraft:chest",Count:1b,tag:{Enchantments:[{id:"minecraft:vanishing_curse",lvl:1s}],TsSaRemove:1b}},{},{}],HandItems:[]} data modify entity @s ArmorItems[0].tag.BlockEntityTag.Items set from storage spawnanimations:temp ArmorItems data modify entity @s ArmorItems[1].tag.BlockEntityTag.Items set from storage spawnanimations:temp HandItems diff --git a/data/spawnanimations/functions/internal/entity/get_animation_speed.mcfunction b/data/spawnanimations/functions/internal/entity/get_animation_speed.mcfunction index bba451c..f6c63b9 100644 --- a/data/spawnanimations/functions/internal/entity/get_animation_speed.mcfunction +++ b/data/spawnanimations/functions/internal/entity/get_animation_speed.mcfunction @@ -1,5 +1,5 @@ ##by Tschipcraft -# This function sets the ts.sa.e.speed scoreboard depending on speed and slowness effects of the current entity (@s) +# Sets the ts.sa.e.speed scoreboard value depending on speed and slowness effects of the current entity (@s) scoreboard players set @s ts.sa.e.speed 0 execute if predicate spawnanimations:animation_speed/speed0 run scoreboard players add @s ts.sa.e.speed 1 diff --git a/data/spawnanimations/functions/internal/run_activation_batch.mcfunction b/data/spawnanimations/functions/internal/run_activation_batch.mcfunction index e66a35e..b89ab19 100644 --- a/data/spawnanimations/functions/internal/run_activation_batch.mcfunction +++ b/data/spawnanimations/functions/internal/run_activation_batch.mcfunction @@ -1,9 +1,11 @@ ##by Tschipcraft -# Get pos -execute store result score $global ts.sa.x run data get entity @s Pos[0] -execute store result score $global ts.sa.y run data get entity @s Pos[1] -execute store result score $global ts.sa.z run data get entity @s Pos[2] +# Get player position +data modify storage spawnanimations:temp Pos set from entity @s Pos +execute store result score $global ts.sa.x run data get storage spawnanimations:temp Pos[0] +execute store result score $global ts.sa.y run data get storage spawnanimations:temp Pos[1] +execute store result score $global ts.sa.z run data get storage spawnanimations:temp Pos[2] # Activate entities -execute as @e[type=!#spawnanimations:exclude,tag=ts.sa.to_verify,distance=..100,limit=10,sort=random] at @s run function spawnanimations:internal/calc_activation +execute if score $activation_dist ts.sa.settings matches 25..100 as @e[type=!#spawnanimations:exclude,tag=ts.sa.to_verify,distance=..100,limit=5,sort=random] at @s run function spawnanimations:internal/calc_activation +execute if score $activation_dist ts.sa.settings matches 1..24 as @e[type=!#spawnanimations:exclude,tag=ts.sa.to_verify,distance=..25,limit=1,sort=random] at @s run function spawnanimations:internal/calc_activation diff --git a/data/spawnanimations/functions/main.mcfunction b/data/spawnanimations/functions/main.mcfunction index 8f76718..1da9432 100644 --- a/data/spawnanimations/functions/main.mcfunction +++ b/data/spawnanimations/functions/main.mcfunction @@ -13,7 +13,7 @@ execute if score $version ts.sa.settings matches 2587.. as @e[type=#spawnanimati # Player nearby execute if score $global ts.sa.count matches ..100 as @a[gamemode=!spectator,sort=random,limit=5] at @s run function spawnanimations:internal/run_activation_batch # Exclusion criteria -execute if score $global ts.sa.count matches ..100 as @e[type=!#spawnanimations:exclude,predicate=!spawnanimations:trigger,tag=ts.sa.to_verify,limit=10,sort=random] at @s run function spawnanimations:internal/animation/dig_up/start +execute if score $global ts.sa.count matches ..100 as @e[type=!#spawnanimations:exclude,tag=ts.sa.to_verify,limit=10,sort=random] as @s[predicate=!spawnanimations:trigger] at @s run function spawnanimations:internal/animation/dig_up/start ## Tick dig up animation diff --git a/data/spawnanimations/functions/uninstall.mcfunction b/data/spawnanimations/functions/uninstall.mcfunction index ff3f2b6..f188b4c 100644 --- a/data/spawnanimations/functions/uninstall.mcfunction +++ b/data/spawnanimations/functions/uninstall.mcfunction @@ -17,6 +17,9 @@ scoreboard objectives remove ts.sa.welcome scoreboard objectives remove ts.sa.x scoreboard objectives remove ts.sa.y scoreboard objectives remove ts.sa.z +scoreboard objectives remove ts.sa.prev_x +scoreboard objectives remove ts.sa.prev_y +scoreboard objectives remove ts.sa.prev_z scoreboard objectives remove ts.sa.settings scoreboard objectives remove ts.sa.distance diff --git a/overlay_33/data/spawnanimations/functions/internal/entity/ehs/conflict/resolve.mcfunction b/overlay_33/data/spawnanimations/functions/internal/entity/ehs/conflict/resolve.mcfunction index e5f0f7b..c031034 100644 --- a/overlay_33/data/spawnanimations/functions/internal/entity/ehs/conflict/resolve.mcfunction +++ b/overlay_33/data/spawnanimations/functions/internal/entity/ehs/conflict/resolve.mcfunction @@ -7,7 +7,7 @@ data modify storage spawnanimations:temp ArmorItems set from entity @s ArmorItem data modify storage spawnanimations:temp HandItems set from entity @s HandItems # Build entity data -data modify storage spawnanimations:temp ArmorItemsBuild set value [{id:"minecraft:chest",count:1,components:{"minecraft:container":[{slot:0,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:1,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:2,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:3,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:4,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:5,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:6,item:{id:"minecraft:paper",count:1,components:{"minecraft:custom_data":{TsSaveFormat:1,TsSaRemove:1b}}}}],"minecraft:custom_data":{TsSaRemove:1b}}},{},{},{}] +data modify storage spawnanimations:temp ArmorItemsBuild set value [{id:"minecraft:chest",count:1,components:{"minecraft:container":[{slot:0,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:1,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:2,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:3,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:4,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:5,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:6,item:{id:"minecraft:paper",count:1,components:{"minecraft:custom_data":{TsSaveFormat:1,TsSaRemove:1b}}}}],"minecraft:enchantments":{levels:{"minecraft:vanishing_curse":1}},"minecraft:custom_data":{TsSaRemove:1b}}},{},{},{}] data modify storage spawnanimations:temp ArmorItemsBuild[0] merge from storage spawnanimations:temp ArmorItems[0] # Save new Armor Items (legs, chest, head) diff --git a/overlay_33/data/spawnanimations/functions/internal/entity/ehs/save_armor.mcfunction b/overlay_33/data/spawnanimations/functions/internal/entity/ehs/save_armor.mcfunction index 26cddc8..759386e 100644 --- a/overlay_33/data/spawnanimations/functions/internal/entity/ehs/save_armor.mcfunction +++ b/overlay_33/data/spawnanimations/functions/internal/entity/ehs/save_armor.mcfunction @@ -8,7 +8,7 @@ data modify storage spawnanimations:temp ArmorItems set from entity @s ArmorItem data modify storage spawnanimations:temp HandItems set from entity @s HandItems # Build entity data -data modify storage spawnanimations:temp ArmorItemsBuild set value [{id:"minecraft:chest",count:1,components:{"minecraft:container":[{slot:0,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:1,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:2,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:3,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:4,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:5,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:6,item:{id:"minecraft:paper",count:1,components:{"minecraft:custom_data":{TsSaveFormat:1,TsSaRemove:1b}}}}],"minecraft:custom_data":{TsSaRemove:1b}}},{},{},{}] +data modify storage spawnanimations:temp ArmorItemsBuild set value [{id:"minecraft:chest",count:1,components:{"minecraft:container":[{slot:0,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:1,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:2,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:3,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:4,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:5,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:6,item:{id:"minecraft:paper",count:1,components:{"minecraft:custom_data":{TsSaveFormat:1,TsSaRemove:1b}}}}],"minecraft:enchantments":{levels:{"minecraft:vanishing_curse":1}},"minecraft:custom_data":{TsSaRemove:1b}}},{},{},{}] # Copy Armor Items in correct order execute if data storage spawnanimations:temp ArmorItems[0].id run function spawnanimations:internal/entity/ehs/build_data_entry/armor_0 diff --git a/overlay_35/data/spawnanimations/predicates/validate/detect_old_format.json b/overlay_35/data/spawnanimations/predicates/validate/detect_v0_format.json similarity index 100% rename from overlay_35/data/spawnanimations/predicates/validate/detect_old_format.json rename to overlay_35/data/spawnanimations/predicates/validate/detect_v0_format.json diff --git a/overlay_35/overrides.impdoc b/overlay_35/overrides.impdoc new file mode 100644 index 0000000..eece619 --- /dev/null +++ b/overlay_35/overrides.impdoc @@ -0,0 +1,4 @@ +@targets 24w11a..24w20a +@changes predicates + +- `custom_data` now uses a sub predicate diff --git a/overlay_pre_63/data/spawnanimations/function/internal/entity/ehs/conflict/resolve.mcfunction b/overlay_pre_63/data/spawnanimations/function/internal/entity/ehs/conflict/resolve.mcfunction index e5f0f7b..c031034 100644 --- a/overlay_pre_63/data/spawnanimations/function/internal/entity/ehs/conflict/resolve.mcfunction +++ b/overlay_pre_63/data/spawnanimations/function/internal/entity/ehs/conflict/resolve.mcfunction @@ -7,7 +7,7 @@ data modify storage spawnanimations:temp ArmorItems set from entity @s ArmorItem data modify storage spawnanimations:temp HandItems set from entity @s HandItems # Build entity data -data modify storage spawnanimations:temp ArmorItemsBuild set value [{id:"minecraft:chest",count:1,components:{"minecraft:container":[{slot:0,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:1,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:2,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:3,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:4,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:5,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:6,item:{id:"minecraft:paper",count:1,components:{"minecraft:custom_data":{TsSaveFormat:1,TsSaRemove:1b}}}}],"minecraft:custom_data":{TsSaRemove:1b}}},{},{},{}] +data modify storage spawnanimations:temp ArmorItemsBuild set value [{id:"minecraft:chest",count:1,components:{"minecraft:container":[{slot:0,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:1,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:2,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:3,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:4,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:5,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:6,item:{id:"minecraft:paper",count:1,components:{"minecraft:custom_data":{TsSaveFormat:1,TsSaRemove:1b}}}}],"minecraft:enchantments":{levels:{"minecraft:vanishing_curse":1}},"minecraft:custom_data":{TsSaRemove:1b}}},{},{},{}] data modify storage spawnanimations:temp ArmorItemsBuild[0] merge from storage spawnanimations:temp ArmorItems[0] # Save new Armor Items (legs, chest, head) diff --git a/overlay_pre_63/data/spawnanimations/function/internal/entity/ehs/save_armor.mcfunction b/overlay_pre_63/data/spawnanimations/function/internal/entity/ehs/save_armor.mcfunction index 26cddc8..759386e 100644 --- a/overlay_pre_63/data/spawnanimations/function/internal/entity/ehs/save_armor.mcfunction +++ b/overlay_pre_63/data/spawnanimations/function/internal/entity/ehs/save_armor.mcfunction @@ -8,7 +8,7 @@ data modify storage spawnanimations:temp ArmorItems set from entity @s ArmorItem data modify storage spawnanimations:temp HandItems set from entity @s HandItems # Build entity data -data modify storage spawnanimations:temp ArmorItemsBuild set value [{id:"minecraft:chest",count:1,components:{"minecraft:container":[{slot:0,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:1,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:2,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:3,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:4,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:5,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:6,item:{id:"minecraft:paper",count:1,components:{"minecraft:custom_data":{TsSaveFormat:1,TsSaRemove:1b}}}}],"minecraft:custom_data":{TsSaRemove:1b}}},{},{},{}] +data modify storage spawnanimations:temp ArmorItemsBuild set value [{id:"minecraft:chest",count:1,components:{"minecraft:container":[{slot:0,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:1,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:2,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:3,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:4,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:5,item:{id:"minecraft:chest",count:1,components:{"minecraft:custom_data":{TsSaRemove:1b}}}},{slot:6,item:{id:"minecraft:paper",count:1,components:{"minecraft:custom_data":{TsSaveFormat:1,TsSaRemove:1b}}}}],"minecraft:enchantments":{levels:{"minecraft:vanishing_curse":1}},"minecraft:custom_data":{TsSaRemove:1b}}},{},{},{}] # Copy Armor Items in correct order execute if data storage spawnanimations:temp ArmorItems[0].id run function spawnanimations:internal/entity/ehs/build_data_entry/armor_0 From 65aeff03456481867a6357d16cf501a7f4a10fcb Mon Sep 17 00:00:00 2001 From: Tschipcraft <78470530+Tschipcraft@users.noreply.github.com> Date: Mon, 21 Jul 2025 18:21:30 +0200 Subject: [PATCH 2/7] Add emissive layer handling for hidden entities - Added proper handling of hidden entities with emissive layers (Endermen, Spiders, Cave Spiders) by shrinking their scale and tracking their position to prevent enclosure breaches (closes #25) - Modified the attack predicate of the secondary dig-up requirements so that it disregards the Y-distance. This allows mobs to, for example, appear at the bottom of pillars, if a player decides to build up during the night - Added an activation distance recommendation message when using the vanilla activation mode - Fixed possibility for hidden falling mobs to lose their fall distance NBT when appearing - Updated CD workflow output formatting --- .github/workflows/cd.yml | 61 ++++++++++--------- CHANGES.md | 6 +- assets/spawnanimations/lang/en_us.json | 7 ++- .../emissive_layer/hide.mcfunction | 12 ++++ .../check_distance.mcfunction | 32 ++++++++++ .../check_enclosure.mcfunction | 28 +++++++++ .../move_back.mcfunction | 6 ++ .../emissive_layer/unhide.mcfunction | 5 ++ .../internal/entity/ehs/hide_exec.mcfunction | 1 + .../internal/entity/ehs/unhide.mcfunction | 1 + .../internal/entity/unprotect.mcfunction | 2 +- data/spawnanimations/function/loop.mcfunction | 6 +- .../function/settings/vanilla.mcfunction | 1 + .../internal/entity/ehs/hide_exec.mcfunction | 1 + .../internal/entity/ehs/unhide.mcfunction | 1 + .../internal/entity/unprotect.mcfunction | 2 +- .../spawnanimations/functions/loop.mcfunction | 6 +- .../functions/settings/vanilla.mcfunction | 1 + data/spawnanimations/predicate/attacking.json | 4 +- .../spawnanimations/predicates/attacking.json | 4 +- .../tags/entity_type/has_emissive_layer.json | 9 +++ .../tags/entity_types/has_emissive_layer.json | 9 +++ .../emissive_layer/hide.mcfunction | 12 ++++ .../check_distance.mcfunction | 32 ++++++++++ .../check_enclosure.mcfunction | 28 +++++++++ .../move_back.mcfunction | 6 ++ .../emissive_layer/unhide.mcfunction | 5 ++ .../emissive_layer/hide.mcfunction | 12 ++++ .../emissive_layer/unhide.mcfunction | 5 ++ overlay_pre_49/overrides.impdoc | 4 ++ pack.mcmeta | 4 ++ 31 files changed, 272 insertions(+), 41 deletions(-) create mode 100644 data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/hide.mcfunction create mode 100644 data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance.mcfunction create mode 100644 data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_enclosure.mcfunction create mode 100644 data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/move_back.mcfunction create mode 100644 data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/unhide.mcfunction create mode 100644 data/spawnanimations/tags/entity_type/has_emissive_layer.json create mode 100644 data/spawnanimations/tags/entity_types/has_emissive_layer.json create mode 100644 overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/hide.mcfunction create mode 100644 overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance.mcfunction create mode 100644 overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_enclosure.mcfunction create mode 100644 overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/move_back.mcfunction create mode 100644 overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/unhide.mcfunction create mode 100644 overlay_pre_49/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/hide.mcfunction create mode 100644 overlay_pre_49/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/unhide.mcfunction create mode 100644 overlay_pre_49/overrides.impdoc diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 2e236e0..7b7783a 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -358,42 +358,43 @@ jobs: run: | echo "Building summary..." if [ "${{ job.status }}" == "success" ]; then - SUMMARY_CONTENT=" - - \"✅ -
+ SUMMARY_CONTENT=" + + \"✅ +
- **${{ github.event.repository.name }} v${{ github.event.inputs.tag }}** for **Minecraft ${{ env.MC_HUMAN_VERSION_RANGE }}** published successfully! + **${{ github.event.repository.name }} v${{ github.event.inputs.tag }}** for **Minecraft ${{ env.MC_HUMAN_VERSION_RANGE }}** published successfully! - [View Changelog](https://github.com/${{ github.repository }}/blob/v${{ github.event.inputs.tag }}/CHANGES.md) + [View Changelog](https://github.com/${{ github.repository }}/blob/v${{ github.event.inputs.tag }}/CHANGES.md) - **Downloads:** - " + **Downloads:** + " - if [ -n "${{ steps.upload_modrinth_dp.outputs.modrinth-url }}" ]; then - SUMMARY_CONTENT+="- [Modrinth (Data Pack)](${{ steps.upload_modrinth_dp.outputs.modrinth-url }}) - " - fi - if [ -n "${{ steps.upload_modrinth_mod.outputs.modrinth-url }}" ]; then - SUMMARY_CONTENT+="- [Modrinth (Mod)](${{ steps.upload_modrinth_mod.outputs.modrinth-url }}) - " - fi - if [ -n "${{ steps.upload_curseforge_dp.outputs.curseforge-url }}" ]; then - SUMMARY_CONTENT+="- [CurseForge (Data Pack)](${{ steps.upload_curseforge_dp.outputs.curseforge-url }}) - " - fi - if [ -n "${{ steps.upload_curseforge_mod.outputs.curseforge-url }}" ]; then - SUMMARY_CONTENT+="- [CurseForge (Mod)](${{ steps.upload_curseforge_mod.outputs.curseforge-url }}) - " - fi - if [ -n "${{ steps.upload_github.outputs.github-url }}" ]; then - SUMMARY_CONTENT+="- [GitHub Releases](${{ steps.upload_github.outputs.github-url }}) - " - fi + if [ -n "${{ steps.upload_modrinth_dp.outputs.modrinth-url }}" ]; then + SUMMARY_CONTENT+="- [Modrinth (Data Pack)](${{ steps.upload_modrinth_dp.outputs.modrinth-url }}) + " + fi + if [ -n "${{ steps.upload_modrinth_mod.outputs.modrinth-url }}" ]; then + SUMMARY_CONTENT+="- [Modrinth (Mod)](${{ steps.upload_modrinth_mod.outputs.modrinth-url }}) + " + fi + if [ -n "${{ steps.upload_curseforge_dp.outputs.curseforge-url }}" ]; then + SUMMARY_CONTENT+="- [CurseForge (Data Pack)](${{ steps.upload_curseforge_dp.outputs.curseforge-url }}) + " + fi + if [ -n "${{ steps.upload_curseforge_mod.outputs.curseforge-url }}" ]; then + SUMMARY_CONTENT+="- [CurseForge (Mod)](${{ steps.upload_curseforge_mod.outputs.curseforge-url }}) + " + fi + if [ -n "${{ steps.upload_github.outputs.github-url }}" ]; then + SUMMARY_CONTENT+="- [GitHub Releases](${{ steps.upload_github.outputs.github-url }}) + " + fi + + echo -e "$SUMMARY_CONTENT" >> $GITHUB_STEP_SUMMARY - echo -e "$SUMMARY_CONTENT" >> $GITHUB_STEP_SUMMARY else - cat << EOF >> $GITHUB_STEP_SUMMARY + cat << EOF >> $GITHUB_STEP_SUMMARY ❌ Error diff --git a/CHANGES.md b/CHANGES.md index 9ada9f8..4781081 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,7 @@ -- Improved performance by refactoring entity activation distance calculations to bundle and cache position data retrieval calls, and updating batch activation logic (up to 1 ms faster per tick!) +- **Entities with emissive layers are now properly hidden** (Endermen, Spiders, and Cave Spiders) (closes [#25](https://github.com/Tschipcraft/spawnanimations/issues/25)) +- Improved performance by refactoring entity activation distance calculations to bundle and cache position data retrieval calls, and updating batch activation logic (the whole data pack is now up to 1ms (~45%ish) faster per tick!) +- Modified the attack predicate of the secondary dig-up requirements so that it disregards the Y-distance. This allows mobs to, for example, appear at the bottom of pillars, if a player decides to build up during the night +- Added an activation distance recommendation message when using the vanilla activation mode +- Fixed possibility for hidden falling mobs to lose their fall distance NBT when appearing - Fixed v0 save format not correctly upgrading to v1 from 24w11a to 24w20a (affecting major releases 1.20.5 and 1.20.6) - Improved armor save/resolve functions to include the vanishing curse enchantment in the root proxy chest item diff --git a/assets/spawnanimations/lang/en_us.json b/assets/spawnanimations/lang/en_us.json index 770df2c..5065595 100644 --- a/assets/spawnanimations/lang/en_us.json +++ b/assets/spawnanimations/lang/en_us.json @@ -1,4 +1,8 @@ { + "modmenu.summaryTranslation.spawnanimations": "Hostile mobs dig out of the ground or poof into existence when they spawn!", + "modmenu.descriptionTranslation.spawnanimations": "Hostile mobs dig out of the ground or poof into existence when they spawn!\n§lWorks with:§r Zombies, Husks, Drowned, Skeletons, Strays, Bogged, Spiders, Cave Spiders, Creepers, Slimes, Magma Cubes, Wither Skeletons, Hoglins, Zombified Piglins, Striders, Enderman and Giants.\nThis data pack is designed to be as unintrusive as possible. Hidden entities including their worn armor and tools will only be invisible and silent.\nExecute the command §o/function §ospawnanimations:settings§r for a world-specific settings menu and/or install MidnightLib for global settings across all worlds.", + "fml.menu.mods.info.description.spawnanimations": "Hostile mobs dig out of the ground or poof into existence when they spawn!\n\n§lWorks with:§r Zombies, Husks, Drowned, Skeletons, Strays, Bogged, Spiders, Cave Spiders, Creepers, Slimes, Magma Cubes, Wither Skeletons, Hoglins, Zombified Piglins, Striders, Enderman and Giants.\n\nThis data pack is designed to be as unintrusive as possible. Hidden entities including their worn armor and tools will only be invisible and silent.\n\nExecute the command §o/function §ospawnanimations:settings§r for a world-specific settings menu and/or install MidnightLib for global settings across all worlds.", + "spawnanimations.midnightconfig.title": "Spawn Animations Configuration", "spawnanimations.midnightconfig.empty": "", "spawnanimations.midnightconfig.configure_ingame": "§dâ„č Info:§r§f To configure this data pack on a world-to-world basis,", @@ -13,7 +17,7 @@ "spawnanimations.midnightconfig.activation_distance": "Activation Distance", "spawnanimations.midnightconfig.activation_distance.tooltip": "Default: §a20 blocks§f\nMobs closer to a player than this value will play the animation.\nSetting this to 0 will use the world-specific value.", "spawnanimations.midnightconfig.activation_mode": "Activation Mode", - "spawnanimations.midnightconfig.activation_mode.tooltip": "Default: §aClassic§f\n§nClassic§r: Out of range mobs will stay hidden until a player is in range\n§nVanilla§r: Out of range mobs will spawn normally", + "spawnanimations.midnightconfig.activation_mode.tooltip": "Default: §aClassic§f\n§nClassic§r: Out of range mobs will stay hidden until a player is in range\n§nVanilla§r: Out of range mobs will spawn normally\nWhen set to Vanilla, it is recommended to set the activation distance to at least 25 blocks to see the animation", "spawnanimations.midnightconfig.hide_worn_armor_and_tools": "Hide worn armor and tools", "spawnanimations.midnightconfig.hide_worn_armor_and_tools.tooltip": "Default: §aYes§f\nIf enabled, stores the worn armor and tools in the feet and in some versions leggings slot of a hidden entity.\n§6⚠ Note: This may impact worn armor and tool drop rates from farms when enabled.", "spawnanimations.midnightconfig.play_animation_on_unsupported_blocks": "Play block break animation on unsupported blocks", @@ -26,7 +30,6 @@ "spawnanimations.midnightconfig.enum.mode.CLASSIC": "§aClassic", "spawnanimations.midnightconfig.enum.mode.VANILLA": "§aVanilla", - "modmenu.summaryTranslation.spawnanimations": "Hostile mobs dig out of the ground or poof into existence when they spawn!", "modmenu.donate": "Donate", "modmenu.modrinth": "Modrinth", "modmenu.curseforge": "CurseForge", diff --git a/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/hide.mcfunction b/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/hide.mcfunction new file mode 100644 index 0000000..8a42e7b --- /dev/null +++ b/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/hide.mcfunction @@ -0,0 +1,12 @@ +##by Tschipcraft +# Shrinks entities with an emissive layer to lowest possible scale (0.0625) +# We do this using a negative scale modifier to not disturb the base scale value + +attribute @s minecraft:scale modifier add spawnanimations.ehs.scale -1000000000000000000000000000000 add_value +tag @s add ts.sa.ehs.shrunk + +# Save initial position +data modify storage spawnanimations:temp Pos set from entity @s Pos +execute store result score @s ts.sa.prev_x run data get storage spawnanimations:temp Pos[0] 10 +execute store result score @s ts.sa.prev_y run data get storage spawnanimations:temp Pos[1] 10 +execute store result score @s ts.sa.prev_z run data get storage spawnanimations:temp Pos[2] 10 diff --git a/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance.mcfunction b/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance.mcfunction new file mode 100644 index 0000000..24e425f --- /dev/null +++ b/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance.mcfunction @@ -0,0 +1,32 @@ +##by Tschipcraft +# Shrunk entity @s is trying to escape an enclosure, when not to far away from its previous position we move it back + +# Get current position +data modify storage spawnanimations:temp Pos set from entity @s Pos +execute store result score #current ts.sa.prev_x run data get storage spawnanimations:temp Pos[0] 10 +execute store result score #current ts.sa.prev_y run data get storage spawnanimations:temp Pos[1] 10 +execute store result score #current ts.sa.prev_z run data get storage spawnanimations:temp Pos[2] 10 + +scoreboard players operation #previous ts.sa.prev_x = @s ts.sa.prev_x +scoreboard players operation #previous ts.sa.prev_y = @s ts.sa.prev_y +scoreboard players operation #previous ts.sa.prev_z = @s ts.sa.prev_z + +# Calculate diff +scoreboard players operation #previous ts.sa.prev_x -= #current ts.sa.prev_x +scoreboard players operation #previous ts.sa.prev_y -= #current ts.sa.prev_y +scoreboard players operation #previous ts.sa.prev_z -= #current ts.sa.prev_z + +# Make sure value is positive +execute if score #previous ts.sa.prev_x matches ..0 run scoreboard players operation #previous ts.sa.prev_x *= #minus ts.sa.x +execute if score #previous ts.sa.prev_y matches ..0 run scoreboard players operation #previous ts.sa.prev_y *= #minus ts.sa.x +execute if score #previous ts.sa.prev_z matches ..0 run scoreboard players operation #previous ts.sa.prev_z *= #minus ts.sa.x + +# Add distances together +scoreboard players operation #previous ts.sa.prev_x += #previous ts.sa.prev_y +scoreboard players operation #previous ts.sa.prev_x += #previous ts.sa.prev_z + +# Move entity back to previous location if it moved not too far (distance times 10) +execute if score #previous ts.sa.prev_x matches ..30 run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/move_back + +# Trigger animation any way +function spawnanimations:internal/animation/dig_up/start diff --git a/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_enclosure.mcfunction b/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_enclosure.mcfunction new file mode 100644 index 0000000..295fa4e --- /dev/null +++ b/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_enclosure.mcfunction @@ -0,0 +1,28 @@ +##by Tschipcraft +# Checks if shrunk entity @s is trying to escape a potential enclosure + +# Inside block +execute unless block ~ ~ ~ #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance + +# Model default enderman hitbox size +execute as @s[type=minecraft:enderman,tag=ts.sa.to_verify] unless block ^0.3 ^1.5 ^0.3 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:enderman,tag=ts.sa.to_verify] unless block ^0.3 ^1.5 ^-0.3 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:enderman,tag=ts.sa.to_verify] unless block ^-0.3 ^1.5 ^0.3 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:enderman,tag=ts.sa.to_verify] unless block ^-0.3 ^1.5 ^-0.3 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:enderman,tag=ts.sa.to_verify] unless block ^0.3 ^2.9 ^0.3 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:enderman,tag=ts.sa.to_verify] unless block ^0.3 ^2.9 ^-0.3 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:enderman,tag=ts.sa.to_verify] unless block ^-0.3 ^2.9 ^0.3 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:enderman,tag=ts.sa.to_verify] unless block ^-0.3 ^2.9 ^-0.3 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance + +# Model default spider hitbox size +execute as @s[type=minecraft:spider,tag=ts.sa.to_verify] unless block ~0.7 ~ ~0.7 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:spider,tag=ts.sa.to_verify] unless block ~0.7 ~ ~-0.7 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:spider,tag=ts.sa.to_verify] unless block ~-0.7 ~ ~-0.7 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:spider,tag=ts.sa.to_verify] unless block ~-0.7 ~ ~0.7 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:spider,tag=ts.sa.to_verify] unless block ~ ~0.9 ~ #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance + +# Update position +execute if entity @s[tag=ts.sa.to_verify] run data modify storage spawnanimations:temp Pos set from entity @s Pos +execute if entity @s[tag=ts.sa.to_verify] store result score @s ts.sa.prev_x run data get storage spawnanimations:temp Pos[0] 10 +execute if entity @s[tag=ts.sa.to_verify] store result score @s ts.sa.prev_y run data get storage spawnanimations:temp Pos[1] 10 +execute if entity @s[tag=ts.sa.to_verify] store result score @s ts.sa.prev_z run data get storage spawnanimations:temp Pos[2] 10 diff --git a/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/move_back.mcfunction b/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/move_back.mcfunction new file mode 100644 index 0000000..1b3a623 --- /dev/null +++ b/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/move_back.mcfunction @@ -0,0 +1,6 @@ +##by Tschipcraft + +# Move back to previous position +execute store result entity @s Pos[0] double 0.1 run scoreboard players get @s ts.sa.prev_x +execute store result entity @s Pos[1] double 0.1 run scoreboard players get @s ts.sa.prev_y +execute store result entity @s Pos[2] double 0.1 run scoreboard players get @s ts.sa.prev_z diff --git a/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/unhide.mcfunction b/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/unhide.mcfunction new file mode 100644 index 0000000..d20b183 --- /dev/null +++ b/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/unhide.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft +# Resets entities with an emissive layer that got their scale changed + +attribute @s minecraft:scale modifier remove spawnanimations.ehs.scale +tag @s remove ts.sa.ehs.shrunk diff --git a/data/spawnanimations/function/internal/entity/ehs/hide_exec.mcfunction b/data/spawnanimations/function/internal/entity/ehs/hide_exec.mcfunction index d550418..3dc1bd5 100644 --- a/data/spawnanimations/function/internal/entity/ehs/hide_exec.mcfunction +++ b/data/spawnanimations/function/internal/entity/ehs/hide_exec.mcfunction @@ -10,3 +10,4 @@ execute if score $hide_armor ts.sa.settings matches 1..2 as @s[type=#spawnanimat # Entity specific execute if entity @s[type=minecraft:creeper] run function spawnanimations:internal/entity/ehs/entity_specific/creeper/hide +execute if entity @s[type=#spawnanimations:has_emissive_layer] run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/hide diff --git a/data/spawnanimations/function/internal/entity/ehs/unhide.mcfunction b/data/spawnanimations/function/internal/entity/ehs/unhide.mcfunction index 04d2f60..1d47a1d 100644 --- a/data/spawnanimations/function/internal/entity/ehs/unhide.mcfunction +++ b/data/spawnanimations/function/internal/entity/ehs/unhide.mcfunction @@ -9,5 +9,6 @@ execute as @s[tag=ts.sa.ehs.saved] run function spawnanimations:internal/entity/ # Entity specific execute if entity @s[type=minecraft:creeper] run function spawnanimations:internal/entity/ehs/entity_specific/creeper/unhide +execute as @s[tag=ts.sa.ehs.shrunk] run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/unhide tag @s remove ts.sa.hidden diff --git a/data/spawnanimations/function/internal/entity/unprotect.mcfunction b/data/spawnanimations/function/internal/entity/unprotect.mcfunction index 6997817..0391862 100644 --- a/data/spawnanimations/function/internal/entity/unprotect.mcfunction +++ b/data/spawnanimations/function/internal/entity/unprotect.mcfunction @@ -1,6 +1,6 @@ ##by Tschipcraft -data merge entity @s {Fire:0s,FallDistance:0f,fall_distance:0f} +execute unless block ~ ~-0.5 ~ #spawnanimations:nonsolid run data merge entity @s {Fire:0s,FallDistance:0f,fall_distance:0f} execute if score @s ts.sa.e.nbt.Inv matches 0 run data merge entity @s {Invulnerable:0b} scoreboard players reset @s ts.sa.e.nbt.Inv execute if score @s ts.sa.e.nbt.Sil matches 0 run data merge entity @s {Silent:0b} diff --git a/data/spawnanimations/function/loop.mcfunction b/data/spawnanimations/function/loop.mcfunction index 88fe86f..4b32377 100644 --- a/data/spawnanimations/function/loop.mcfunction +++ b/data/spawnanimations/function/loop.mcfunction @@ -6,13 +6,17 @@ schedule function spawnanimations:loop 5t ## Supply invisibility to hidden entities execute as @e[type=!#spawnanimations:exclude,tag=ts.sa.to_verify,tag=!smithed.strict,tag=!ignore.global] run function spawnanimations:internal/entity/ehs/supply_invisibility -## Check for old formats (post-1.20.5) +## Check for old save formats (post-1.20.5) function spawnanimations:internal/entity/ehs/check_for_old_v0_format function spawnanimations:internal/entity/ehs/check_for_old_v1_format ## Validate hidden entities +# Check save format validity execute as @e[type=#spawnanimations:can_wear_armor,tag=ts.sa.to_verify,tag=ts.sa.ehs.saved] unless predicate spawnanimations:validate at @s run function spawnanimations:internal/entity/ehs/conflict/evaluate +# Escape protection for shrunk entities +execute as @e[type=#spawnanimations:has_emissive_layer,tag=ts.sa.to_verify,tag=ts.sa.ehs.shrunk] at @s run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_enclosure + ## Remove problematic items execute as @e[type=minecraft:item,tag=!ts.sa.i.checked,tag=!global.ignore] run function spawnanimations:internal/entity/ehs/remove_invalid_item/check diff --git a/data/spawnanimations/function/settings/vanilla.mcfunction b/data/spawnanimations/function/settings/vanilla.mcfunction index 87a1320..15ad6d0 100644 --- a/data/spawnanimations/function/settings/vanilla.mcfunction +++ b/data/spawnanimations/function/settings/vanilla.mcfunction @@ -2,4 +2,5 @@ tellraw @s ["",{"text":"\n-> Set activation mode to "},{"text":"[vanilla]","color":"yellow"}] scoreboard players set $activation_mode ts.sa.settings 0 +execute if score $activation_dist ts.sa.settings matches ..24 run tellraw @s ["",{"text":"â„č Info: ","color":"blue"},{"text":"It is recommended to set the activation distance to at least 25 blocks when using the vanilla activation mode to see the animation","hoverEvent":{"action":"show_text","contents":"Why? In vanilla, mobs do not spawn if a player is within a 24-block radius (spherical)"},"hover_event":{"action":"show_text","value":"Why? In vanilla, mobs do not spawn if a player is within a 24-block radius (spherical)"}}] function #spawnanimations:settings diff --git a/data/spawnanimations/functions/internal/entity/ehs/hide_exec.mcfunction b/data/spawnanimations/functions/internal/entity/ehs/hide_exec.mcfunction index d550418..3dc1bd5 100644 --- a/data/spawnanimations/functions/internal/entity/ehs/hide_exec.mcfunction +++ b/data/spawnanimations/functions/internal/entity/ehs/hide_exec.mcfunction @@ -10,3 +10,4 @@ execute if score $hide_armor ts.sa.settings matches 1..2 as @s[type=#spawnanimat # Entity specific execute if entity @s[type=minecraft:creeper] run function spawnanimations:internal/entity/ehs/entity_specific/creeper/hide +execute if entity @s[type=#spawnanimations:has_emissive_layer] run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/hide diff --git a/data/spawnanimations/functions/internal/entity/ehs/unhide.mcfunction b/data/spawnanimations/functions/internal/entity/ehs/unhide.mcfunction index 04d2f60..1d47a1d 100644 --- a/data/spawnanimations/functions/internal/entity/ehs/unhide.mcfunction +++ b/data/spawnanimations/functions/internal/entity/ehs/unhide.mcfunction @@ -9,5 +9,6 @@ execute as @s[tag=ts.sa.ehs.saved] run function spawnanimations:internal/entity/ # Entity specific execute if entity @s[type=minecraft:creeper] run function spawnanimations:internal/entity/ehs/entity_specific/creeper/unhide +execute as @s[tag=ts.sa.ehs.shrunk] run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/unhide tag @s remove ts.sa.hidden diff --git a/data/spawnanimations/functions/internal/entity/unprotect.mcfunction b/data/spawnanimations/functions/internal/entity/unprotect.mcfunction index 49a065f..cd7745b 100644 --- a/data/spawnanimations/functions/internal/entity/unprotect.mcfunction +++ b/data/spawnanimations/functions/internal/entity/unprotect.mcfunction @@ -1,6 +1,6 @@ ##by Tschipcraft -data merge entity @s {Fire:0s,FallDistance:0f} +execute unless block ~ ~-0.5 ~ #spawnanimations:nonsolid run data merge entity @s {Fire:0s,FallDistance:0f} execute if score @s ts.sa.e.nbt.Inv matches 0 run data merge entity @s {Invulnerable:0b} scoreboard players reset @s ts.sa.e.nbt.Inv execute if score @s ts.sa.e.nbt.Sil matches 0 run data merge entity @s {Silent:0b} diff --git a/data/spawnanimations/functions/loop.mcfunction b/data/spawnanimations/functions/loop.mcfunction index aba0b9d..6affcba 100644 --- a/data/spawnanimations/functions/loop.mcfunction +++ b/data/spawnanimations/functions/loop.mcfunction @@ -6,12 +6,16 @@ schedule function spawnanimations:loop 5t ## Supply invisibility to hidden entities execute as @e[type=!#spawnanimations:exclude,tag=ts.sa.to_verify,tag=!smithed.strict,tag=!ignore.global] run function spawnanimations:internal/entity/ehs/supply_invisibility -## Check for old format (post-1.20.5) +## Check for old save format (post-1.20.5) function spawnanimations:internal/entity/ehs/check_for_old_v0_format ## Validate hidden entities +# Check save format validity execute as @e[type=#spawnanimations:can_wear_armor,tag=ts.sa.to_verify,tag=ts.sa.ehs.saved] unless predicate spawnanimations:validate at @s run function spawnanimations:internal/entity/ehs/conflict/evaluate +# Escape protection for shrunk entities +execute as @e[type=#spawnanimations:has_emissive_layer,tag=ts.sa.to_verify,tag=ts.sa.ehs.shrunk] at @s run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_enclosure + ## Remove problematic items execute as @e[type=minecraft:item,tag=!ts.sa.i.checked,tag=!global.ignore] run function spawnanimations:internal/entity/ehs/remove_invalid_item/check diff --git a/data/spawnanimations/functions/settings/vanilla.mcfunction b/data/spawnanimations/functions/settings/vanilla.mcfunction index 87a1320..6984709 100644 --- a/data/spawnanimations/functions/settings/vanilla.mcfunction +++ b/data/spawnanimations/functions/settings/vanilla.mcfunction @@ -2,4 +2,5 @@ tellraw @s ["",{"text":"\n-> Set activation mode to "},{"text":"[vanilla]","color":"yellow"}] scoreboard players set $activation_mode ts.sa.settings 0 +execute if score $activation_dist ts.sa.settings matches ..24 run tellraw @s ["",{"text":"â„č Info: ","color":"blue"},{"text":"It is recommended to set the activation distance to at least 25 blocks when using the vanilla activation mode to see the animation","hoverEvent":{"action":"show_text","contents":"Why? In vanilla, mobs do not spawn if a player is within a 24-block radius (spherical)"}}] function #spawnanimations:settings diff --git a/data/spawnanimations/predicate/attacking.json b/data/spawnanimations/predicate/attacking.json index 296bc70..49336e1 100644 --- a/data/spawnanimations/predicate/attacking.json +++ b/data/spawnanimations/predicate/attacking.json @@ -4,8 +4,8 @@ "predicate": { "targeted_entity": { "distance": { - "absolute": { - "max": 3 + "horizontal": { + "max": 3.5 } } } diff --git a/data/spawnanimations/predicates/attacking.json b/data/spawnanimations/predicates/attacking.json index 296bc70..49336e1 100644 --- a/data/spawnanimations/predicates/attacking.json +++ b/data/spawnanimations/predicates/attacking.json @@ -4,8 +4,8 @@ "predicate": { "targeted_entity": { "distance": { - "absolute": { - "max": 3 + "horizontal": { + "max": 3.5 } } } diff --git a/data/spawnanimations/tags/entity_type/has_emissive_layer.json b/data/spawnanimations/tags/entity_type/has_emissive_layer.json new file mode 100644 index 0000000..63e7315 --- /dev/null +++ b/data/spawnanimations/tags/entity_type/has_emissive_layer.json @@ -0,0 +1,9 @@ +{ + "//comment": "Entities specified here have an emissive layer which will not vanish with the invisibility effect. Instead, they will be shrunk to 6.25% of their size to become invisible to players.", + "replace": false, + "values": [ + "minecraft:spider", + "minecraft:cave_spider", + "minecraft:enderman" + ] +} diff --git a/data/spawnanimations/tags/entity_types/has_emissive_layer.json b/data/spawnanimations/tags/entity_types/has_emissive_layer.json new file mode 100644 index 0000000..63e7315 --- /dev/null +++ b/data/spawnanimations/tags/entity_types/has_emissive_layer.json @@ -0,0 +1,9 @@ +{ + "//comment": "Entities specified here have an emissive layer which will not vanish with the invisibility effect. Instead, they will be shrunk to 6.25% of their size to become invisible to players.", + "replace": false, + "values": [ + "minecraft:spider", + "minecraft:cave_spider", + "minecraft:enderman" + ] +} diff --git a/overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/hide.mcfunction b/overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/hide.mcfunction new file mode 100644 index 0000000..b9d4520 --- /dev/null +++ b/overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/hide.mcfunction @@ -0,0 +1,12 @@ +##by Tschipcraft +# Shrinks entities with an emissive layer to lowest possible scale (0.0625) +# We do this using a negative scale modifier to not disturb the base scale value + +attribute @s minecraft:generic.scale modifier add b3b6680a-c78e-4476-88b1-c21017dd4ecc spawnanimations.ehs.scale -1000000000000000000000000000000 add_value +tag @s add ts.sa.ehs.shrunk + +# Save initial position +data modify storage spawnanimations:temp Pos set from entity @s Pos +execute store result score @s ts.sa.prev_x run data get storage spawnanimations:temp Pos[0] 10 +execute store result score @s ts.sa.prev_y run data get storage spawnanimations:temp Pos[1] 10 +execute store result score @s ts.sa.prev_z run data get storage spawnanimations:temp Pos[2] 10 diff --git a/overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance.mcfunction b/overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance.mcfunction new file mode 100644 index 0000000..24e425f --- /dev/null +++ b/overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance.mcfunction @@ -0,0 +1,32 @@ +##by Tschipcraft +# Shrunk entity @s is trying to escape an enclosure, when not to far away from its previous position we move it back + +# Get current position +data modify storage spawnanimations:temp Pos set from entity @s Pos +execute store result score #current ts.sa.prev_x run data get storage spawnanimations:temp Pos[0] 10 +execute store result score #current ts.sa.prev_y run data get storage spawnanimations:temp Pos[1] 10 +execute store result score #current ts.sa.prev_z run data get storage spawnanimations:temp Pos[2] 10 + +scoreboard players operation #previous ts.sa.prev_x = @s ts.sa.prev_x +scoreboard players operation #previous ts.sa.prev_y = @s ts.sa.prev_y +scoreboard players operation #previous ts.sa.prev_z = @s ts.sa.prev_z + +# Calculate diff +scoreboard players operation #previous ts.sa.prev_x -= #current ts.sa.prev_x +scoreboard players operation #previous ts.sa.prev_y -= #current ts.sa.prev_y +scoreboard players operation #previous ts.sa.prev_z -= #current ts.sa.prev_z + +# Make sure value is positive +execute if score #previous ts.sa.prev_x matches ..0 run scoreboard players operation #previous ts.sa.prev_x *= #minus ts.sa.x +execute if score #previous ts.sa.prev_y matches ..0 run scoreboard players operation #previous ts.sa.prev_y *= #minus ts.sa.x +execute if score #previous ts.sa.prev_z matches ..0 run scoreboard players operation #previous ts.sa.prev_z *= #minus ts.sa.x + +# Add distances together +scoreboard players operation #previous ts.sa.prev_x += #previous ts.sa.prev_y +scoreboard players operation #previous ts.sa.prev_x += #previous ts.sa.prev_z + +# Move entity back to previous location if it moved not too far (distance times 10) +execute if score #previous ts.sa.prev_x matches ..30 run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/move_back + +# Trigger animation any way +function spawnanimations:internal/animation/dig_up/start diff --git a/overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_enclosure.mcfunction b/overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_enclosure.mcfunction new file mode 100644 index 0000000..295fa4e --- /dev/null +++ b/overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_enclosure.mcfunction @@ -0,0 +1,28 @@ +##by Tschipcraft +# Checks if shrunk entity @s is trying to escape a potential enclosure + +# Inside block +execute unless block ~ ~ ~ #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance + +# Model default enderman hitbox size +execute as @s[type=minecraft:enderman,tag=ts.sa.to_verify] unless block ^0.3 ^1.5 ^0.3 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:enderman,tag=ts.sa.to_verify] unless block ^0.3 ^1.5 ^-0.3 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:enderman,tag=ts.sa.to_verify] unless block ^-0.3 ^1.5 ^0.3 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:enderman,tag=ts.sa.to_verify] unless block ^-0.3 ^1.5 ^-0.3 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:enderman,tag=ts.sa.to_verify] unless block ^0.3 ^2.9 ^0.3 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:enderman,tag=ts.sa.to_verify] unless block ^0.3 ^2.9 ^-0.3 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:enderman,tag=ts.sa.to_verify] unless block ^-0.3 ^2.9 ^0.3 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:enderman,tag=ts.sa.to_verify] unless block ^-0.3 ^2.9 ^-0.3 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance + +# Model default spider hitbox size +execute as @s[type=minecraft:spider,tag=ts.sa.to_verify] unless block ~0.7 ~ ~0.7 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:spider,tag=ts.sa.to_verify] unless block ~0.7 ~ ~-0.7 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:spider,tag=ts.sa.to_verify] unless block ~-0.7 ~ ~-0.7 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:spider,tag=ts.sa.to_verify] unless block ~-0.7 ~ ~0.7 #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance +execute as @s[type=minecraft:spider,tag=ts.sa.to_verify] unless block ~ ~0.9 ~ #spawnanimations:nonsolid run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/check_distance + +# Update position +execute if entity @s[tag=ts.sa.to_verify] run data modify storage spawnanimations:temp Pos set from entity @s Pos +execute if entity @s[tag=ts.sa.to_verify] store result score @s ts.sa.prev_x run data get storage spawnanimations:temp Pos[0] 10 +execute if entity @s[tag=ts.sa.to_verify] store result score @s ts.sa.prev_y run data get storage spawnanimations:temp Pos[1] 10 +execute if entity @s[tag=ts.sa.to_verify] store result score @s ts.sa.prev_z run data get storage spawnanimations:temp Pos[2] 10 diff --git a/overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/move_back.mcfunction b/overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/move_back.mcfunction new file mode 100644 index 0000000..1b3a623 --- /dev/null +++ b/overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/prevent_enclosure_breach/move_back.mcfunction @@ -0,0 +1,6 @@ +##by Tschipcraft + +# Move back to previous position +execute store result entity @s Pos[0] double 0.1 run scoreboard players get @s ts.sa.prev_x +execute store result entity @s Pos[1] double 0.1 run scoreboard players get @s ts.sa.prev_y +execute store result entity @s Pos[2] double 0.1 run scoreboard players get @s ts.sa.prev_z diff --git a/overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/unhide.mcfunction b/overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/unhide.mcfunction new file mode 100644 index 0000000..fb813ad --- /dev/null +++ b/overlay_33/data/spawnanimations/functions/internal/entity/ehs/entity_specific/emissive_layer/unhide.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft +# Resets entities with an emissive layer that got their scale changed + +attribute @s minecraft:generic.scale modifier remove b3b6680a-c78e-4476-88b1-c21017dd4ecc +tag @s remove ts.sa.ehs.shrunk diff --git a/overlay_pre_49/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/hide.mcfunction b/overlay_pre_49/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/hide.mcfunction new file mode 100644 index 0000000..8dce29e --- /dev/null +++ b/overlay_pre_49/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/hide.mcfunction @@ -0,0 +1,12 @@ +##by Tschipcraft +# Shrinks entities with an emissive layer to lowest possible scale (0.0625) +# We do this using a negative scale modifier to not disturb the base scale value + +attribute @s minecraft:generic.scale modifier add spawnanimations.ehs.scale -1000000000000000000000000000000 add_value +tag @s add ts.sa.ehs.shrunk + +# Save initial position +data modify storage spawnanimations:temp Pos set from entity @s Pos +execute store result score @s ts.sa.prev_x run data get storage spawnanimations:temp Pos[0] 10 +execute store result score @s ts.sa.prev_y run data get storage spawnanimations:temp Pos[1] 10 +execute store result score @s ts.sa.prev_z run data get storage spawnanimations:temp Pos[2] 10 diff --git a/overlay_pre_49/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/unhide.mcfunction b/overlay_pre_49/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/unhide.mcfunction new file mode 100644 index 0000000..82ba42c --- /dev/null +++ b/overlay_pre_49/data/spawnanimations/function/internal/entity/ehs/entity_specific/emissive_layer/unhide.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft +# Resets entities with an emissive layer that got their scale changed + +attribute @s minecraft:generic.scale modifier remove spawnanimations.ehs.scale +tag @s remove ts.sa.ehs.shrunk diff --git a/overlay_pre_49/overrides.impdoc b/overlay_pre_49/overrides.impdoc new file mode 100644 index 0000000..36cc03e --- /dev/null +++ b/overlay_pre_49/overrides.impdoc @@ -0,0 +1,4 @@ +@targets 24w21a..1.21.1 +@changes function calls + +- Attribute IDs have the old `generic.` prefix diff --git a/pack.mcmeta b/pack.mcmeta index 9902f78..8427626 100644 --- a/pack.mcmeta +++ b/pack.mcmeta @@ -19,6 +19,10 @@ "formats": [39,44], "directory": "overlay_39" }, + { + "formats": [45,48], + "directory": "overlay_pre_49" + }, { "formats": [45,62], "directory": "overlay_pre_63" From b3a5754f121bb9aa3f405c7abeda8472084d386a Mon Sep 17 00:00:00 2001 From: Tschipcraft <78470530+Tschipcraft@users.noreply.github.com> Date: Tue, 22 Jul 2025 19:40:28 +0200 Subject: [PATCH 3/7] Add Pehkui integration - Added Pehkui mod integration to fully hide entities by scaling them down. This is especially beneficial for mobs with emissive layers in 1.20.4 and below, as the previously used vanilla scale attribute doesn't yet exist there (#25) - Updated mod metadata to suggest Pehkui - Disabled Mecha command validation in the CI workflow upon push due to the now introduced non-vanilla commands --- .github/workflows/ci.yml | 10 +++++----- CHANGES.md | 5 +++-- META-INF/mods.toml | 10 +++++++++- META-INF/neoforge.mods.toml | 11 ++++++++++- .../function/internal/entity/ehs/hide.mcfunction | 3 +++ .../internal/entity/ehs/hide_exec.mcfunction | 2 +- .../function/internal/entity/ehs/unhide.mcfunction | 1 + .../functions/internal/entity/ehs/hide.mcfunction | 3 +++ .../internal/entity/ehs/hide_exec.mcfunction | 2 +- .../internal/entity/ehs/pehkui/hide.mcfunction | 10 ++++++++++ .../internal/entity/ehs/pehkui/unhide.mcfunction | 12 ++++++++++++ .../functions/internal/entity/ehs/unhide.mcfunction | 1 + fabric.mod.json | 3 +++ .../internal/entity/ehs/pehkui/hide.mcfunction | 10 ++++++++++ .../internal/entity/ehs/pehkui/unhide.mcfunction | 12 ++++++++++++ overlay_pre_49/overrides.impdoc | 1 + 16 files changed, 85 insertions(+), 11 deletions(-) create mode 100644 data/spawnanimations/functions/internal/entity/ehs/pehkui/hide.mcfunction create mode 100644 data/spawnanimations/functions/internal/entity/ehs/pehkui/unhide.mcfunction create mode 100644 overlay_pre_49/data/spawnanimations/function/internal/entity/ehs/pehkui/hide.mcfunction create mode 100644 overlay_pre_49/data/spawnanimations/function/internal/entity/ehs/pehkui/unhide.mcfunction diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b25aec1..cedc506 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,13 +17,13 @@ on: description: 'Set to true to skip command validation' required: false type: boolean - default: false + default: true env: # Fallback Lower: when Spyglass API is unreachable FALLBACK_MC_LOWER: "1.17" # Fallback Upper: when Spyglass API and Mojang API are unreachable - FALLBACK_MC_UPPER: "1.21.5" + FALLBACK_MC_UPPER: "1.21.8" jobs: deploy: @@ -189,9 +189,9 @@ jobs: echo " NeoForge range: $MACHINE_RANGE_NEOFORGE" echo " Validator version: $CMD_VALIDATOR_MC" - # Optionally validate commands + # Optionally validate commands (disabled by default upon push due to unrecognized Pehkui commands) - name: Validate commands - if: ${{ github.event.inputs.skip_check != 'true' }} + if: ${{ github.event.inputs.skip_check == 'false' }} uses: mcbeet/check-commands@v1 with: source: . @@ -310,6 +310,6 @@ jobs: ❌ Error
- The build v${{ env.TAG }} for mc${{ env.MC_HUMAN_VERSION_RANGE }} failed! Please check the action logs for details. + The build **v${{ env.TAG }}** for **Minecraft ${{ env.MC_HUMAN_VERSION_RANGE }}** failed! Please check the action logs for details. EOF fi diff --git a/CHANGES.md b/CHANGES.md index 4781081..cbe18de 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,7 +1,8 @@ - **Entities with emissive layers are now properly hidden** (Endermen, Spiders, and Cave Spiders) (closes [#25](https://github.com/Tschipcraft/spawnanimations/issues/25)) + - For this feature to work in Minecraft 1.20.4 and below, [Pehkui](https://modrinth.com/project/t5W7Jfwy) must be installed. Pehkui can still be installed in newer versions for smoother poof animations - Improved performance by refactoring entity activation distance calculations to bundle and cache position data retrieval calls, and updating batch activation logic (the whole data pack is now up to 1ms (~45%ish) faster per tick!) - Modified the attack predicate of the secondary dig-up requirements so that it disregards the Y-distance. This allows mobs to, for example, appear at the bottom of pillars, if a player decides to build up during the night - Added an activation distance recommendation message when using the vanilla activation mode - Fixed possibility for hidden falling mobs to lose their fall distance NBT when appearing -- Fixed v0 save format not correctly upgrading to v1 from 24w11a to 24w20a (affecting major releases 1.20.5 and 1.20.6) -- Improved armor save/resolve functions to include the vanishing curse enchantment in the root proxy chest item +- Fixed v0 save format not correctly upgrading to v1 from 24w11a to 24w20a, affecting major releases 1.20.5 and 1.20.6 +- Improved hide armor and tools option to include the vanishing curse enchantment in the root proxy chest item diff --git a/META-INF/mods.toml b/META-INF/mods.toml index 4ec05ef..ab07b1c 100644 --- a/META-INF/mods.toml +++ b/META-INF/mods.toml @@ -44,8 +44,16 @@ features={ java_version = "[17,)" } mandatory=false versionRange="[1.0,)" ordering="NONE" - side="BOTH" + side="SERVER" referralUrl="https://modrinth.com/mod/ofDka6PS/versions?l=forge" +[[dependencies.spawnanimations]] + modId="pehkui" + mandatory=false + versionRange="[3.4.0,)" + ordering="NONE" + side="BOTH" + referralUrl="https://modrinth.com/mod/t5W7Jfwy/versions?l=forge" + [modproperties.spawnanimations] catalogueItemIcon="minecraft:zombie_spawn_egg" diff --git a/META-INF/neoforge.mods.toml b/META-INF/neoforge.mods.toml index fc655b9..8473b70 100644 --- a/META-INF/neoforge.mods.toml +++ b/META-INF/neoforge.mods.toml @@ -45,9 +45,18 @@ features={ java_version = "[21,)" } type="optional" versionRange="[1.0,)" ordering="NONE" - side="BOTH" + side="SERVER" referralUrl="https://modrinth.com/mod/ofDka6PS/versions?l=neoforge" reason="Compatibility with other mods" +[[dependencies.spawnanimations]] + modId="pehkui" + type="optional" + versionRange="[3.4.0,)" + ordering="NONE" + side="BOTH" + referralUrl="https://modrinth.com/mod/t5W7Jfwy/versions?l=neoforge" + reason="Completely hiding entities with an emissive layer" + [modproperties.spawnanimations] catalogueItemIcon="minecraft:zombie_spawn_egg" diff --git a/data/spawnanimations/function/internal/entity/ehs/hide.mcfunction b/data/spawnanimations/function/internal/entity/ehs/hide.mcfunction index afc7988..8c19f6a 100644 --- a/data/spawnanimations/function/internal/entity/ehs/hide.mcfunction +++ b/data/spawnanimations/function/internal/entity/ehs/hide.mcfunction @@ -7,3 +7,6 @@ execute store result score @s ts.sa.e.nbt.Sil run data get entity @s Silent execute if score @s ts.sa.e.nbt.Sil matches 0 run data merge entity @s {Silent:1b} tag @s add ts.sa.to_hide effect give @s invisibility 10 0 true + +# Pehkui integration (overlay_pre_49) +function spawnanimations:internal/entity/ehs/pehkui/hide diff --git a/data/spawnanimations/function/internal/entity/ehs/hide_exec.mcfunction b/data/spawnanimations/function/internal/entity/ehs/hide_exec.mcfunction index 3dc1bd5..8bd5acd 100644 --- a/data/spawnanimations/function/internal/entity/ehs/hide_exec.mcfunction +++ b/data/spawnanimations/function/internal/entity/ehs/hide_exec.mcfunction @@ -10,4 +10,4 @@ execute if score $hide_armor ts.sa.settings matches 1..2 as @s[type=#spawnanimat # Entity specific execute if entity @s[type=minecraft:creeper] run function spawnanimations:internal/entity/ehs/entity_specific/creeper/hide -execute if entity @s[type=#spawnanimations:has_emissive_layer] run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/hide +execute if entity @s[type=#spawnanimations:has_emissive_layer,tag=!ts.sa.ehs.pehkui.shrunk] run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/hide diff --git a/data/spawnanimations/function/internal/entity/ehs/unhide.mcfunction b/data/spawnanimations/function/internal/entity/ehs/unhide.mcfunction index 1d47a1d..3f8e32b 100644 --- a/data/spawnanimations/function/internal/entity/ehs/unhide.mcfunction +++ b/data/spawnanimations/function/internal/entity/ehs/unhide.mcfunction @@ -10,5 +10,6 @@ execute as @s[tag=ts.sa.ehs.saved] run function spawnanimations:internal/entity/ # Entity specific execute if entity @s[type=minecraft:creeper] run function spawnanimations:internal/entity/ehs/entity_specific/creeper/unhide execute as @s[tag=ts.sa.ehs.shrunk] run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/unhide +execute as @s[tag=ts.sa.ehs.pehkui.shrunk] run function spawnanimations:internal/entity/ehs/pehkui/unhide tag @s remove ts.sa.hidden diff --git a/data/spawnanimations/functions/internal/entity/ehs/hide.mcfunction b/data/spawnanimations/functions/internal/entity/ehs/hide.mcfunction index afc7988..6572cdf 100644 --- a/data/spawnanimations/functions/internal/entity/ehs/hide.mcfunction +++ b/data/spawnanimations/functions/internal/entity/ehs/hide.mcfunction @@ -7,3 +7,6 @@ execute store result score @s ts.sa.e.nbt.Sil run data get entity @s Silent execute if score @s ts.sa.e.nbt.Sil matches 0 run data merge entity @s {Silent:1b} tag @s add ts.sa.to_hide effect give @s invisibility 10 0 true + +# Pehkui integration +function spawnanimations:internal/entity/ehs/pehkui/hide diff --git a/data/spawnanimations/functions/internal/entity/ehs/hide_exec.mcfunction b/data/spawnanimations/functions/internal/entity/ehs/hide_exec.mcfunction index 3dc1bd5..8bd5acd 100644 --- a/data/spawnanimations/functions/internal/entity/ehs/hide_exec.mcfunction +++ b/data/spawnanimations/functions/internal/entity/ehs/hide_exec.mcfunction @@ -10,4 +10,4 @@ execute if score $hide_armor ts.sa.settings matches 1..2 as @s[type=#spawnanimat # Entity specific execute if entity @s[type=minecraft:creeper] run function spawnanimations:internal/entity/ehs/entity_specific/creeper/hide -execute if entity @s[type=#spawnanimations:has_emissive_layer] run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/hide +execute if entity @s[type=#spawnanimations:has_emissive_layer,tag=!ts.sa.ehs.pehkui.shrunk] run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/hide diff --git a/data/spawnanimations/functions/internal/entity/ehs/pehkui/hide.mcfunction b/data/spawnanimations/functions/internal/entity/ehs/pehkui/hide.mcfunction new file mode 100644 index 0000000..2ffe0d1 --- /dev/null +++ b/data/spawnanimations/functions/internal/entity/ehs/pehkui/hide.mcfunction @@ -0,0 +1,10 @@ +##by Tschipcraft +# Shrinks entities with an emissive layer to lower scale + +scale delay set pehkui:model_width 0 @s +scale delay set pehkui:model_height 0 @s + +scale set pehkui:model_width 0.0001 @s +scale set pehkui:model_height 0.0001 @s + +tag @s add ts.sa.ehs.pehkui.shrunk diff --git a/data/spawnanimations/functions/internal/entity/ehs/pehkui/unhide.mcfunction b/data/spawnanimations/functions/internal/entity/ehs/pehkui/unhide.mcfunction new file mode 100644 index 0000000..0ab36e8 --- /dev/null +++ b/data/spawnanimations/functions/internal/entity/ehs/pehkui/unhide.mcfunction @@ -0,0 +1,12 @@ +##by Tschipcraft +# Resets entities with an emissive layer that got their scale changed + +scale delay set pehkui:model_width 10 @s +scale delay set pehkui:model_height 10 @s +scale easing set pehkui:model_width pehkui:quadratic_in_out @s +scale easing set pehkui:model_height pehkui:quadratic_in_out @s + +scale set pehkui:model_width 1 @s +scale set pehkui:model_height 1 @s + +tag @s remove ts.sa.ehs.pehkui.shrunk diff --git a/data/spawnanimations/functions/internal/entity/ehs/unhide.mcfunction b/data/spawnanimations/functions/internal/entity/ehs/unhide.mcfunction index 1d47a1d..3f8e32b 100644 --- a/data/spawnanimations/functions/internal/entity/ehs/unhide.mcfunction +++ b/data/spawnanimations/functions/internal/entity/ehs/unhide.mcfunction @@ -10,5 +10,6 @@ execute as @s[tag=ts.sa.ehs.saved] run function spawnanimations:internal/entity/ # Entity specific execute if entity @s[type=minecraft:creeper] run function spawnanimations:internal/entity/ehs/entity_specific/creeper/unhide execute as @s[tag=ts.sa.ehs.shrunk] run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/unhide +execute as @s[tag=ts.sa.ehs.pehkui.shrunk] run function spawnanimations:internal/entity/ehs/pehkui/unhide tag @s remove ts.sa.hidden diff --git a/fabric.mod.json b/fabric.mod.json index 4905d80..2ca6511 100644 --- a/fabric.mod.json +++ b/fabric.mod.json @@ -31,6 +31,9 @@ "midnightlib": "*", "mr_spawn_animationscompats": "*" }, + "suggests": { + "pehkui": ">=3.4.0" + }, "custom": { "modmenu": { "links": { diff --git a/overlay_pre_49/data/spawnanimations/function/internal/entity/ehs/pehkui/hide.mcfunction b/overlay_pre_49/data/spawnanimations/function/internal/entity/ehs/pehkui/hide.mcfunction new file mode 100644 index 0000000..2ffe0d1 --- /dev/null +++ b/overlay_pre_49/data/spawnanimations/function/internal/entity/ehs/pehkui/hide.mcfunction @@ -0,0 +1,10 @@ +##by Tschipcraft +# Shrinks entities with an emissive layer to lower scale + +scale delay set pehkui:model_width 0 @s +scale delay set pehkui:model_height 0 @s + +scale set pehkui:model_width 0.0001 @s +scale set pehkui:model_height 0.0001 @s + +tag @s add ts.sa.ehs.pehkui.shrunk diff --git a/overlay_pre_49/data/spawnanimations/function/internal/entity/ehs/pehkui/unhide.mcfunction b/overlay_pre_49/data/spawnanimations/function/internal/entity/ehs/pehkui/unhide.mcfunction new file mode 100644 index 0000000..0ab36e8 --- /dev/null +++ b/overlay_pre_49/data/spawnanimations/function/internal/entity/ehs/pehkui/unhide.mcfunction @@ -0,0 +1,12 @@ +##by Tschipcraft +# Resets entities with an emissive layer that got their scale changed + +scale delay set pehkui:model_width 10 @s +scale delay set pehkui:model_height 10 @s +scale easing set pehkui:model_width pehkui:quadratic_in_out @s +scale easing set pehkui:model_height pehkui:quadratic_in_out @s + +scale set pehkui:model_width 1 @s +scale set pehkui:model_height 1 @s + +tag @s remove ts.sa.ehs.pehkui.shrunk diff --git a/overlay_pre_49/overrides.impdoc b/overlay_pre_49/overrides.impdoc index 36cc03e..b603f70 100644 --- a/overlay_pre_49/overrides.impdoc +++ b/overlay_pre_49/overrides.impdoc @@ -2,3 +2,4 @@ @changes function calls - Attribute IDs have the old `generic.` prefix +- Pehkui integration (no port to newer versions exists yet) From ec3b495a2fd654ca95c86809d194e522980bb051 Mon Sep 17 00:00:00 2001 From: Tschipcraft <78470530+Tschipcraft@users.noreply.github.com> Date: Thu, 24 Jul 2025 18:16:12 +0200 Subject: [PATCH 4/7] Add settings for poof animation, sounds, and emissive layers - Added config options to enable/disable poof animation (#40), animation sounds (closes #39), and hiding emissive mob layers - Added partial support for Pehkui <3.4.0 --- CHANGES.md | 1 + assets/spawnanimations/lang/en_us.json | 20 +++++--- .../animation/dig_up/sound/sound.mcfunction | 4 +- .../animation/dig_up/sound/sound2.mcfunction | 4 +- .../animation/dig_up/verify_in_air.mcfunction | 5 +- .../internal/entity/ehs/hide.mcfunction | 2 +- .../internal/entity/ehs/hide_exec.mcfunction | 2 +- .../function/settings/classic.mcfunction | 2 +- .../function/settings/core.mcfunction | 44 ++++++++++++------ .../function/settings/defaults.mcfunction | 3 ++ .../disable_allblocksupport.mcfunction | 2 +- .../disable_hidearmorandtools.mcfunction | 3 +- .../settings/disable_hideemissive.mcfunction | 7 +++ .../settings/disable_playsounds.mcfunction | 5 ++ .../settings/disable_poofanim.mcfunction | 5 ++ .../enable_allblocksupport.mcfunction | 2 +- .../enable_hidearmorandtools.mcfunction | 3 +- .../settings/enable_hideemissive.mcfunction | 6 +++ .../settings/enable_playsounds.mcfunction | 5 ++ .../settings/enable_poofanim.mcfunction | 5 ++ .../function/settings/vanilla.mcfunction | 4 +- .../animation/dig_up/sound/sound.mcfunction | 4 +- .../animation/dig_up/sound/sound2.mcfunction | 4 +- .../animation/dig_up/verify_in_air.mcfunction | 5 +- .../internal/entity/ehs/hide.mcfunction | 2 +- .../internal/entity/ehs/hide_exec.mcfunction | 2 +- .../entity/ehs/pehkui/hide.mcfunction | 2 +- .../entity/ehs/pehkui/set_easing.mcfunction | 5 ++ .../entity/ehs/pehkui/unhide.mcfunction | 5 +- .../functions/settings/classic.mcfunction | 2 +- .../functions/settings/core.mcfunction | 44 ++++++++++++------ .../functions/settings/defaults.mcfunction | 3 ++ .../disable_allblocksupport.mcfunction | 2 +- .../disable_hidearmorandtools.mcfunction | 3 +- .../settings/disable_hideemissive.mcfunction | 7 +++ .../settings/disable_playsounds.mcfunction | 5 ++ .../settings/disable_poofanim.mcfunction | 5 ++ .../enable_allblocksupport.mcfunction | 2 +- .../enable_hidearmorandtools.mcfunction | 3 +- .../settings/enable_hideemissive.mcfunction | 6 +++ .../settings/enable_playsounds.mcfunction | 5 ++ .../settings/enable_poofanim.mcfunction | 5 ++ .../functions/settings/vanilla.mcfunction | 4 +- fabric.mod.json | 9 ++-- .../spawnanimations/fabric/Config.class | Bin 1571 -> 1766 bytes .../spawnanimations/fabric/sendConfig.class | Bin 3912 -> 5340 bytes .../spawnanimations/forge/Config.class | Bin 1591 -> 1786 bytes .../spawnanimations/forge/sendConfig.class | Bin 4120 -> 5548 bytes .../spawnanimations/neoforge/Config.class | Bin 1609 -> 1804 bytes .../spawnanimations/neoforge/sendConfig.class | Bin 4163 -> 5591 bytes .../entity/ehs/pehkui/hide.mcfunction | 2 +- .../entity/ehs/pehkui/unhide.mcfunction | 2 +- .../function/settings/core.mcfunction | 44 ++++++++++++------ .../spawnanimations/fabric/Config.java | 6 +++ .../spawnanimations/fabric/sendConfig.java | 25 +++++++++- .../spawnanimations/forge/Config.java | 6 +++ .../spawnanimations/forge/sendConfig.java | 25 +++++++++- .../spawnanimations/neoforge/Config.java | 6 +++ .../spawnanimations/neoforge/sendConfig.java | 25 +++++++++- wiki/settings.svg | 13 ++++-- 60 files changed, 326 insertions(+), 96 deletions(-) create mode 100644 data/spawnanimations/function/settings/disable_hideemissive.mcfunction create mode 100644 data/spawnanimations/function/settings/disable_playsounds.mcfunction create mode 100644 data/spawnanimations/function/settings/disable_poofanim.mcfunction create mode 100644 data/spawnanimations/function/settings/enable_hideemissive.mcfunction create mode 100644 data/spawnanimations/function/settings/enable_playsounds.mcfunction create mode 100644 data/spawnanimations/function/settings/enable_poofanim.mcfunction create mode 100644 data/spawnanimations/functions/internal/entity/ehs/pehkui/set_easing.mcfunction create mode 100644 data/spawnanimations/functions/settings/disable_hideemissive.mcfunction create mode 100644 data/spawnanimations/functions/settings/disable_playsounds.mcfunction create mode 100644 data/spawnanimations/functions/settings/disable_poofanim.mcfunction create mode 100644 data/spawnanimations/functions/settings/enable_hideemissive.mcfunction create mode 100644 data/spawnanimations/functions/settings/enable_playsounds.mcfunction create mode 100644 data/spawnanimations/functions/settings/enable_poofanim.mcfunction diff --git a/CHANGES.md b/CHANGES.md index cbe18de..2487374 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,6 @@ - **Entities with emissive layers are now properly hidden** (Endermen, Spiders, and Cave Spiders) (closes [#25](https://github.com/Tschipcraft/spawnanimations/issues/25)) - For this feature to work in Minecraft 1.20.4 and below, [Pehkui](https://modrinth.com/project/t5W7Jfwy) must be installed. Pehkui can still be installed in newer versions for smoother poof animations +- Added config options to enable/disable poof animation ([#40](https://github.com/Tschipcraft/spawnanimations/issues/40)), animation sounds (closes [#39](https://github.com/Tschipcraft/spawnanimations/issues/39)), and hiding emissive mob layers - Improved performance by refactoring entity activation distance calculations to bundle and cache position data retrieval calls, and updating batch activation logic (the whole data pack is now up to 1ms (~45%ish) faster per tick!) - Modified the attack predicate of the secondary dig-up requirements so that it disregards the Y-distance. This allows mobs to, for example, appear at the bottom of pillars, if a player decides to build up during the night - Added an activation distance recommendation message when using the vanilla activation mode diff --git a/assets/spawnanimations/lang/en_us.json b/assets/spawnanimations/lang/en_us.json index 5065595..8049d38 100644 --- a/assets/spawnanimations/lang/en_us.json +++ b/assets/spawnanimations/lang/en_us.json @@ -5,11 +5,11 @@ "spawnanimations.midnightconfig.title": "Spawn Animations Configuration", "spawnanimations.midnightconfig.empty": "", - "spawnanimations.midnightconfig.configure_ingame": "§dâ„č Info:§r§f To configure this data pack on a world-to-world basis,", + "spawnanimations.midnightconfig.configure_ingame": "§dâ„č Info:§f To configure this data pack on a world-to-world basis,", "spawnanimations.midnightconfig.configure_ingame2": "join a world and execute the command §o/function spawnanimations:settings§r.", "spawnanimations.midnightconfig.empty2": "", "spawnanimations.midnightconfig.global_settings": "§n§l-=- Global Settings -=-", - "spawnanimations.midnightconfig.info": "§dâ„č Info:§r§f These settings will be applied globally to all worlds.", + "spawnanimations.midnightconfig.info": "§dâ„č Info:§f These settings will be applied globally to all worlds.", "spawnanimations.midnightconfig.info2": "Please make sure to rejoin any world for the global settings to take effect.", "spawnanimations.midnightconfig.empty3": "", "spawnanimations.midnightconfig.empty4": "", @@ -17,11 +17,17 @@ "spawnanimations.midnightconfig.activation_distance": "Activation Distance", "spawnanimations.midnightconfig.activation_distance.tooltip": "Default: §a20 blocks§f\nMobs closer to a player than this value will play the animation.\nSetting this to 0 will use the world-specific value.", "spawnanimations.midnightconfig.activation_mode": "Activation Mode", - "spawnanimations.midnightconfig.activation_mode.tooltip": "Default: §aClassic§f\n§nClassic§r: Out of range mobs will stay hidden until a player is in range\n§nVanilla§r: Out of range mobs will spawn normally\nWhen set to Vanilla, it is recommended to set the activation distance to at least 25 blocks to see the animation", - "spawnanimations.midnightconfig.hide_worn_armor_and_tools": "Hide worn armor and tools", - "spawnanimations.midnightconfig.hide_worn_armor_and_tools.tooltip": "Default: §aYes§f\nIf enabled, stores the worn armor and tools in the feet and in some versions leggings slot of a hidden entity.\n§6⚠ Note: This may impact worn armor and tool drop rates from farms when enabled.", - "spawnanimations.midnightconfig.play_animation_on_unsupported_blocks": "Play block break animation on unsupported blocks", - "spawnanimations.midnightconfig.play_animation_on_unsupported_blocks.tooltip": "Default: §cNo§f\nIf enabled, plays a block breaking animation even on blocks that are not hard-coded into the data pack.\n§6⚠ Note: This could lead to unwanted block updates when enabled.", + "spawnanimations.midnightconfig.activation_mode.tooltip": "Default: §aClassic§f\n§nClassic§r: Mobs outside the activation range remain hidden until a player is in range.\n§nVanilla§r: Mobs outside the activation range spawn normally.\n§9â„č Info:§f When set to Vanilla, it is recommended to set the activation distance to at least 25 blocks to see the animation.", + "spawnanimations.midnightconfig.enable_poof_animation": "Enable Poof Animation", + "spawnanimations.midnightconfig.enable_poof_animation.tooltip": "Default: §aYes§f\nIf enabled, some mobs, or mobs without a block to dig up from, will play the poof animation instead.", + "spawnanimations.midnightconfig.play_animation_sounds": "Play Animation Sounds", + "spawnanimations.midnightconfig.play_animation_sounds.tooltip": "Default: §aYes§f\nIf enabled, sounds will be played during the animation.", + "spawnanimations.midnightconfig.hide_worn_armor_and_tools": "Hide Worn Armor and Tools", + "spawnanimations.midnightconfig.hide_worn_armor_and_tools.tooltip": "Default: §aYes§f\nIf enabled, worn armor and tools are stored in the body, feet, or in some versions, leggings slot of a hidden entity.\n§6⚠ Note: This may impact worn armor and tool drop rates from mob farms when enabled.", + "spawnanimations.midnightconfig.hide_emissive_mob_layers": "Hide Emissive Mob Layers", + "spawnanimations.midnightconfig.hide_emissive_mob_layers.tooltip": "Default: §aYes§f\nIf enabled, emissive layers of some mobs (e.g., Endermen, Spiders, and Cave Spiders), or with Pehkui all mobs, will be hidden by shrinking them.\nRequires Pehkui to be installed in Minecraft 1.20.4 and below.\n§6⚠ Note: This may decrease the efficiency of mob farms due to the changed hitbox size for hidden entities when Pehkui is §nnot§r installed and the feature is enabled.", + "spawnanimations.midnightconfig.play_animation_on_unsupported_blocks": "Play Block Break Animation on Unsupported Blocks", + "spawnanimations.midnightconfig.play_animation_on_unsupported_blocks.tooltip": "Default: §cNo§f\nIf enabled, the block breaking animation plays on blocks not explicitly supported by Spawn Animations.\n§6⚠ Note: This could lead to unwanted block updates when enabled.", "spawnanimations.midnightconfig.enum.bool.WORLD": "§bWorld-Specific", "spawnanimations.midnightconfig.enum.bool.YES": "§a[✔] Yes", diff --git a/data/spawnanimations/function/internal/animation/dig_up/sound/sound.mcfunction b/data/spawnanimations/function/internal/animation/dig_up/sound/sound.mcfunction index 25cc2e8..0b265d6 100644 --- a/data/spawnanimations/function/internal/animation/dig_up/sound/sound.mcfunction +++ b/data/spawnanimations/function/internal/animation/dig_up/sound/sound.mcfunction @@ -1,7 +1,7 @@ ## by Tschipcraft -execute if block ~ ~ ~ #spawnanimations:supported run function spawnanimations:internal/animation/dig_up/sound/play_sound -execute if score $play_unsupport ts.sa.settings matches 1..2 unless block ~ ~ ~ #spawnanimations:supported unless block ~ ~ ~ #spawnanimations:nonsolid unless block ~ ~ ~ minecraft:bedrock unless block ~ ~ ~ minecraft:air run function spawnanimations:internal/animation/dig_up/sound/support +execute if score $play_sounds ts.sa.settings matches 1..2 if block ~ ~ ~ #spawnanimations:supported run function spawnanimations:internal/animation/dig_up/sound/play_sound +execute if score $play_sounds ts.sa.settings matches 1..2 if score $play_unsupport ts.sa.settings matches 1..2 unless block ~ ~ ~ #spawnanimations:supported unless block ~ ~ ~ #spawnanimations:nonsolid unless block ~ ~ ~ minecraft:bedrock unless block ~ ~ ~ minecraft:air run function spawnanimations:internal/animation/dig_up/sound/support # Update stage + adjust animation speed scoreboard players add @s ts.sa.e.stage 1 diff --git a/data/spawnanimations/function/internal/animation/dig_up/sound/sound2.mcfunction b/data/spawnanimations/function/internal/animation/dig_up/sound/sound2.mcfunction index c8fe564..8bd207d 100644 --- a/data/spawnanimations/function/internal/animation/dig_up/sound/sound2.mcfunction +++ b/data/spawnanimations/function/internal/animation/dig_up/sound/sound2.mcfunction @@ -1,7 +1,7 @@ ## by Tschipcraft -execute if block ~ ~ ~ #spawnanimations:supported run function spawnanimations:internal/animation/dig_up/sound/play_sound2 -execute if score $play_unsupport ts.sa.settings matches 1..2 unless block ~ ~ ~ #spawnanimations:supported unless block ~ ~ ~ #spawnanimations:nonsolid unless block ~ ~ ~ minecraft:bedrock unless block ~ ~ ~ minecraft:air run function spawnanimations:internal/animation/dig_up/sound/support +execute if score $play_sounds ts.sa.settings matches 1..2 if block ~ ~ ~ #spawnanimations:supported run function spawnanimations:internal/animation/dig_up/sound/play_sound2 +execute if score $play_sounds ts.sa.settings matches 1..2 if score $play_unsupport ts.sa.settings matches 1..2 unless block ~ ~ ~ #spawnanimations:supported unless block ~ ~ ~ #spawnanimations:nonsolid unless block ~ ~ ~ minecraft:bedrock unless block ~ ~ ~ minecraft:air run function spawnanimations:internal/animation/dig_up/sound/support scoreboard players reset @s ts.sa.e.stage scoreboard players reset @s ts.sa.e.speed diff --git a/data/spawnanimations/function/internal/animation/dig_up/verify_in_air.mcfunction b/data/spawnanimations/function/internal/animation/dig_up/verify_in_air.mcfunction index fea236c..36949b2 100644 --- a/data/spawnanimations/function/internal/animation/dig_up/verify_in_air.mcfunction +++ b/data/spawnanimations/function/internal/animation/dig_up/verify_in_air.mcfunction @@ -1,9 +1,10 @@ ## by Tschipcraft +# The "Poof" animation tag @s remove ts.sa.verify tag @s remove ts.sa.to_verify function spawnanimations:internal/entity/unhide function spawnanimations:internal/entity/unprotect -particle minecraft:spit ~ ~1 ~ 0 0.3 0 0.2 15 normal -playsound minecraft:entity.llama.spit hostile @a ~ ~ ~ 0.75 0 +execute if score $enable_poof_anim ts.sa.settings matches 1..2 run particle minecraft:spit ~ ~1 ~ 0 0.3 0 0.2 10 normal +execute if score $enable_poof_anim ts.sa.settings matches 1..2 if score $play_sounds ts.sa.settings matches 1..2 run playsound minecraft:entity.llama.spit hostile @a ~ ~ ~ 0.75 0 function spawnanimations:internal/animation/dig_up/verify diff --git a/data/spawnanimations/function/internal/entity/ehs/hide.mcfunction b/data/spawnanimations/function/internal/entity/ehs/hide.mcfunction index 8c19f6a..be88f28 100644 --- a/data/spawnanimations/function/internal/entity/ehs/hide.mcfunction +++ b/data/spawnanimations/function/internal/entity/ehs/hide.mcfunction @@ -9,4 +9,4 @@ tag @s add ts.sa.to_hide effect give @s invisibility 10 0 true # Pehkui integration (overlay_pre_49) -function spawnanimations:internal/entity/ehs/pehkui/hide +execute if score $hide_emissive ts.sa.settings matches 1..2 run function spawnanimations:internal/entity/ehs/pehkui/hide diff --git a/data/spawnanimations/function/internal/entity/ehs/hide_exec.mcfunction b/data/spawnanimations/function/internal/entity/ehs/hide_exec.mcfunction index 8bd5acd..990a992 100644 --- a/data/spawnanimations/function/internal/entity/ehs/hide_exec.mcfunction +++ b/data/spawnanimations/function/internal/entity/ehs/hide_exec.mcfunction @@ -10,4 +10,4 @@ execute if score $hide_armor ts.sa.settings matches 1..2 as @s[type=#spawnanimat # Entity specific execute if entity @s[type=minecraft:creeper] run function spawnanimations:internal/entity/ehs/entity_specific/creeper/hide -execute if entity @s[type=#spawnanimations:has_emissive_layer,tag=!ts.sa.ehs.pehkui.shrunk] run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/hide +execute if score $hide_emissive ts.sa.settings matches 1..2 if entity @s[type=#spawnanimations:has_emissive_layer,tag=!ts.sa.ehs.pehkui.shrunk] run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/hide diff --git a/data/spawnanimations/function/settings/classic.mcfunction b/data/spawnanimations/function/settings/classic.mcfunction index e7d6b85..9202210 100644 --- a/data/spawnanimations/function/settings/classic.mcfunction +++ b/data/spawnanimations/function/settings/classic.mcfunction @@ -1,5 +1,5 @@ ##by Tschipcraft -tellraw @s ["",{"text":"\n-> Set activation mode to "},{"text":"[classic]","color":"yellow"}] +tellraw @s ["",{"text":"\n-> Set Activation Mode to "},{"text":"[Classic]","color":"yellow"}] scoreboard players set $activation_mode ts.sa.settings 1 function #spawnanimations:settings diff --git a/data/spawnanimations/function/settings/core.mcfunction b/data/spawnanimations/function/settings/core.mcfunction index 4c417ca..4533879 100644 --- a/data/spawnanimations/function/settings/core.mcfunction +++ b/data/spawnanimations/function/settings/core.mcfunction @@ -7,20 +7,36 @@ execute unless score #lock_distance ts.sa.settings matches 1 if score $activatio execute unless score #lock_distance ts.sa.settings matches 1 if score $activation_dist ts.sa.settings matches 100.. run tellraw @s [{"text":"Activation Distance","bold":true,"hover_event":{"action":"show_text","value":[{"text":"Mobs closer to you than this value will play the animation"}]}},{"text":" "},{"text":"<<< ","color":"aqua","hover_event":{"action":"show_text","value":[{"text":"-1"}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/decrease"}},{"score":{"name":"$activation_dist","objective":"ts.sa.settings"},"color":"green","bold":true},{"text":" blocks","color":"green"},{"text":" >>>","color":"gray","hover_event":{"action":"show_text","value":[{"text":"Max is 100","color":"red"}]}},{"text":" [\u270e]","color":"gray","click_event":{"action":"suggest_command","command":"/scoreboard players set @s ts.sa.distance "},"hover_event":{"action":"show_text","value":"Edit"}}] execute if score #lock_distance ts.sa.settings matches 1 run tellraw @s [{"text":"Activation Distance <<< ","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}},{"score":{"name":"$activation_dist","objective":"ts.sa.settings"}},{"text":" blocks >>>"}] -execute if score $activation_mode ts.sa.settings matches 1 run tellraw @s ["",{"text":"Activation mode","bold":true},{"text":" "},{"text":"[>classic<]","color":"green","bold":true,"hover_event":{"action":"show_text","value":[{"text":"Out of range mobs will stay hidden until a player is in range."}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/classic"}},{"text":" | "},{"text":"[vanilla]","color":"red","hover_event":{"action":"show_text","value":[{"text":"Out of range mobs will spawn normally."}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/vanilla"}}] -execute if score $activation_mode ts.sa.settings matches 0 run tellraw @s ["",{"text":"Activation mode","bold":true},{"text":" "},{"text":"[classic]","color":"red","hover_event":{"action":"show_text","value":[{"text":"Out of range mobs will stay hidden until a player is in range."}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/classic"}},{"text":" | "},{"text":"[>vanilla<]","color":"green","bold":true,"hover_event":{"action":"show_text","value":[{"text":"Out of range mobs will spawn normally."}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/vanilla"}}] -execute if score $activation_mode ts.sa.settings matches -1 run tellraw @s [{"text":"Activation mode [classic] | [>vanilla<]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] -execute if score $activation_mode ts.sa.settings matches 2 run tellraw @s [{"text":"Activation mode [>classic<] | [vanilla]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] - -execute if score $hide_armor ts.sa.settings matches 1 run tellraw @s ["",{"text":"Hide worn armor and tools","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hover_event":{"action":"show_text","value":[{"text":"Worn armor and tools will be hidden. "},{"text":"\n⚠ Note: This feature may impact worn armor and tool drop rates inside farms.","color":"gold"}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/enable_hidearmorandtools"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hover_event":{"action":"show_text","value":"Worn armor and tools will not be hidden."},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/disable_hidearmorandtools"}}] -execute if score $hide_armor ts.sa.settings matches 0 run tellraw @s ["",{"text":"Hide worn armor and tools","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hover_event":{"action":"show_text","value":[{"text":"Worn armor and tools will be hidden. "},{"text":"\n⚠ Note: This feature may impact worn armor and tool drop rates inside farms.","color":"gold"}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/enable_hidearmorandtools"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hover_event":{"action":"show_text","value":"Worn armor and tools will not be hidden."},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/disable_hidearmorandtools"}}] -execute if score $hide_armor ts.sa.settings matches -1 run tellraw @s [{"text":"Hide worn armor and tools [✔] | [>❌<]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] -execute if score $hide_armor ts.sa.settings matches 2 run tellraw @s [{"text":"Hide worn armor and tools [>✔<] | [❌]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] - -execute if score $play_unsupport ts.sa.settings matches 1 run tellraw @s ["",{"text":"Play animation on unsupported blocks","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hover_event":{"action":"show_text","value":[{"text":"The block break animation is played on unsupported blocks. "},{"text":"\n⚠ Note: This could lead to unwanted block updates.","color":"gold"}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/enable_allblocksupport"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hover_event":{"action":"show_text","value":"The block break animation will not be played on unsupported blocks."},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/disable_allblocksupport"}}] -execute if score $play_unsupport ts.sa.settings matches 0 run tellraw @s ["",{"text":"Play animation on unsupported blocks","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hover_event":{"action":"show_text","value":[{"text":"The block break animation is played on unsupported blocks. "},{"text":"\n⚠ Note: This could lead to unwanted block updates.","color":"gold"}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/enable_allblocksupport"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hover_event":{"action":"show_text","value":"The block break animation will not be played on unsupported blocks."},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/disable_allblocksupport"}}] -execute if score $play_unsupport ts.sa.settings matches -1 run tellraw @s [{"text":"Play animation on unsupported blocks [✔] | [>❌<]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] -execute if score $play_unsupport ts.sa.settings matches 2 run tellraw @s [{"text":"Play animation on unsupported blocks [>✔<] | [❌]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $activation_mode ts.sa.settings matches 1 run tellraw @s ["",{"text":"Activation Mode","bold":true},{"text":" "},{"text":"[>Classic<]","color":"green","bold":true,"hover_event":{"action":"show_text","value":[{"text":"Mobs outside the activation range remain hidden until a player is in range."}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/classic"}},{"text":" | "},{"text":"[Vanilla]","color":"red","hover_event":{"action":"show_text","value":[{"text":"Mobs outside the activation range spawn normally."}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/vanilla"}}] +execute if score $activation_mode ts.sa.settings matches 0 run tellraw @s ["",{"text":"Activation Mode","bold":true},{"text":" "},{"text":"[Classic]","color":"red","hover_event":{"action":"show_text","value":[{"text":"Mobs outside the activation range remain hidden until a player is in range."}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/classic"}},{"text":" | "},{"text":"[>Vanilla<]","color":"green","bold":true,"hover_event":{"action":"show_text","value":[{"text":"Mobs outside the activation range spawn normally."}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/vanilla"}}] +execute if score $activation_mode ts.sa.settings matches -1 run tellraw @s [{"text":"Activation Mode [Classic] | [>Vanilla<]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $activation_mode ts.sa.settings matches 2 run tellraw @s [{"text":"Activation Mode [>Classic<] | [Vanilla]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] + +execute if score $enable_poof_anim ts.sa.settings matches 1 run tellraw @s ["",{"text":"Enable Poof Animation","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hover_event":{"action":"show_text","value":"If enabled, some mobs, or mobs without a block to dig up from, will play the poof animation instead."},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/enable_poofanim"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hover_event":{"action":"show_text","value":"Poof animation will not be played."},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/disable_poofanim"}}] +execute if score $enable_poof_anim ts.sa.settings matches 0 run tellraw @s ["",{"text":"Enable Poof Animation","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hover_event":{"action":"show_text","value":"If enabled, some mobs, or mobs without a block to dig up from, will play the poof animation instead."},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/enable_poofanim"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hover_event":{"action":"show_text","value":"Poof animation will not be played."},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/disable_poofanim"}}] +execute if score $enable_poof_anim ts.sa.settings matches -1 run tellraw @s [{"text":"Enable Poof Animation [✔] | [>❌<]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $enable_poof_anim ts.sa.settings matches 2 run tellraw @s [{"text":"Enable Poof Animation [>✔<] | [❌]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] + +execute if score $play_sounds ts.sa.settings matches 1 run tellraw @s ["",{"text":"Play Animation Sounds","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hover_event":{"action":"show_text","value":"If enabled, sounds will be played during the animation."},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/enable_playsounds"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hover_event":{"action":"show_text","value":"Sounds will not be played."},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/disable_playsounds"}}] +execute if score $play_sounds ts.sa.settings matches 0 run tellraw @s ["",{"text":"Play Animation Sounds","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hover_event":{"action":"show_text","value":"If enabled, sounds will be played during the animation."},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/enable_playsounds"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hover_event":{"action":"show_text","value":"Sounds will not be played."},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/disable_playsounds"}}] +execute if score $play_sounds ts.sa.settings matches -1 run tellraw @s [{"text":"Play Animation Sounds [✔] | [>❌<]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $play_sounds ts.sa.settings matches 2 run tellraw @s [{"text":"Play Animation Sounds [>✔<] | [❌]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] + +execute if score $hide_armor ts.sa.settings matches 1 run tellraw @s ["",{"text":"Hide Worn Armor and Tools","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hover_event":{"action":"show_text","value":[{"text":"If enabled, stores the worn armor and tools in the body, feet, or in some versions, leggings slot of a hidden entity. "},{"text":"\n⚠ Note: This may impact worn armor and tool drop rates from mob farms.","color":"gold"}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/enable_hidearmorandtools"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hover_event":{"action":"show_text","value":"Worn armor and tools will not be hidden."},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/disable_hidearmorandtools"}}] +execute if score $hide_armor ts.sa.settings matches 0 run tellraw @s ["",{"text":"Hide Worn Armor and Tools","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hover_event":{"action":"show_text","value":[{"text":"If enabled, stores the worn armor and tools in the body, feet, or in some versions, leggings slot of a hidden entity. "},{"text":"\n⚠ Note: This may impact worn armor and tool drop rates from mob farms when enabled.","color":"gold"}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/enable_hidearmorandtools"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hover_event":{"action":"show_text","value":"Worn armor and tools will not be hidden."},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/disable_hidearmorandtools"}}] +execute if score $hide_armor ts.sa.settings matches -1 run tellraw @s [{"text":"Hide Worn Armor and Tools [✔] | [>❌<]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $hide_armor ts.sa.settings matches 2 run tellraw @s [{"text":"Hide Worn Armor and Tools [>✔<] | [❌]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] + +execute if score $hide_emissive ts.sa.settings matches 1 run tellraw @s ["",{"text":"Hide Emissive Mob Layers","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hover_event":{"action":"show_text","value":[{"text":"If enabled, emissive layers of some mobs (e.g., Endermen, Spiders, and Cave Spiders), or with Pehkui all mobs, will be hidden by shrinking them."},{"text":"\n⚠ Note: This may decrease the efficiency of mob farms due to the changed hitbox size for hidden entities when Pehkui is not installed and the feature is enabled.","color":"gold"}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/enable_hideemissive"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hover_event":{"action":"show_text","value":"Emissive layers will not be hidden."},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/disable_hideemissive"}}] +execute if score $hide_emissive ts.sa.settings matches 0 run tellraw @s ["",{"text":"Hide Emissive Mob Layers","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hover_event":{"action":"show_text","value":[{"text":"If enabled, emissive layers of some mobs (e.g., Endermen, Spiders, and Cave Spiders), or with Pehkui all mobs, will be hidden by shrinking them."},{"text":"\n⚠ Note: This may decrease the efficiency of mob farms due to the changed hitbox size for hidden entities when Pehkui is not installed and the feature is enabled.","color":"gold"}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/enable_hideemissive"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hover_event":{"action":"show_text","value":"Emissive layers will not be hidden."},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/disable_hideemissive"}}] +execute if score $hide_emissive ts.sa.settings matches -1 run tellraw @s [{"text":"Hide Emissive Mob Layers [✔] | [>❌<]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $hide_emissive ts.sa.settings matches 2 run tellraw @s [{"text":"Hide Emissive Mob Layers [>✔<] | [❌]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] + +execute if score $play_sounds ts.sa.settings matches 1..2 if score $play_unsupport ts.sa.settings matches 1 run tellraw @s ["",{"text":"Play Animation on Unsupported Blocks","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hover_event":{"action":"show_text","value":[{"text":"If enabled, the block breaking animation plays on blocks that are not hard-coded into the data pack. "},{"text":"\n⚠ Note: This could lead to unwanted block updates.","color":"gold"}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/enable_allblocksupport"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hover_event":{"action":"show_text","value":"The block breaking animation will not be played on unsupported blocks."},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/disable_allblocksupport"}}] +execute if score $play_sounds ts.sa.settings matches 1..2 if score $play_unsupport ts.sa.settings matches 0 run tellraw @s ["",{"text":"Play Animation on Unsupported Blocks","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hover_event":{"action":"show_text","value":[{"text":"If enabled, the block breaking animation plays on blocks that are not hard-coded into the data pack. "},{"text":"\n⚠ Note: This could lead to unwanted block updates.","color":"gold"}]},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/enable_allblocksupport"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hover_event":{"action":"show_text","value":"The block breaking animation will not be played on unsupported blocks."},"click_event":{"action":"run_command","command":"/function spawnanimations:settings/disable_allblocksupport"}}] +execute if score $play_sounds ts.sa.settings matches 1..2 if score $play_unsupport ts.sa.settings matches -1 run tellraw @s [{"text":"Play Animation on Unsupported Blocks [✔] | [>❌<]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $play_sounds ts.sa.settings matches 1..2 if score $play_unsupport ts.sa.settings matches 2 run tellraw @s [{"text":"Play Animation on Unsupported Blocks [>✔<] | [❌]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"This setting is getting controlled globally and can't be changed here."}]}}] +execute if score $play_sounds ts.sa.settings matches -1..0 run tellraw @s [{"text":"Play Animation on Unsupported Blocks [✔] | [>❌<]","bold":false,"color":"gray","hover_event":{"action":"show_text","value":[{"text":"Enable [Play Animation Sounds] first."}]}}] function spawnanimations:settings/hide_feedback/main playsound minecraft:block.dispenser.dispense master @s ~ ~ ~ 0.2 2 diff --git a/data/spawnanimations/function/settings/defaults.mcfunction b/data/spawnanimations/function/settings/defaults.mcfunction index 873311f..ea7b77c 100644 --- a/data/spawnanimations/function/settings/defaults.mcfunction +++ b/data/spawnanimations/function/settings/defaults.mcfunction @@ -5,5 +5,8 @@ execute unless score $activation_dist ts.sa.settings matches 1..100 run scoreboard players set $activation_dist ts.sa.settings 20 execute unless score #lock_distance ts.sa.settings matches 0..1 run scoreboard players set #lock_distance ts.sa.settings 0 execute unless score $activation_mode ts.sa.settings matches -1..2 run scoreboard players set $activation_mode ts.sa.settings 1 +execute unless score $enable_poof_anim ts.sa.settings matches -1..2 run scoreboard players set $enable_poof_anim ts.sa.settings 1 +execute unless score $play_sounds ts.sa.settings matches -1..2 run scoreboard players set $play_sounds ts.sa.settings 1 execute unless score $hide_armor ts.sa.settings matches -1..2 run scoreboard players set $hide_armor ts.sa.settings 1 +execute unless score $hide_emissive ts.sa.settings matches -1..2 run scoreboard players set $hide_emissive ts.sa.settings 1 execute unless score $play_unsupport ts.sa.settings matches -1..2 run scoreboard players set $play_unsupport ts.sa.settings 0 diff --git a/data/spawnanimations/function/settings/disable_allblocksupport.mcfunction b/data/spawnanimations/function/settings/disable_allblocksupport.mcfunction index 0db9e55..054aaec 100644 --- a/data/spawnanimations/function/settings/disable_allblocksupport.mcfunction +++ b/data/spawnanimations/function/settings/disable_allblocksupport.mcfunction @@ -1,5 +1,5 @@ ##by Tschipcraft -tellraw @s ["",{"text":"\n-> Disabled "},{"text":"[Play animation on unsupported blocks]","color":"yellow"}] +tellraw @s ["",{"text":"\n-> Disabled "},{"text":"[Play Animation on Unsupported Blocks]","color":"yellow"}] scoreboard players set $play_unsupport ts.sa.settings 0 function #spawnanimations:settings diff --git a/data/spawnanimations/function/settings/disable_hidearmorandtools.mcfunction b/data/spawnanimations/function/settings/disable_hidearmorandtools.mcfunction index 92ba91d..9858741 100644 --- a/data/spawnanimations/function/settings/disable_hidearmorandtools.mcfunction +++ b/data/spawnanimations/function/settings/disable_hidearmorandtools.mcfunction @@ -1,5 +1,6 @@ ##by Tschipcraft -tellraw @s ["",{"text":"\n-> Disabled "},{"text":"[Hide armor and tools]","color":"yellow"}] +tellraw @s ["",{"text":"\n-> Disabled "},{"text":"[Hide Worn Armor and Tools]","color":"yellow"}] +tellraw @s ["",{"text":"â„č Info: ","color":"blue"},{"text":"This change only applies to new mobs"}] scoreboard players set $hide_armor ts.sa.settings 0 function #spawnanimations:settings diff --git a/data/spawnanimations/function/settings/disable_hideemissive.mcfunction b/data/spawnanimations/function/settings/disable_hideemissive.mcfunction new file mode 100644 index 0000000..cc178f5 --- /dev/null +++ b/data/spawnanimations/function/settings/disable_hideemissive.mcfunction @@ -0,0 +1,7 @@ +##by Tschipcraft + +tellraw @s ["",{"text":"\n-> Disabled "},{"text":"[Hide Emissive Mob Layers]","color":"yellow"}] +scoreboard players set $hide_emissive ts.sa.settings 0 +execute as @e[type=!#spawnanimations:exclude,tag=ts.sa.ehs.shrunk] run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/unhide +execute as @e[type=!#spawnanimations:exclude,tag=ts.sa.ehs.pehkui.shrunk] run function spawnanimations:internal/entity/ehs/pehkui/unhide +function #spawnanimations:settings diff --git a/data/spawnanimations/function/settings/disable_playsounds.mcfunction b/data/spawnanimations/function/settings/disable_playsounds.mcfunction new file mode 100644 index 0000000..8333762 --- /dev/null +++ b/data/spawnanimations/function/settings/disable_playsounds.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft + +tellraw @s ["",{"text":"\n-> Disabled "},{"text":"[Play Animation Sounds]","color":"yellow"}] +scoreboard players set $play_sounds ts.sa.settings 0 +function #spawnanimations:settings diff --git a/data/spawnanimations/function/settings/disable_poofanim.mcfunction b/data/spawnanimations/function/settings/disable_poofanim.mcfunction new file mode 100644 index 0000000..62139ca --- /dev/null +++ b/data/spawnanimations/function/settings/disable_poofanim.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft + +tellraw @s ["",{"text":"\n-> Disabled "},{"text":"[Enable Poof Animation]","color":"yellow"}] +scoreboard players set $enable_poof_anim ts.sa.settings 0 +function #spawnanimations:settings diff --git a/data/spawnanimations/function/settings/enable_allblocksupport.mcfunction b/data/spawnanimations/function/settings/enable_allblocksupport.mcfunction index e563573..8430335 100644 --- a/data/spawnanimations/function/settings/enable_allblocksupport.mcfunction +++ b/data/spawnanimations/function/settings/enable_allblocksupport.mcfunction @@ -1,5 +1,5 @@ ##by Tschipcraft -tellraw @s ["",{"text":"\n-> Enabled "},{"text":"[Play animation on unsupported blocks]","color":"yellow"}] +tellraw @s ["",{"text":"\n-> Enabled "},{"text":"[Play Animation on Unsupported Blocks]","color":"yellow"}] scoreboard players set $play_unsupport ts.sa.settings 1 function #spawnanimations:settings diff --git a/data/spawnanimations/function/settings/enable_hidearmorandtools.mcfunction b/data/spawnanimations/function/settings/enable_hidearmorandtools.mcfunction index 74dbc63..bbe4aa4 100644 --- a/data/spawnanimations/function/settings/enable_hidearmorandtools.mcfunction +++ b/data/spawnanimations/function/settings/enable_hidearmorandtools.mcfunction @@ -1,5 +1,6 @@ ##by Tschipcraft -tellraw @s ["",{"text":"\n-> Enabled "},{"text":"[Hide armor and tools]","color":"yellow"}] +tellraw @s ["",{"text":"\n-> Enabled "},{"text":"[Hide Worn Armor and Tools]","color":"yellow"}] +tellraw @s ["",{"text":"â„č Info: ","color":"blue"},{"text":"This change only applies to new mobs"}] scoreboard players set $hide_armor ts.sa.settings 1 function #spawnanimations:settings diff --git a/data/spawnanimations/function/settings/enable_hideemissive.mcfunction b/data/spawnanimations/function/settings/enable_hideemissive.mcfunction new file mode 100644 index 0000000..4466bc8 --- /dev/null +++ b/data/spawnanimations/function/settings/enable_hideemissive.mcfunction @@ -0,0 +1,6 @@ +##by Tschipcraft + +tellraw @s ["",{"text":"\n-> Enabled "},{"text":"[Hide Emissive Mob Layers]","color":"yellow"}] +tellraw @s ["",{"text":"â„č Info: ","color":"blue"},{"text":"This change only applies to new mobs"}] +scoreboard players set $hide_emissive ts.sa.settings 1 +function #spawnanimations:settings diff --git a/data/spawnanimations/function/settings/enable_playsounds.mcfunction b/data/spawnanimations/function/settings/enable_playsounds.mcfunction new file mode 100644 index 0000000..2ce58f9 --- /dev/null +++ b/data/spawnanimations/function/settings/enable_playsounds.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft + +tellraw @s ["",{"text":"\n-> Enabled "},{"text":"[Play Animation Sounds]","color":"yellow"}] +scoreboard players set $play_sounds ts.sa.settings 1 +function #spawnanimations:settings diff --git a/data/spawnanimations/function/settings/enable_poofanim.mcfunction b/data/spawnanimations/function/settings/enable_poofanim.mcfunction new file mode 100644 index 0000000..96482c7 --- /dev/null +++ b/data/spawnanimations/function/settings/enable_poofanim.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft + +tellraw @s ["",{"text":"\n-> Enabled "},{"text":"[Enable Poof Animation]","color":"yellow"}] +scoreboard players set $enable_poof_anim ts.sa.settings 1 +function #spawnanimations:settings diff --git a/data/spawnanimations/function/settings/vanilla.mcfunction b/data/spawnanimations/function/settings/vanilla.mcfunction index 15ad6d0..468f363 100644 --- a/data/spawnanimations/function/settings/vanilla.mcfunction +++ b/data/spawnanimations/function/settings/vanilla.mcfunction @@ -1,6 +1,6 @@ ##by Tschipcraft -tellraw @s ["",{"text":"\n-> Set activation mode to "},{"text":"[vanilla]","color":"yellow"}] -scoreboard players set $activation_mode ts.sa.settings 0 +tellraw @s ["",{"text":"\n-> Set Activation Mode to "},{"text":"[Vanilla]","color":"yellow"}] execute if score $activation_dist ts.sa.settings matches ..24 run tellraw @s ["",{"text":"â„č Info: ","color":"blue"},{"text":"It is recommended to set the activation distance to at least 25 blocks when using the vanilla activation mode to see the animation","hoverEvent":{"action":"show_text","contents":"Why? In vanilla, mobs do not spawn if a player is within a 24-block radius (spherical)"},"hover_event":{"action":"show_text","value":"Why? In vanilla, mobs do not spawn if a player is within a 24-block radius (spherical)"}}] +scoreboard players set $activation_mode ts.sa.settings 0 function #spawnanimations:settings diff --git a/data/spawnanimations/functions/internal/animation/dig_up/sound/sound.mcfunction b/data/spawnanimations/functions/internal/animation/dig_up/sound/sound.mcfunction index 25cc2e8..0b265d6 100644 --- a/data/spawnanimations/functions/internal/animation/dig_up/sound/sound.mcfunction +++ b/data/spawnanimations/functions/internal/animation/dig_up/sound/sound.mcfunction @@ -1,7 +1,7 @@ ## by Tschipcraft -execute if block ~ ~ ~ #spawnanimations:supported run function spawnanimations:internal/animation/dig_up/sound/play_sound -execute if score $play_unsupport ts.sa.settings matches 1..2 unless block ~ ~ ~ #spawnanimations:supported unless block ~ ~ ~ #spawnanimations:nonsolid unless block ~ ~ ~ minecraft:bedrock unless block ~ ~ ~ minecraft:air run function spawnanimations:internal/animation/dig_up/sound/support +execute if score $play_sounds ts.sa.settings matches 1..2 if block ~ ~ ~ #spawnanimations:supported run function spawnanimations:internal/animation/dig_up/sound/play_sound +execute if score $play_sounds ts.sa.settings matches 1..2 if score $play_unsupport ts.sa.settings matches 1..2 unless block ~ ~ ~ #spawnanimations:supported unless block ~ ~ ~ #spawnanimations:nonsolid unless block ~ ~ ~ minecraft:bedrock unless block ~ ~ ~ minecraft:air run function spawnanimations:internal/animation/dig_up/sound/support # Update stage + adjust animation speed scoreboard players add @s ts.sa.e.stage 1 diff --git a/data/spawnanimations/functions/internal/animation/dig_up/sound/sound2.mcfunction b/data/spawnanimations/functions/internal/animation/dig_up/sound/sound2.mcfunction index c8fe564..8bd207d 100644 --- a/data/spawnanimations/functions/internal/animation/dig_up/sound/sound2.mcfunction +++ b/data/spawnanimations/functions/internal/animation/dig_up/sound/sound2.mcfunction @@ -1,7 +1,7 @@ ## by Tschipcraft -execute if block ~ ~ ~ #spawnanimations:supported run function spawnanimations:internal/animation/dig_up/sound/play_sound2 -execute if score $play_unsupport ts.sa.settings matches 1..2 unless block ~ ~ ~ #spawnanimations:supported unless block ~ ~ ~ #spawnanimations:nonsolid unless block ~ ~ ~ minecraft:bedrock unless block ~ ~ ~ minecraft:air run function spawnanimations:internal/animation/dig_up/sound/support +execute if score $play_sounds ts.sa.settings matches 1..2 if block ~ ~ ~ #spawnanimations:supported run function spawnanimations:internal/animation/dig_up/sound/play_sound2 +execute if score $play_sounds ts.sa.settings matches 1..2 if score $play_unsupport ts.sa.settings matches 1..2 unless block ~ ~ ~ #spawnanimations:supported unless block ~ ~ ~ #spawnanimations:nonsolid unless block ~ ~ ~ minecraft:bedrock unless block ~ ~ ~ minecraft:air run function spawnanimations:internal/animation/dig_up/sound/support scoreboard players reset @s ts.sa.e.stage scoreboard players reset @s ts.sa.e.speed diff --git a/data/spawnanimations/functions/internal/animation/dig_up/verify_in_air.mcfunction b/data/spawnanimations/functions/internal/animation/dig_up/verify_in_air.mcfunction index fea236c..36949b2 100644 --- a/data/spawnanimations/functions/internal/animation/dig_up/verify_in_air.mcfunction +++ b/data/spawnanimations/functions/internal/animation/dig_up/verify_in_air.mcfunction @@ -1,9 +1,10 @@ ## by Tschipcraft +# The "Poof" animation tag @s remove ts.sa.verify tag @s remove ts.sa.to_verify function spawnanimations:internal/entity/unhide function spawnanimations:internal/entity/unprotect -particle minecraft:spit ~ ~1 ~ 0 0.3 0 0.2 15 normal -playsound minecraft:entity.llama.spit hostile @a ~ ~ ~ 0.75 0 +execute if score $enable_poof_anim ts.sa.settings matches 1..2 run particle minecraft:spit ~ ~1 ~ 0 0.3 0 0.2 10 normal +execute if score $enable_poof_anim ts.sa.settings matches 1..2 if score $play_sounds ts.sa.settings matches 1..2 run playsound minecraft:entity.llama.spit hostile @a ~ ~ ~ 0.75 0 function spawnanimations:internal/animation/dig_up/verify diff --git a/data/spawnanimations/functions/internal/entity/ehs/hide.mcfunction b/data/spawnanimations/functions/internal/entity/ehs/hide.mcfunction index 6572cdf..fb38e5f 100644 --- a/data/spawnanimations/functions/internal/entity/ehs/hide.mcfunction +++ b/data/spawnanimations/functions/internal/entity/ehs/hide.mcfunction @@ -9,4 +9,4 @@ tag @s add ts.sa.to_hide effect give @s invisibility 10 0 true # Pehkui integration -function spawnanimations:internal/entity/ehs/pehkui/hide +execute if score $hide_emissive ts.sa.settings matches 1..2 run function spawnanimations:internal/entity/ehs/pehkui/hide diff --git a/data/spawnanimations/functions/internal/entity/ehs/hide_exec.mcfunction b/data/spawnanimations/functions/internal/entity/ehs/hide_exec.mcfunction index 8bd5acd..990a992 100644 --- a/data/spawnanimations/functions/internal/entity/ehs/hide_exec.mcfunction +++ b/data/spawnanimations/functions/internal/entity/ehs/hide_exec.mcfunction @@ -10,4 +10,4 @@ execute if score $hide_armor ts.sa.settings matches 1..2 as @s[type=#spawnanimat # Entity specific execute if entity @s[type=minecraft:creeper] run function spawnanimations:internal/entity/ehs/entity_specific/creeper/hide -execute if entity @s[type=#spawnanimations:has_emissive_layer,tag=!ts.sa.ehs.pehkui.shrunk] run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/hide +execute if score $hide_emissive ts.sa.settings matches 1..2 if entity @s[type=#spawnanimations:has_emissive_layer,tag=!ts.sa.ehs.pehkui.shrunk] run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/hide diff --git a/data/spawnanimations/functions/internal/entity/ehs/pehkui/hide.mcfunction b/data/spawnanimations/functions/internal/entity/ehs/pehkui/hide.mcfunction index 2ffe0d1..d5820fc 100644 --- a/data/spawnanimations/functions/internal/entity/ehs/pehkui/hide.mcfunction +++ b/data/spawnanimations/functions/internal/entity/ehs/pehkui/hide.mcfunction @@ -1,5 +1,5 @@ ##by Tschipcraft -# Shrinks entities with an emissive layer to lower scale +# Shrinks entities to a smaller scale to completely hide them scale delay set pehkui:model_width 0 @s scale delay set pehkui:model_height 0 @s diff --git a/data/spawnanimations/functions/internal/entity/ehs/pehkui/set_easing.mcfunction b/data/spawnanimations/functions/internal/entity/ehs/pehkui/set_easing.mcfunction new file mode 100644 index 0000000..dc4a28d --- /dev/null +++ b/data/spawnanimations/functions/internal/entity/ehs/pehkui/set_easing.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft +# Sets the easing for the model width and height of entities (Pehkui 3.4.0+) + +scale easing set pehkui:model_width pehkui:quadratic_in_out @s +scale easing set pehkui:model_height pehkui:quadratic_in_out @s diff --git a/data/spawnanimations/functions/internal/entity/ehs/pehkui/unhide.mcfunction b/data/spawnanimations/functions/internal/entity/ehs/pehkui/unhide.mcfunction index 0ab36e8..c753c0f 100644 --- a/data/spawnanimations/functions/internal/entity/ehs/pehkui/unhide.mcfunction +++ b/data/spawnanimations/functions/internal/entity/ehs/pehkui/unhide.mcfunction @@ -1,10 +1,9 @@ ##by Tschipcraft -# Resets entities with an emissive layer that got their scale changed +# Resets entities that got their scale changed scale delay set pehkui:model_width 10 @s scale delay set pehkui:model_height 10 @s -scale easing set pehkui:model_width pehkui:quadratic_in_out @s -scale easing set pehkui:model_height pehkui:quadratic_in_out @s +function spawnanimations:internal/entity/ehs/pehkui/set_easing scale set pehkui:model_width 1 @s scale set pehkui:model_height 1 @s diff --git a/data/spawnanimations/functions/settings/classic.mcfunction b/data/spawnanimations/functions/settings/classic.mcfunction index e7d6b85..9202210 100644 --- a/data/spawnanimations/functions/settings/classic.mcfunction +++ b/data/spawnanimations/functions/settings/classic.mcfunction @@ -1,5 +1,5 @@ ##by Tschipcraft -tellraw @s ["",{"text":"\n-> Set activation mode to "},{"text":"[classic]","color":"yellow"}] +tellraw @s ["",{"text":"\n-> Set Activation Mode to "},{"text":"[Classic]","color":"yellow"}] scoreboard players set $activation_mode ts.sa.settings 1 function #spawnanimations:settings diff --git a/data/spawnanimations/functions/settings/core.mcfunction b/data/spawnanimations/functions/settings/core.mcfunction index 94195bb..3e114da 100644 --- a/data/spawnanimations/functions/settings/core.mcfunction +++ b/data/spawnanimations/functions/settings/core.mcfunction @@ -7,20 +7,36 @@ execute unless score #lock_distance ts.sa.settings matches 1 if score $activatio execute unless score #lock_distance ts.sa.settings matches 1 if score $activation_dist ts.sa.settings matches 100.. run tellraw @s [{"text":"Activation Distance","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Mobs closer to you than this value will play the animation"}]}},{"text":" "},{"text":"<<< ","color":"aqua","hoverEvent":{"action":"show_text","contents":[{"text":"-1"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/decrease"}},{"score":{"name":"$activation_dist","objective":"ts.sa.settings"},"color":"green","bold":true},{"text":" blocks","color":"green"},{"text":" >>>","color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"Max is 100","color":"red"}]}},{"text":" [\u270e]","color":"gray","clickEvent":{"action":"suggest_command","value":"/scoreboard players set @s ts.sa.distance "},"hoverEvent":{"action":"show_text","contents":"Edit"}}] execute if score #lock_distance ts.sa.settings matches 1 run tellraw @s [{"text":"Activation Distance <<< ","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}},{"score":{"name":"$activation_dist","objective":"ts.sa.settings"}},{"text":" blocks >>>"}] -execute if score $activation_mode ts.sa.settings matches 1 run tellraw @s ["",{"text":"Activation mode","bold":true},{"text":" "},{"text":"[>classic<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Out of range mobs will stay hidden until a player is in range."}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/classic"}},{"text":" | "},{"text":"[vanilla]","color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"Out of range mobs will spawn normally."}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/vanilla"}}] -execute if score $activation_mode ts.sa.settings matches 0 run tellraw @s ["",{"text":"Activation mode","bold":true},{"text":" "},{"text":"[classic]","color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"Out of range mobs will stay hidden until a player is in range."}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/classic"}},{"text":" | "},{"text":"[>vanilla<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Out of range mobs will spawn normally."}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/vanilla"}}] -execute if score $activation_mode ts.sa.settings matches -1 run tellraw @s [{"text":"Activation mode [classic] | [>vanilla<]","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 $activation_mode ts.sa.settings matches 2 run tellraw @s [{"text":"Activation mode [>classic<] | [vanilla]","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 $hide_armor ts.sa.settings matches 1 run tellraw @s ["",{"text":"Hide worn armor and tools","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Worn armor and tools will be hidden. "},{"text":"\n⚠ Note: This feature may impact worn armor and tool drop rates inside farms.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_hidearmorandtools"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hoverEvent":{"action":"show_text","contents":"Worn armor and tools will not be hidden."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_hidearmorandtools"}}] -execute if score $hide_armor ts.sa.settings matches 0 run tellraw @s ["",{"text":"Hide worn armor and tools","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hoverEvent":{"action":"show_text","contents":[{"text":"Worn armor and tools will be hidden. "},{"text":"\n⚠ Note: This feature may impact worn armor and tool drop rates inside farms.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_hidearmorandtools"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hoverEvent":{"action":"show_text","contents":"Worn armor and tools will not be hidden."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_hidearmorandtools"}}] -execute if score $hide_armor ts.sa.settings matches -1 run tellraw @s [{"text":"Hide worn armor and tools [✔] | [>❌<]","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 $hide_armor ts.sa.settings matches 2 run tellraw @s [{"text":"Hide worn armor and tools [>✔<] | [❌]","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 $play_unsupport ts.sa.settings matches 1 run tellraw @s ["",{"text":"Play animation on unsupported blocks","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"The block break animation is played on unsupported blocks. "},{"text":"\n⚠ Note: This could lead to unwanted block updates.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_allblocksupport"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hoverEvent":{"action":"show_text","contents":"The block break animation will not be played on unsupported blocks."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_allblocksupport"}}] -execute if score $play_unsupport ts.sa.settings matches 0 run tellraw @s ["",{"text":"Play animation on unsupported blocks","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hoverEvent":{"action":"show_text","contents":[{"text":"The block break animation is played on unsupported blocks. "},{"text":"\n⚠ Note: This could lead to unwanted block updates.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_allblocksupport"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hoverEvent":{"action":"show_text","contents":"The block break animation will not be played on unsupported blocks."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_allblocksupport"}}] -execute if score $play_unsupport ts.sa.settings matches -1 run tellraw @s [{"text":"Play animation on unsupported blocks [✔] | [>❌<]","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 $play_unsupport ts.sa.settings matches 2 run tellraw @s [{"text":"Play animation on unsupported blocks [>✔<] | [❌]","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 $activation_mode ts.sa.settings matches 1 run tellraw @s ["",{"text":"Activation Mode","bold":true},{"text":" "},{"text":"[>Classic<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Mobs outside the activation range remain hidden until a player is in range."}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/classic"}},{"text":" | "},{"text":"[Vanilla]","color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"Mobs outside the activation range spawn normally."}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/vanilla"}}] +execute if score $activation_mode ts.sa.settings matches 0 run tellraw @s ["",{"text":"Activation Mode","bold":true},{"text":" "},{"text":"[Classic]","color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"Mobs outside the activation range remain hidden until a player is in range."}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/classic"}},{"text":" | "},{"text":"[>Vanilla<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Mobs outside the activation range spawn normally."}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/vanilla"}}] +execute if score $activation_mode ts.sa.settings matches -1 run tellraw @s [{"text":"Activation Mode [Classic] | [>Vanilla<]","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 $activation_mode ts.sa.settings matches 2 run tellraw @s [{"text":"Activation Mode [>Classic<] | [Vanilla]","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 $enable_poof_anim ts.sa.settings matches 1 run tellraw @s ["",{"text":"Enable Poof Animation","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":"If enabled, some mobs, or mobs without a block to dig up from, will play the poof animation instead."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_poofanim"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hoverEvent":{"action":"show_text","contents":"Poof animation will not be played."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_poofanim"}}] +execute if score $enable_poof_anim ts.sa.settings matches 0 run tellraw @s ["",{"text":"Enable Poof Animation","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hoverEvent":{"action":"show_text","contents":"If enabled, some mobs, or mobs without a block to dig up from, will play the poof animation instead."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_poofanim"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hoverEvent":{"action":"show_text","contents":"Poof animation will not be played."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_poofanim"}}] +execute if score $enable_poof_anim ts.sa.settings matches -1 run tellraw @s [{"text":"Enable Poof Animation [✔] | [>❌<]","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 $enable_poof_anim ts.sa.settings matches 2 run tellraw @s [{"text":"Enable Poof Animation [>✔<] | [❌]","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 $play_sounds ts.sa.settings matches 1 run tellraw @s ["",{"text":"Play Animation Sounds","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":"If enabled, sounds will be played during the animation."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_playsounds"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hoverEvent":{"action":"show_text","contents":"Sounds will not be played."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_playsounds"}}] +execute if score $play_sounds ts.sa.settings matches 0 run tellraw @s ["",{"text":"Play Animation Sounds","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hoverEvent":{"action":"show_text","contents":"If enabled, sounds will be played during the animation."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_playsounds"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hoverEvent":{"action":"show_text","contents":"Sounds will not be played."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_playsounds"}}] +execute if score $play_sounds ts.sa.settings matches -1 run tellraw @s [{"text":"Play Animation Sounds [✔] | [>❌<]","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 $play_sounds ts.sa.settings matches 2 run tellraw @s [{"text":"Play Animation Sounds [>✔<] | [❌]","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 $hide_armor ts.sa.settings matches 1 run tellraw @s ["",{"text":"Hide Worn Armor and Tools","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, stores the worn armor and tools in the body, feet, or in some versions, leggings slot of a hidden entity. "},{"text":"\n⚠ Note: This may impact worn armor and tool drop rates from mob farms.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_hidearmorandtools"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hoverEvent":{"action":"show_text","contents":"Worn armor and tools will not be hidden."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_hidearmorandtools"}}] +execute if score $hide_armor ts.sa.settings matches 0 run tellraw @s ["",{"text":"Hide Worn Armor and Tools","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, stores the worn armor and tools in the body, feet, or in some versions, leggings slot of a hidden entity. "},{"text":"\n⚠ Note: This may impact worn armor and tool drop rates from mob farms when enabled.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_hidearmorandtools"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hoverEvent":{"action":"show_text","contents":"Worn armor and tools will not be hidden."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_hidearmorandtools"}}] +execute if score $hide_armor ts.sa.settings matches -1 run tellraw @s [{"text":"Hide Worn Armor and Tools [✔] | [>❌<]","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 $hide_armor ts.sa.settings matches 2 run tellraw @s [{"text":"Hide Worn Armor and Tools [>✔<] | [❌]","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 $hide_emissive ts.sa.settings matches 1 run tellraw @s ["",{"text":"Hide Emissive Mob Layers","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, emissive layers of some mobs (e.g., Endermen, Spiders, and Cave Spiders), or with Pehkui all mobs, will be hidden by shrinking them.\nRequires Pehkui to be installed in Minecraft 1.20.4 and below."},{"text":"\n⚠ Note: This may decrease the efficiency of mob farms due to the changed hitbox size for hidden entities when Pehkui is not installed and the feature is enabled.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_hideemissive"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hoverEvent":{"action":"show_text","contents":"Emissive layers will not be hidden."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_hideemissive"}}] +execute if score $hide_emissive ts.sa.settings matches 0 run tellraw @s ["",{"text":"Hide Emissive Mob Layers","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, emissive layers of some mobs (e.g., Endermen, Spiders, and Cave Spiders), or with Pehkui all mobs, will be hidden by shrinking them.\nRequires Pehkui to be installed in Minecraft 1.20.4 and below."},{"text":"\n⚠ Note: This may decrease the efficiency of mob farms due to the changed hitbox size for hidden entities when Pehkui is not installed and the feature is enabled.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_hideemissive"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hoverEvent":{"action":"show_text","contents":"Emissive layers will not be hidden."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_hideemissive"}}] +execute if score $hide_emissive ts.sa.settings matches -1 run tellraw @s [{"text":"Hide Emissive Mob Layers [✔] | [>❌<]","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 $hide_emissive ts.sa.settings matches 2 run tellraw @s [{"text":"Hide Emissive Mob Layers [>✔<] | [❌]","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 $play_sounds ts.sa.settings matches 1..2 if score $play_unsupport ts.sa.settings matches 1 run tellraw @s ["",{"text":"Play Animation on Unsupported Blocks","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, the block breaking animation plays on blocks that are not hard-coded into the data pack. "},{"text":"\n⚠ Note: This could lead to unwanted block updates.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_allblocksupport"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hoverEvent":{"action":"show_text","contents":"The block breaking animation will not be played on unsupported blocks."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_allblocksupport"}}] +execute if score $play_sounds ts.sa.settings matches 1..2 if score $play_unsupport ts.sa.settings matches 0 run tellraw @s ["",{"text":"Play Animation on Unsupported Blocks","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, the block breaking animation plays on blocks that are not hard-coded into the data pack. "},{"text":"\n⚠ Note: This could lead to unwanted block updates.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_allblocksupport"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hoverEvent":{"action":"show_text","contents":"The block breaking animation will not be played on unsupported blocks."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_allblocksupport"}}] +execute if score $play_sounds ts.sa.settings matches 1..2 if score $play_unsupport ts.sa.settings matches -1 run tellraw @s [{"text":"Play Animation on Unsupported Blocks [✔] | [>❌<]","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 $play_sounds ts.sa.settings matches 1..2 if score $play_unsupport ts.sa.settings matches 2 run tellraw @s [{"text":"Play Animation on Unsupported Blocks [>✔<] | [❌]","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 $play_sounds ts.sa.settings matches -1..0 run tellraw @s [{"text":"Play Animation on Unsupported Blocks [✔] | [>❌<]","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"Enable [Play Animation Sounds] first."}]}}] function spawnanimations:settings/hide_feedback/main playsound minecraft:block.dispenser.dispense master @s ~ ~ ~ 0.2 2 diff --git a/data/spawnanimations/functions/settings/defaults.mcfunction b/data/spawnanimations/functions/settings/defaults.mcfunction index 873311f..ea7b77c 100644 --- a/data/spawnanimations/functions/settings/defaults.mcfunction +++ b/data/spawnanimations/functions/settings/defaults.mcfunction @@ -5,5 +5,8 @@ execute unless score $activation_dist ts.sa.settings matches 1..100 run scoreboard players set $activation_dist ts.sa.settings 20 execute unless score #lock_distance ts.sa.settings matches 0..1 run scoreboard players set #lock_distance ts.sa.settings 0 execute unless score $activation_mode ts.sa.settings matches -1..2 run scoreboard players set $activation_mode ts.sa.settings 1 +execute unless score $enable_poof_anim ts.sa.settings matches -1..2 run scoreboard players set $enable_poof_anim ts.sa.settings 1 +execute unless score $play_sounds ts.sa.settings matches -1..2 run scoreboard players set $play_sounds ts.sa.settings 1 execute unless score $hide_armor ts.sa.settings matches -1..2 run scoreboard players set $hide_armor ts.sa.settings 1 +execute unless score $hide_emissive ts.sa.settings matches -1..2 run scoreboard players set $hide_emissive ts.sa.settings 1 execute unless score $play_unsupport ts.sa.settings matches -1..2 run scoreboard players set $play_unsupport ts.sa.settings 0 diff --git a/data/spawnanimations/functions/settings/disable_allblocksupport.mcfunction b/data/spawnanimations/functions/settings/disable_allblocksupport.mcfunction index 0db9e55..054aaec 100644 --- a/data/spawnanimations/functions/settings/disable_allblocksupport.mcfunction +++ b/data/spawnanimations/functions/settings/disable_allblocksupport.mcfunction @@ -1,5 +1,5 @@ ##by Tschipcraft -tellraw @s ["",{"text":"\n-> Disabled "},{"text":"[Play animation on unsupported blocks]","color":"yellow"}] +tellraw @s ["",{"text":"\n-> Disabled "},{"text":"[Play Animation on Unsupported Blocks]","color":"yellow"}] scoreboard players set $play_unsupport ts.sa.settings 0 function #spawnanimations:settings diff --git a/data/spawnanimations/functions/settings/disable_hidearmorandtools.mcfunction b/data/spawnanimations/functions/settings/disable_hidearmorandtools.mcfunction index 92ba91d..9858741 100644 --- a/data/spawnanimations/functions/settings/disable_hidearmorandtools.mcfunction +++ b/data/spawnanimations/functions/settings/disable_hidearmorandtools.mcfunction @@ -1,5 +1,6 @@ ##by Tschipcraft -tellraw @s ["",{"text":"\n-> Disabled "},{"text":"[Hide armor and tools]","color":"yellow"}] +tellraw @s ["",{"text":"\n-> Disabled "},{"text":"[Hide Worn Armor and Tools]","color":"yellow"}] +tellraw @s ["",{"text":"â„č Info: ","color":"blue"},{"text":"This change only applies to new mobs"}] scoreboard players set $hide_armor ts.sa.settings 0 function #spawnanimations:settings diff --git a/data/spawnanimations/functions/settings/disable_hideemissive.mcfunction b/data/spawnanimations/functions/settings/disable_hideemissive.mcfunction new file mode 100644 index 0000000..cc178f5 --- /dev/null +++ b/data/spawnanimations/functions/settings/disable_hideemissive.mcfunction @@ -0,0 +1,7 @@ +##by Tschipcraft + +tellraw @s ["",{"text":"\n-> Disabled "},{"text":"[Hide Emissive Mob Layers]","color":"yellow"}] +scoreboard players set $hide_emissive ts.sa.settings 0 +execute as @e[type=!#spawnanimations:exclude,tag=ts.sa.ehs.shrunk] run function spawnanimations:internal/entity/ehs/entity_specific/emissive_layer/unhide +execute as @e[type=!#spawnanimations:exclude,tag=ts.sa.ehs.pehkui.shrunk] run function spawnanimations:internal/entity/ehs/pehkui/unhide +function #spawnanimations:settings diff --git a/data/spawnanimations/functions/settings/disable_playsounds.mcfunction b/data/spawnanimations/functions/settings/disable_playsounds.mcfunction new file mode 100644 index 0000000..8333762 --- /dev/null +++ b/data/spawnanimations/functions/settings/disable_playsounds.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft + +tellraw @s ["",{"text":"\n-> Disabled "},{"text":"[Play Animation Sounds]","color":"yellow"}] +scoreboard players set $play_sounds ts.sa.settings 0 +function #spawnanimations:settings diff --git a/data/spawnanimations/functions/settings/disable_poofanim.mcfunction b/data/spawnanimations/functions/settings/disable_poofanim.mcfunction new file mode 100644 index 0000000..62139ca --- /dev/null +++ b/data/spawnanimations/functions/settings/disable_poofanim.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft + +tellraw @s ["",{"text":"\n-> Disabled "},{"text":"[Enable Poof Animation]","color":"yellow"}] +scoreboard players set $enable_poof_anim ts.sa.settings 0 +function #spawnanimations:settings diff --git a/data/spawnanimations/functions/settings/enable_allblocksupport.mcfunction b/data/spawnanimations/functions/settings/enable_allblocksupport.mcfunction index e563573..8430335 100644 --- a/data/spawnanimations/functions/settings/enable_allblocksupport.mcfunction +++ b/data/spawnanimations/functions/settings/enable_allblocksupport.mcfunction @@ -1,5 +1,5 @@ ##by Tschipcraft -tellraw @s ["",{"text":"\n-> Enabled "},{"text":"[Play animation on unsupported blocks]","color":"yellow"}] +tellraw @s ["",{"text":"\n-> Enabled "},{"text":"[Play Animation on Unsupported Blocks]","color":"yellow"}] scoreboard players set $play_unsupport ts.sa.settings 1 function #spawnanimations:settings diff --git a/data/spawnanimations/functions/settings/enable_hidearmorandtools.mcfunction b/data/spawnanimations/functions/settings/enable_hidearmorandtools.mcfunction index 74dbc63..bbe4aa4 100644 --- a/data/spawnanimations/functions/settings/enable_hidearmorandtools.mcfunction +++ b/data/spawnanimations/functions/settings/enable_hidearmorandtools.mcfunction @@ -1,5 +1,6 @@ ##by Tschipcraft -tellraw @s ["",{"text":"\n-> Enabled "},{"text":"[Hide armor and tools]","color":"yellow"}] +tellraw @s ["",{"text":"\n-> Enabled "},{"text":"[Hide Worn Armor and Tools]","color":"yellow"}] +tellraw @s ["",{"text":"â„č Info: ","color":"blue"},{"text":"This change only applies to new mobs"}] scoreboard players set $hide_armor ts.sa.settings 1 function #spawnanimations:settings diff --git a/data/spawnanimations/functions/settings/enable_hideemissive.mcfunction b/data/spawnanimations/functions/settings/enable_hideemissive.mcfunction new file mode 100644 index 0000000..4466bc8 --- /dev/null +++ b/data/spawnanimations/functions/settings/enable_hideemissive.mcfunction @@ -0,0 +1,6 @@ +##by Tschipcraft + +tellraw @s ["",{"text":"\n-> Enabled "},{"text":"[Hide Emissive Mob Layers]","color":"yellow"}] +tellraw @s ["",{"text":"â„č Info: ","color":"blue"},{"text":"This change only applies to new mobs"}] +scoreboard players set $hide_emissive ts.sa.settings 1 +function #spawnanimations:settings diff --git a/data/spawnanimations/functions/settings/enable_playsounds.mcfunction b/data/spawnanimations/functions/settings/enable_playsounds.mcfunction new file mode 100644 index 0000000..2ce58f9 --- /dev/null +++ b/data/spawnanimations/functions/settings/enable_playsounds.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft + +tellraw @s ["",{"text":"\n-> Enabled "},{"text":"[Play Animation Sounds]","color":"yellow"}] +scoreboard players set $play_sounds ts.sa.settings 1 +function #spawnanimations:settings diff --git a/data/spawnanimations/functions/settings/enable_poofanim.mcfunction b/data/spawnanimations/functions/settings/enable_poofanim.mcfunction new file mode 100644 index 0000000..96482c7 --- /dev/null +++ b/data/spawnanimations/functions/settings/enable_poofanim.mcfunction @@ -0,0 +1,5 @@ +##by Tschipcraft + +tellraw @s ["",{"text":"\n-> Enabled "},{"text":"[Enable Poof Animation]","color":"yellow"}] +scoreboard players set $enable_poof_anim ts.sa.settings 1 +function #spawnanimations:settings diff --git a/data/spawnanimations/functions/settings/vanilla.mcfunction b/data/spawnanimations/functions/settings/vanilla.mcfunction index 6984709..bd68ca0 100644 --- a/data/spawnanimations/functions/settings/vanilla.mcfunction +++ b/data/spawnanimations/functions/settings/vanilla.mcfunction @@ -1,6 +1,6 @@ ##by Tschipcraft -tellraw @s ["",{"text":"\n-> Set activation mode to "},{"text":"[vanilla]","color":"yellow"}] -scoreboard players set $activation_mode ts.sa.settings 0 +tellraw @s ["",{"text":"\n-> Set Activation Mode to "},{"text":"[Vanilla]","color":"yellow"}] execute if score $activation_dist ts.sa.settings matches ..24 run tellraw @s ["",{"text":"â„č Info: ","color":"blue"},{"text":"It is recommended to set the activation distance to at least 25 blocks when using the vanilla activation mode to see the animation","hoverEvent":{"action":"show_text","contents":"Why? In vanilla, mobs do not spawn if a player is within a 24-block radius (spherical)"}}] +scoreboard players set $activation_mode ts.sa.settings 0 function #spawnanimations:settings diff --git a/fabric.mod.json b/fabric.mod.json index 2ca6511..00b9d5c 100644 --- a/fabric.mod.json +++ b/fabric.mod.json @@ -26,13 +26,16 @@ "java": ">=8" }, "recommends": { - "modmenu": "*", - "modmenu-badges-lib": "*", "midnightlib": "*", "mr_spawn_animationscompats": "*" }, "suggests": { - "pehkui": ">=3.4.0" + "pehkui": ">=3.4.0", + "modmenu": "*", + "modmenu-badges-lib": "*" + }, + "conflicts": { + "pehkui": "<3.4.0" }, "custom": { "modmenu": { diff --git a/net/tschipcraft/spawnanimations/fabric/Config.class b/net/tschipcraft/spawnanimations/fabric/Config.class index 9844295cf5c75c46ed99a0c908a6e15946ce0175..6b25f4fcee91eab88bf2fbff09cbdf90174793ad 100644 GIT binary patch delta 653 zcmZ`%xlY4C5Pe?9fP+DZkdSZ+5ai$p_kG_t5)BHCWrR^IC3b`XiHd)~EgfF~DUc|r zs1V{asG*=m%-S46f#%KI_jY!6cJ@+vF7rRU-`)Y}$L5v)o`r(CsqJNSHD_4|s%9El z?Z~i9=ar3wg1L-#`lG3~b!_h2&LfLP!f9h)SM{u6+s28mX01Jy_UebW6BCC^x{&n4 zhi)e=ZlneTNIP5G>+=eR&?ci8!wOnCV;JRHOokuh3Zk4bOe%SZ@U(CyxzIge8!WD zXi-m5<{fb3mqxu5Xo>H8@!Wu$OPv<%qn-;i>i$PNa|<&P=*bCJ=qMfqic;bRJy%2+ zRtb3}60t_8eDYrO(W-?0!dG(2b%3~-$KW+a@)*0uL>^Nv&bT<|;sVDcmUsoht;NaAM*s33{aXyPx?m{H>=?i57?(WN^?2%w2$fw~@A^?v6`>XuazP5o{)Qsvtq zxcBvg)y^zoISZRzp>^u73#hBJi<6$q*?9+Pv|LmSlGrlbqJu29T`U+R;k&5CXjfm` zK{*Ep1r#CB~A6z!*(9aLjI z;ffK*Et6IL`nc~uPO|0|8234~!Yr6o?FEfKfy4o$F(8RUMmNHjioL5WGg$kb_9F?H tvO;VOuouwSzfe)F@8YeNWZ44=^hmc^#j-tGR*)0 diff --git a/net/tschipcraft/spawnanimations/fabric/sendConfig.class b/net/tschipcraft/spawnanimations/fabric/sendConfig.class index b05d2cfa5c1f1b4e4075b989fb1d216b5a3faa28..759bbb9deb0cc4e8332b93595e5d8f38e8e15d30 100644 GIT binary patch delta 1624 zcma)6O>k3H7(HK`OhoP})G<|2;J%t!q5298&g;m6d32II8c{N=h`og5s*Zv#&B4E$hvC zrde0Y<(xXAM_XjS9BL;!36FPKzkE>|Q=DIs*}HwI!ynhnFp@l*5*?gwXz6 zR!JY!N@_Y&DrhBkmra*7Ezh=wEn6dmO~#ptHB#7?vpgDudQp^Ywx6ty0M8dTv}v7qq=;E}c?h)&mx6iO^xN#%@DaisYJ=#YwrrdmGBA+nwWt z^2#DC$B7wx*S6&erIMa6${~WjDouzlNu#uAM;vg}(P6P$PRK_sFVC>V9@`|Liyd_s zWufPV>^x$7kuWCQ&MxDQi65OYIwo#8RXQ$ISAt#_7hEa%Bu=?-0&j@#Tq*Y%oHYi5 z3n*GV0efeQg!3Zq-YUO^3og8gw?)p~MDK|6?vB`dc;AJ0@d2S`G&7z_hW@k zUjYdpSrox)373TAxe@=2U*i;rAHbgc8nv_Bslw+R9cEI(74f?#sOWb#&Ktxq*NzM>K5pfBRbmhhZ0@dy9GPnh^47XH~q z{Buiq&Y1WYlGi4UE!X;9G8epTL_>NtzTg-@T|=a{)?M*4ZOx#G5iYjp;l~Rf)}R43 z{4uLVH}1d#sKWsKc!F8>Ac!nN7-fWx^*D+!jv<0mh+^^_Vz`J#TtXbv*nqEa7p~)O z+&}^g*og0O4{o9vKXZY9Lo5D38~#K)Rbw-G&_RB5QUqHlj&4e#hc;m=^`Ms?!o4(z z`)LQZ(NlO3S6Hscsyj=1g-6r;xAVOUaO-4w^?WYIK^|xOHg4B7&Exc=9L~+-Vshg= zKHND4+u$sd*x9ciuPxQ7>J|_AHhe7MgoIB(5>J|S3NRMf&asczJi@Sk-f+N_6Xo@T xyboT*rwlTBhBAx(GNxFMq0w2z0OK@_EA=HuAGZ=qcHI|ZOHO#XoiS(ae*=_NrU?K5 delta 680 zcmYk2&1(};6vfX=CV7*YOlG1@nxsu?#72@8lLUs2-t|42ax6r5?(t7!oK^hqskF^(cMQdX-^;nca;G z;v$(wQoV$J4?MU`CyicZM4*S>t5F&?!sPQv`eH08R|OWRX7tc^Z;W30;>wsnf>uO= ze)>*}35uIZQKYkGTAjv>hAHm3YNqw;xM7P~fe>9WgRWzTCFbdec|u*pO$`gUMeSCX zxJ_rQqp@Y&)o=&*1gv6yF`u5!mkQ~@`Ps=*LE=8WwW4B`HmxnOPGx^E`0XVP@hzVZpx*gi~*UJ^ooOsI7fZi7K`}O7r8#sK5riDm?`iy^9}cm4%kNF=Pq zPmu_=65_ivjV{XOeCM9?J?@w9PWvn?d;Y$E1TcY32~qyRqBkQ~EEq5{$<(2tA6eGE zp3Io(Ov0YBJKKLOaPMele6ufd50WyOB8CCxoA=ls!N~q?K zhBZ0+O$kYHUhHYQ6iG!iv5ulDR>=J%uhB9ETKn&Ok>_`6Y1M)}TDm}^_4C@LGnkP; z7a&}wRw7CiJ?(esy&=M|LMSGYh*d%@$NSJvuVM`R7AG7Bh{#zC-C`t*v0F@JG3DTl zgL4ip2<*m^m>@Y5>gl$i4=HFs2^vv>W;#IxwRFZNI-86&{^be#*C~t9Pc|qP5%WU* E0lY0aZMV;Co~TeAF0@*hX*{^C{#C~-{Lut+J`Ce2 zD>sP_(W~{a(IF8yW3)pl;+#=u{MKV_ooOCh!|ph=SkKHXNR}p=nK}RepYxr| zcg{cO5?5N3@BjYxCV=huW>JYt(Hh;*_Gk6RME4$RGBDPt(Mkm>4ieZ7_}1j z%h*ep`d`uN#7$XUUu;OatLZ61%~)2O`j=kXGRKW!D}bjl;DZnQ2%R>gGfH{fHI$cBR}oaYP}5E@N4l z2|b-N_oul*dY(f)=Z4A?x|wZ!!wTpQ9VrlcY>d2u;f6%+ogfs}Q(T)+3|6EX)++SU z;5_+B(Own_Hm-%SUyR4RQ7YyW)l!6xh`;1!|MPCuFSr%)AXSM+HbY3cBU8)mW*ilB zzG?3(gmH1%m$GjR1HEi`O`KP9bX@rT&2&<9`FF^t@uq@PcuP$CJN>gbV;=-zgSZq> zy_SS`#4r9{`8}Ld@GjmLYM_Na6a#^7^*k;p_y`vX)rYhRtu3n=qiv5D@_eHuToM-o zt@Nq*A@FPCW&R7>K>PsZ$!mx%^2UQNSynho2@B$o0!>)NeYl2Z+`txmhpqS#t@xQc`5W5tJ38Q(l_|%<1$p% z*kd}*9BWfDG-a7w~wAc>7m z7ov;>cCp;eJ`Xc&fV=hx7WT0^!2viAKF1ud_Rg-x4L{HHJ#7Dq^>_0sagEA@F>a*~ ZL0+p6;(#$+WxI#Nf6c4RzU}-a{{blHiM9X$ delta 666 zcmYjNOK*}v6g>kU{eTb32MSbbp*7kDsHGJ`8ei3&G4atDLrAMB#)y3YTHA_NrS(}K zwJ|p_u5_s;x?qEe39OAf|A3F3KftZk18t1S%$>P&&OP_sc^7}t?f$&}u>s%!))WTi zu-;ou{%Vt#&X83hDbG}&lx(^b^&XX!AMOrWH$w7B_p8*uY|zlO(+WkYyMl7U$Z8pd z!e-JX-;I4LEAQP=`xuTo;J~A!Jo)L9kPI?OJ zqBJ~FH6=ei2kkQ`I5EvO17^y&gv-rjRv{vX%!pOToUEC9?F+c-#5~IK#f+=#^4m;@ zZ{VgAi@2p=PURMIiJ4q6pExx)J6X)@SdvlifVwS9-fwC}CVYY9Lw-gZ6r+wujIP$* zh9EkaIj{{OzN`Rh43-wwkhi{irApL_$Bb?monEik*jQ)^USJvEq_9Cj7kngj!h=4T z*o`enV=G4B#}NcD%0?OT&tN<2x==zGWkj%y9z4JftYRmgV;5eb7jLLgMHC-UiJ^}E z{~R}1oM%%9CBhqyX~hbSZ^3vCrDF_NYPc5buc4B84efZ9G#kD7F}XQP0G2;Y`Mt|J zrghwb(h0U^3XlsV7>8JsOp>>U_ERkn-4tLS+{Hbf&0EvWhWvewVIlrR%KnIdm8gXx MPkGwO7~+oo1s{Zb1poj5 diff --git a/net/tschipcraft/spawnanimations/neoforge/Config.class b/net/tschipcraft/spawnanimations/neoforge/Config.class index 87d2187eb82b233e8edbb8a374d556ad72686561..bd87c570eff0604f53dfba4ea6e30e30cb172d20 100644 GIT binary patch delta 708 zcmZ`%$xgyh6g{t2q*#eVK*f=wXhlUFqj5mNdD^(qO~qJa6QRbci7S4<#F%~wuyf&F zUHLVx9PWFXxBxcy-gnNq@11+w7xmund;NNP2C$6%g71wb17mwtZ$~a#l8T zZP_^mUi7HwMTjAAd6BvMrwqrw$(=e}p{ah=Wog5p36;nKNJih28LmBT2GnRBS#n| zB3_Lct41WM5#yDKyn>0!j6!DAKU)FHlc>QIw>6!{3}(}qBZC1n|4BST0>ZiwD#K{G zW!OA__dtxzn`1P-f=C4+t-GvQFT*6#)Pmo%;6Bs_^NVyJKY`FCihLGcC+T+pebAL( zE!BsD0rZ*@>WXM6p{0mm2^}JKix?KMPsD)&H8Jo9x=}~53o?4(Ll})TKoB}Qk%~dX r2<F#b;M> delta 513 zcmZ`!OH#s65bXB|$O|z=X(5FcAEN}tfB6?bL4p@>=fd(Pxq!PIz%xJ=R=IGmo=MA| z6ta=j|OpA9o}BOT{(au$m59$&>z8svkdEfePanYY>%SunG?f zYxI|h(yu?DO~KC+I$6R-masWnhzz>36~i#jBvysEg&eje)=r3B?1wmDzzP;7mO^R) zxx?u`;XGbtP{;B=UrV?sJ^OE1)0Bt2jySeQRK$Gu6>7vrl+M+L*M)YwDBs7 diff --git a/net/tschipcraft/spawnanimations/neoforge/sendConfig.class b/net/tschipcraft/spawnanimations/neoforge/sendConfig.class index e84ee138da604d7dd96cf5b7873f01e10151ef13..9566d39b784cbe2d68b09678934b297c224d9450 100644 GIT binary patch delta 1649 zcma)5S!^3s6g|%!du(Uy#-_I820If-TX5Qhl+;<&WTJH#20@w+!;HqWSR<(=gpgY&pq#+ zb2UH6zt($yy7=89fNp#}>%Az1Lt0iHN^43^*GCmKo64wWO3(5?9L@ZIb3be2%VJe! zIfno2+`!tcRBw4oHjM^DZ7?*`Ol8Lmc}tTUI~k5@liKjOsmZBP*%;RInp{_2$(f^y zcL_DS%M<04H@R^u!_@y|TomH}?f)NFEE>wC)v3#p6+<7-ju>w2;eR=+ud|cIQ2F^= z-RNW3M)G6vD^^?VWp27( zf?^R?*@RjqWf-XmP08p(3fZRRiBDxnmiU}CD~KzYHO$bmf|FOnS(a%GCbbd~OP~{u zXsN5!`N^{}2BW-;JR>pA+SQJ;O-o5Q%)?^6kS=zZv|P#Zg1Cd__=0#$$TN)7G+Mbu zHz>yaO2qyWW+jN^aD&ZI&;_aTK{}B{KOiOqak1^EnrHVK|>FKI?0#Ax~ zO2X54hF|a~?744xywfc5HbdoMbwX`StJ$%}eP*7%7!fD=?-d8xY2GPy_&@aGBYZ64 zjD%{;@Z-`F`+{eD3E?b5oacOT{;erF~6!8M>r6K?? z;w5_X;AOl*5h`|UCo~naeqQTeD9quGIkcRC6udKW9-bN0+K~<`GEj`H4c={Sg7;eM z90p7HgO~6WvGGGI_z@dFTErhJ;UBn!r-+TuB+eJCBi9CXyWl}M4VhK;m z;1g`bEN;L#+=#*gHseR4`vnd7jf`DF6E0vY{zNnW#x^X|ci~103!sff(9UAm&NgBP zYeWZYMJMYgQqf z(K0oUhZCFU@%X?Dg#KBAImv*K4YXz*rgxx+*4-4}Lz!NR-DdY76B$wAHIi)oB6c@L zhBxpg&A-@}V;Q|6tP$~+2vfv6U?TBT@w-&yz$tPIaMRHr(EUF72CS!S9nIj=t|(gR O`58Sw$CvmD(SHF^wWyo` delta 732 zcmY+A%TE(g6vlrSW;$g$Ep4ShK`I#3SU|!f$Vy~mPyz<4qM|~5P(ehB1yNAIC!qMq zO%)DY!EI z(Ft4iZaNgre`B+z&dq*3;!GM{iZR{lF47B5h5q4+XulKj)!D>2XmQBlFx@)oO}S$n zbvQcvJagh~KQ(Nii2_;((MBO%6w@vE6Ks@u%cOgR2{tiH1$WuZB9%O03(wff z3+a$%JIh2_q52>>","color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"Max is 100","color":"red"}]}},{"text":" [\u270e]","color":"gray","clickEvent":{"action":"suggest_command","value":"/scoreboard players set @s ts.sa.distance "},"hoverEvent":{"action":"show_text","contents":"Edit"}}] execute if score #lock_distance ts.sa.settings matches 1 run tellraw @s [{"text":"Activation Distance <<< ","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"This setting is getting controlled globally and can't be changed here."}]}},{"score":{"name":"$activation_dist","objective":"ts.sa.settings"}},{"text":" blocks >>>"}] -execute if score $activation_mode ts.sa.settings matches 1 run tellraw @s ["",{"text":"Activation mode","bold":true},{"text":" "},{"text":"[>classic<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Out of range mobs will stay hidden until a player is in range."}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/classic"}},{"text":" | "},{"text":"[vanilla]","color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"Out of range mobs will spawn normally."}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/vanilla"}}] -execute if score $activation_mode ts.sa.settings matches 0 run tellraw @s ["",{"text":"Activation mode","bold":true},{"text":" "},{"text":"[classic]","color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"Out of range mobs will stay hidden until a player is in range."}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/classic"}},{"text":" | "},{"text":"[>vanilla<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Out of range mobs will spawn normally."}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/vanilla"}}] -execute if score $activation_mode ts.sa.settings matches -1 run tellraw @s [{"text":"Activation mode [classic] | [>vanilla<]","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 $activation_mode ts.sa.settings matches 2 run tellraw @s [{"text":"Activation mode [>classic<] | [vanilla]","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 $hide_armor ts.sa.settings matches 1 run tellraw @s ["",{"text":"Hide worn armor and tools","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Worn armor and tools will be hidden. "},{"text":"\n⚠ Note: This feature may impact worn armor and tool drop rates inside farms.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_hidearmorandtools"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hoverEvent":{"action":"show_text","contents":"Worn armor and tools will not be hidden."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_hidearmorandtools"}}] -execute if score $hide_armor ts.sa.settings matches 0 run tellraw @s ["",{"text":"Hide worn armor and tools","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hoverEvent":{"action":"show_text","contents":[{"text":"Worn armor and tools will be hidden. "},{"text":"\n⚠ Note: This feature may impact worn armor and tool drop rates inside farms.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_hidearmorandtools"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hoverEvent":{"action":"show_text","contents":"Worn armor and tools will not be hidden."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_hidearmorandtools"}}] -execute if score $hide_armor ts.sa.settings matches -1 run tellraw @s [{"text":"Hide worn armor and tools [✔] | [>❌<]","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 $hide_armor ts.sa.settings matches 2 run tellraw @s [{"text":"Hide worn armor and tools [>✔<] | [❌]","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 $play_unsupport ts.sa.settings matches 1 run tellraw @s ["",{"text":"Play animation on unsupported blocks","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"The block break animation is played on unsupported blocks. "},{"text":"\n⚠ Note: This could lead to unwanted block updates.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_allblocksupport"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hoverEvent":{"action":"show_text","contents":"The block break animation will not be played on unsupported blocks."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_allblocksupport"}}] -execute if score $play_unsupport ts.sa.settings matches 0 run tellraw @s ["",{"text":"Play animation on unsupported blocks","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hoverEvent":{"action":"show_text","contents":[{"text":"The block break animation is played on unsupported blocks. "},{"text":"\n⚠ Note: This could lead to unwanted block updates.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_allblocksupport"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hoverEvent":{"action":"show_text","contents":"The block break animation will not be played on unsupported blocks."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_allblocksupport"}}] -execute if score $play_unsupport ts.sa.settings matches -1 run tellraw @s [{"text":"Play animation on unsupported blocks [✔] | [>❌<]","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 $play_unsupport ts.sa.settings matches 2 run tellraw @s [{"text":"Play animation on unsupported blocks [>✔<] | [❌]","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 $activation_mode ts.sa.settings matches 1 run tellraw @s ["",{"text":"Activation Mode","bold":true},{"text":" "},{"text":"[>Classic<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Mobs outside the activation range remain hidden until a player is in range."}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/classic"}},{"text":" | "},{"text":"[Vanilla]","color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"Mobs outside the activation range spawn normally."}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/vanilla"}}] +execute if score $activation_mode ts.sa.settings matches 0 run tellraw @s ["",{"text":"Activation Mode","bold":true},{"text":" "},{"text":"[Classic]","color":"red","hoverEvent":{"action":"show_text","contents":[{"text":"Mobs outside the activation range remain hidden until a player is in range."}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/classic"}},{"text":" | "},{"text":"[>Vanilla<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"Mobs outside the activation range spawn normally."}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/vanilla"}}] +execute if score $activation_mode ts.sa.settings matches -1 run tellraw @s [{"text":"Activation Mode [Classic] | [>Vanilla<]","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 $activation_mode ts.sa.settings matches 2 run tellraw @s [{"text":"Activation Mode [>Classic<] | [Vanilla]","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 $enable_poof_anim ts.sa.settings matches 1 run tellraw @s ["",{"text":"Enable Poof Animation","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":"If enabled, some mobs, or mobs without a block to dig up from, will play the poof animation instead."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_poofanim"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hoverEvent":{"action":"show_text","contents":"Poof animation will not be played."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_poofanim"}}] +execute if score $enable_poof_anim ts.sa.settings matches 0 run tellraw @s ["",{"text":"Enable Poof Animation","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hoverEvent":{"action":"show_text","contents":"If enabled, some mobs, or mobs without a block to dig up from, will play the poof animation instead."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_poofanim"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hoverEvent":{"action":"show_text","contents":"Poof animation will not be played."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_poofanim"}}] +execute if score $enable_poof_anim ts.sa.settings matches -1 run tellraw @s [{"text":"Enable Poof Animation [✔] | [>❌<]","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 $enable_poof_anim ts.sa.settings matches 2 run tellraw @s [{"text":"Enable Poof Animation [>✔<] | [❌]","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 $play_sounds ts.sa.settings matches 1 run tellraw @s ["",{"text":"Play Animation Sounds","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":"If enabled, sounds will be played during the animation."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_playsounds"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hoverEvent":{"action":"show_text","contents":"Sounds will not be played."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_playsounds"}}] +execute if score $play_sounds ts.sa.settings matches 0 run tellraw @s ["",{"text":"Play Animation Sounds","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hoverEvent":{"action":"show_text","contents":"If enabled, sounds will be played during the animation."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_playsounds"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hoverEvent":{"action":"show_text","contents":"Sounds will not be played."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_playsounds"}}] +execute if score $play_sounds ts.sa.settings matches -1 run tellraw @s [{"text":"Play Animation Sounds [✔] | [>❌<]","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 $play_sounds ts.sa.settings matches 2 run tellraw @s [{"text":"Play Animation Sounds [>✔<] | [❌]","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 $hide_armor ts.sa.settings matches 1 run tellraw @s ["",{"text":"Hide Worn Armor and Tools","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, stores the worn armor and tools in the body, feet, or in some versions, leggings slot of a hidden entity. "},{"text":"\n⚠ Note: This may impact worn armor and tool drop rates from mob farms.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_hidearmorandtools"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hoverEvent":{"action":"show_text","contents":"Worn armor and tools will not be hidden."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_hidearmorandtools"}}] +execute if score $hide_armor ts.sa.settings matches 0 run tellraw @s ["",{"text":"Hide Worn Armor and Tools","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, stores the worn armor and tools in the body, feet, or in some versions, leggings slot of a hidden entity. "},{"text":"\n⚠ Note: This may impact worn armor and tool drop rates from mob farms when enabled.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_hidearmorandtools"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hoverEvent":{"action":"show_text","contents":"Worn armor and tools will not be hidden."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_hidearmorandtools"}}] +execute if score $hide_armor ts.sa.settings matches -1 run tellraw @s [{"text":"Hide Worn Armor and Tools [✔] | [>❌<]","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 $hide_armor ts.sa.settings matches 2 run tellraw @s [{"text":"Hide Worn Armor and Tools [>✔<] | [❌]","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 $hide_emissive ts.sa.settings matches 1 run tellraw @s ["",{"text":"Hide Emissive Mob Layers","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, emissive layers of some mobs (e.g., Endermen, Spiders, and Cave Spiders), or with Pehkui all mobs, will be hidden by shrinking them."},{"text":"\n⚠ Note: This may decrease the efficiency of mob farms due to the changed hitbox size for hidden entities when Pehkui is not installed and the feature is enabled.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_hideemissive"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hoverEvent":{"action":"show_text","contents":"Emissive layers will not be hidden."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_hideemissive"}}] +execute if score $hide_emissive ts.sa.settings matches 0 run tellraw @s ["",{"text":"Hide Emissive Mob Layers","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, emissive layers of some mobs (e.g., Endermen, Spiders, and Cave Spiders), or with Pehkui all mobs, will be hidden by shrinking them."},{"text":"\n⚠ Note: This may decrease the efficiency of mob farms due to the changed hitbox size for hidden entities when Pehkui is not installed and the feature is enabled.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_hideemissive"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hoverEvent":{"action":"show_text","contents":"Emissive layers will not be hidden."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_hideemissive"}}] +execute if score $hide_emissive ts.sa.settings matches -1 run tellraw @s [{"text":"Hide Emissive Mob Layers [✔] | [>❌<]","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 $hide_emissive ts.sa.settings matches 2 run tellraw @s [{"text":"Hide Emissive Mob Layers [>✔<] | [❌]","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 $play_sounds ts.sa.settings matches 1..2 if score $play_unsupport ts.sa.settings matches 1 run tellraw @s ["",{"text":"Play Animation on Unsupported Blocks","bold":true},{"text":" "},{"text":"[>✔<]","color":"green","bold":true,"hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, the block breaking animation plays on blocks that are not hard-coded into the data pack. "},{"text":"\n⚠ Note: This could lead to unwanted block updates.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_allblocksupport"}},{"text":" | "},{"text":"[❌]","color":"dark_red","hoverEvent":{"action":"show_text","contents":"The block breaking animation will not be played on unsupported blocks."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_allblocksupport"}}] +execute if score $play_sounds ts.sa.settings matches 1..2 if score $play_unsupport ts.sa.settings matches 0 run tellraw @s ["",{"text":"Play Animation on Unsupported Blocks","bold":true},{"text":" "},{"text":"[✔]","color":"dark_green","hoverEvent":{"action":"show_text","contents":[{"text":"If enabled, the block breaking animation plays on blocks that are not hard-coded into the data pack. "},{"text":"\n⚠ Note: This could lead to unwanted block updates.","color":"gold"}]},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/enable_allblocksupport"}},{"text":" | "},{"text":"[>❌<]","color":"red","bold":true,"hoverEvent":{"action":"show_text","contents":"The block breaking animation will not be played on unsupported blocks."},"clickEvent":{"action":"run_command","value":"/function spawnanimations:settings/disable_allblocksupport"}}] +execute if score $play_sounds ts.sa.settings matches 1..2 if score $play_unsupport ts.sa.settings matches -1 run tellraw @s [{"text":"Play Animation on Unsupported Blocks [✔] | [>❌<]","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 $play_sounds ts.sa.settings matches 1..2 if score $play_unsupport ts.sa.settings matches 2 run tellraw @s [{"text":"Play Animation on Unsupported Blocks [>✔<] | [❌]","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 $play_sounds ts.sa.settings matches -1..0 run tellraw @s [{"text":"Play Animation on Unsupported Blocks [✔] | [>❌<]","bold":false,"color":"gray","hoverEvent":{"action":"show_text","contents":[{"text":"Enable [Play Animation Sounds] first."}]}}] function spawnanimations:settings/hide_feedback/main playsound minecraft:block.dispenser.dispense master @s ~ ~ ~ 0.2 2 diff --git a/src/main/java/net/tschipcraft/spawnanimations/fabric/Config.java b/src/main/java/net/tschipcraft/spawnanimations/fabric/Config.java index 7f5fcf7..3072c52 100644 --- a/src/main/java/net/tschipcraft/spawnanimations/fabric/Config.java +++ b/src/main/java/net/tschipcraft/spawnanimations/fabric/Config.java @@ -29,6 +29,10 @@ public enum mode { public static int activation_distance = 0; @Entry public static mode activation_mode = mode.WORLD; + @Entry + public static bool enable_poof_animation = bool.WORLD; + @Entry + public static bool play_animation_sounds = bool.WORLD; @Comment public static Comment empty2; @@ -36,6 +40,8 @@ public enum mode { @Entry public static bool hide_worn_armor_and_tools = bool.WORLD; @Entry + public static bool hide_emissive_mob_layers = bool.WORLD; + @Entry public static bool play_animation_on_unsupported_blocks = bool.WORLD; } diff --git a/src/main/java/net/tschipcraft/spawnanimations/fabric/sendConfig.java b/src/main/java/net/tschipcraft/spawnanimations/fabric/sendConfig.java index 8dc9100..a22eaa2 100644 --- a/src/main/java/net/tschipcraft/spawnanimations/fabric/sendConfig.java +++ b/src/main/java/net/tschipcraft/spawnanimations/fabric/sendConfig.java @@ -8,6 +8,7 @@ public class sendConfig { public static void sendConfig(MinecraftServer server) { sendCommand("scoreboard objectives add ts.sa.settings dummy", server); + if (Config.activation_distance == 0) { sendCommand("execute unless score $activation_dist ts.sa.settings matches 1..100 run scoreboard players set $activation_dist ts.sa.settings 20", server); sendCommand("execute if score #lock_distance ts.sa.settings matches 1 run scoreboard players set #lock_distance ts.sa.settings 0", server); @@ -15,7 +16,6 @@ public static void sendConfig(MinecraftServer server) { sendCommand("scoreboard players set $activation_dist ts.sa.settings " + Config.activation_distance, server); sendCommand("scoreboard players set #lock_distance ts.sa.settings 1", server); } - if (Config.activation_mode == Config.mode.CLASSIC) { sendCommand("scoreboard players set $activation_mode ts.sa.settings 2", server); } else if (Config.activation_mode == Config.mode.VANILLA) { @@ -24,6 +24,21 @@ public static void sendConfig(MinecraftServer server) { sendCommand("execute if score $activation_mode ts.sa.settings matches -1 run scoreboard players set $activation_mode ts.sa.settings 0", server); sendCommand("execute if score $activation_mode ts.sa.settings matches 2 run scoreboard players set $activation_mode ts.sa.settings 1", server); } + if (Config.enable_poof_animation == Config.bool.YES) { + sendCommand("scoreboard players set $enable_poof_anim ts.sa.settings 2", server); + } else if (Config.enable_poof_animation == Config.bool.NO) { + sendCommand("scoreboard players set $enable_poof_anim ts.sa.settings -1", server); + } else { + sendCommand("execute if score $enable_poof_anim ts.sa.settings matches -1 run scoreboard players set $enable_poof_anim ts.sa.settings 0", server); + sendCommand("execute if score $enable_poof_anim ts.sa.settings matches 2 run scoreboard players set $enable_poof_anim ts.sa.settings 1", server); + } + if (Config.play_animation_sounds == Config.bool.YES) { + sendCommand("scoreboard players set $play_sounds ts.sa.settings 2", server); + } else if (Config.play_animation_sounds == Config.bool.NO) { + sendCommand("scoreboard players set $play_sounds ts.sa.settings -1", server); + } else { + sendCommand("execute if score $play_sounds ts.sa.settings matches -1 run scoreboard players set $play_sounds ts.sa.settings 0", server); + sendCommand("execute if score $play_sounds ts.sa.settings matches 2 run scoreboard players set $play_sounds ts.sa.settings 1", server); if (Config.hide_worn_armor_and_tools == Config.bool.YES) { sendCommand("scoreboard players set $hide_armor ts.sa.settings 2", server); @@ -33,6 +48,14 @@ public static void sendConfig(MinecraftServer server) { sendCommand("execute if score $hide_armor ts.sa.settings matches -1 run scoreboard players set $hide_armor ts.sa.settings 0", server); sendCommand("execute if score $hide_armor ts.sa.settings matches 2 run scoreboard players set $hide_armor ts.sa.settings 1", server); } + if (Config.hide_emissive_mob_layers == Config.bool.YES) { + sendCommand("scoreboard players set $hide_emissive ts.sa.settings 2", server); + } else if (Config.hide_emissive_mob_layers == Config.bool.NO) { + sendCommand("scoreboard players set $hide_emissive ts.sa.settings -1", server); + } else { + sendCommand("execute if score $hide_emissive ts.sa.settings matches -1 run scoreboard players set $hide_emissive ts.sa.settings 0", server); + sendCommand("execute if score $hide_emissive ts.sa.settings matches 2 run scoreboard players set $hide_emissive ts.sa.settings 1", server); + } if (Config.play_animation_on_unsupported_blocks == Config.bool.YES) { sendCommand("scoreboard players set $play_unsupport ts.sa.settings 2", server); } else if (Config.play_animation_on_unsupported_blocks == Config.bool.NO) { diff --git a/src/main/java/net/tschipcraft/spawnanimations/forge/Config.java b/src/main/java/net/tschipcraft/spawnanimations/forge/Config.java index d06f21e..5a3bc42 100644 --- a/src/main/java/net/tschipcraft/spawnanimations/forge/Config.java +++ b/src/main/java/net/tschipcraft/spawnanimations/forge/Config.java @@ -29,6 +29,10 @@ public enum mode { public static int activation_distance = 0; @Entry public static mode activation_mode = mode.WORLD; + @Entry + public static bool enable_poof_animation = bool.WORLD; + @Entry + public static bool play_animation_sounds = bool.WORLD; @Comment public static Comment empty2; @@ -36,6 +40,8 @@ public enum mode { @Entry public static bool hide_worn_armor_and_tools = bool.WORLD; @Entry + public static bool hide_emissive_mob_layers = bool.WORLD; + @Entry public static bool play_animation_on_unsupported_blocks = bool.WORLD; } diff --git a/src/main/java/net/tschipcraft/spawnanimations/forge/sendConfig.java b/src/main/java/net/tschipcraft/spawnanimations/forge/sendConfig.java index 84f7016..4684db2 100644 --- a/src/main/java/net/tschipcraft/spawnanimations/forge/sendConfig.java +++ b/src/main/java/net/tschipcraft/spawnanimations/forge/sendConfig.java @@ -8,6 +8,7 @@ public class sendConfig { public static void sendConfig(MinecraftServer server) { sendCommand("scoreboard objectives add ts.sa.settings dummy", server); + if (Config.activation_distance == 0) { sendCommand("execute unless score $activation_dist ts.sa.settings matches 1..100 run scoreboard players set $activation_dist ts.sa.settings 20", server); sendCommand("execute if score #lock_distance ts.sa.settings matches 1 run scoreboard players set #lock_distance ts.sa.settings 0", server); @@ -15,7 +16,6 @@ public static void sendConfig(MinecraftServer server) { sendCommand("scoreboard players set $activation_dist ts.sa.settings " + Config.activation_distance, server); sendCommand("scoreboard players set #lock_distance ts.sa.settings 1", server); } - if (Config.activation_mode == Config.mode.CLASSIC) { sendCommand("scoreboard players set $activation_mode ts.sa.settings 2", server); } else if (Config.activation_mode == Config.mode.VANILLA) { @@ -24,6 +24,21 @@ public static void sendConfig(MinecraftServer server) { sendCommand("execute if score $activation_mode ts.sa.settings matches -1 run scoreboard players set $activation_mode ts.sa.settings 0", server); sendCommand("execute if score $activation_mode ts.sa.settings matches 2 run scoreboard players set $activation_mode ts.sa.settings 1", server); } + if (Config.enable_poof_animation == Config.bool.YES) { + sendCommand("scoreboard players set $enable_poof_anim ts.sa.settings 2", server); + } else if (Config.enable_poof_animation == Config.bool.NO) { + sendCommand("scoreboard players set $enable_poof_anim ts.sa.settings -1", server); + } else { + sendCommand("execute if score $enable_poof_anim ts.sa.settings matches -1 run scoreboard players set $enable_poof_anim ts.sa.settings 0", server); + sendCommand("execute if score $enable_poof_anim ts.sa.settings matches 2 run scoreboard players set $enable_poof_anim ts.sa.settings 1", server); + } + if (Config.play_animation_sounds == Config.bool.YES) { + sendCommand("scoreboard players set $play_sounds ts.sa.settings 2", server); + } else if (Config.play_animation_sounds == Config.bool.NO) { + sendCommand("scoreboard players set $play_sounds ts.sa.settings -1", server); + } else { + sendCommand("execute if score $play_sounds ts.sa.settings matches -1 run scoreboard players set $play_sounds ts.sa.settings 0", server); + sendCommand("execute if score $play_sounds ts.sa.settings matches 2 run scoreboard players set $play_sounds ts.sa.settings 1", server); if (Config.hide_worn_armor_and_tools == Config.bool.YES) { sendCommand("scoreboard players set $hide_armor ts.sa.settings 2", server); @@ -33,6 +48,14 @@ public static void sendConfig(MinecraftServer server) { sendCommand("execute if score $hide_armor ts.sa.settings matches -1 run scoreboard players set $hide_armor ts.sa.settings 0", server); sendCommand("execute if score $hide_armor ts.sa.settings matches 2 run scoreboard players set $hide_armor ts.sa.settings 1", server); } + if (Config.hide_emissive_mob_layers == Config.bool.YES) { + sendCommand("scoreboard players set $hide_emissive ts.sa.settings 2", server); + } else if (Config.hide_emissive_mob_layers == Config.bool.NO) { + sendCommand("scoreboard players set $hide_emissive ts.sa.settings -1", server); + } else { + sendCommand("execute if score $hide_emissive ts.sa.settings matches -1 run scoreboard players set $hide_emissive ts.sa.settings 0", server); + sendCommand("execute if score $hide_emissive ts.sa.settings matches 2 run scoreboard players set $hide_emissive ts.sa.settings 1", server); + } if (Config.play_animation_on_unsupported_blocks == Config.bool.YES) { sendCommand("scoreboard players set $play_unsupport ts.sa.settings 2", server); } else if (Config.play_animation_on_unsupported_blocks == Config.bool.NO) { diff --git a/src/main/java/net/tschipcraft/spawnanimations/neoforge/Config.java b/src/main/java/net/tschipcraft/spawnanimations/neoforge/Config.java index 84cff0a..7b5a8c5 100644 --- a/src/main/java/net/tschipcraft/spawnanimations/neoforge/Config.java +++ b/src/main/java/net/tschipcraft/spawnanimations/neoforge/Config.java @@ -29,6 +29,10 @@ public enum mode { public static int activation_distance = 0; @Entry public static mode activation_mode = mode.WORLD; + @Entry + public static bool enable_poof_animation = bool.WORLD; + @Entry + public static bool play_animation_sounds = bool.WORLD; @Comment public static Comment empty2; @@ -36,6 +40,8 @@ public enum mode { @Entry public static bool hide_worn_armor_and_tools = bool.WORLD; @Entry + public static bool hide_emissive_mob_layers = bool.WORLD; + @Entry public static bool play_animation_on_unsupported_blocks = bool.WORLD; } diff --git a/src/main/java/net/tschipcraft/spawnanimations/neoforge/sendConfig.java b/src/main/java/net/tschipcraft/spawnanimations/neoforge/sendConfig.java index aea2e46..e499ac2 100644 --- a/src/main/java/net/tschipcraft/spawnanimations/neoforge/sendConfig.java +++ b/src/main/java/net/tschipcraft/spawnanimations/neoforge/sendConfig.java @@ -8,6 +8,7 @@ public class sendConfig { public static void sendConfig(MinecraftServer server) { sendCommand("scoreboard objectives add ts.sa.settings dummy", server); + if (Config.activation_distance == 0) { sendCommand("execute unless score $activation_dist ts.sa.settings matches 1..100 run scoreboard players set $activation_dist ts.sa.settings 20", server); sendCommand("execute if score #lock_distance ts.sa.settings matches 1 run scoreboard players set #lock_distance ts.sa.settings 0", server); @@ -15,7 +16,6 @@ public static void sendConfig(MinecraftServer server) { sendCommand("scoreboard players set $activation_dist ts.sa.settings " + Config.activation_distance, server); sendCommand("scoreboard players set #lock_distance ts.sa.settings 1", server); } - if (Config.activation_mode == Config.mode.CLASSIC) { sendCommand("scoreboard players set $activation_mode ts.sa.settings 2", server); } else if (Config.activation_mode == Config.mode.VANILLA) { @@ -24,6 +24,21 @@ public static void sendConfig(MinecraftServer server) { sendCommand("execute if score $activation_mode ts.sa.settings matches -1 run scoreboard players set $activation_mode ts.sa.settings 0", server); sendCommand("execute if score $activation_mode ts.sa.settings matches 2 run scoreboard players set $activation_mode ts.sa.settings 1", server); } + if (Config.enable_poof_animation == Config.bool.YES) { + sendCommand("scoreboard players set $enable_poof_anim ts.sa.settings 2", server); + } else if (Config.enable_poof_animation == Config.bool.NO) { + sendCommand("scoreboard players set $enable_poof_anim ts.sa.settings -1", server); + } else { + sendCommand("execute if score $enable_poof_anim ts.sa.settings matches -1 run scoreboard players set $enable_poof_anim ts.sa.settings 0", server); + sendCommand("execute if score $enable_poof_anim ts.sa.settings matches 2 run scoreboard players set $enable_poof_anim ts.sa.settings 1", server); + } + if (Config.play_animation_sounds == Config.bool.YES) { + sendCommand("scoreboard players set $play_sounds ts.sa.settings 2", server); + } else if (Config.play_animation_sounds == Config.bool.NO) { + sendCommand("scoreboard players set $play_sounds ts.sa.settings -1", server); + } else { + sendCommand("execute if score $play_sounds ts.sa.settings matches -1 run scoreboard players set $play_sounds ts.sa.settings 0", server); + sendCommand("execute if score $play_sounds ts.sa.settings matches 2 run scoreboard players set $play_sounds ts.sa.settings 1", server); if (Config.hide_worn_armor_and_tools == Config.bool.YES) { sendCommand("scoreboard players set $hide_armor ts.sa.settings 2", server); @@ -33,6 +48,14 @@ public static void sendConfig(MinecraftServer server) { sendCommand("execute if score $hide_armor ts.sa.settings matches -1 run scoreboard players set $hide_armor ts.sa.settings 0", server); sendCommand("execute if score $hide_armor ts.sa.settings matches 2 run scoreboard players set $hide_armor ts.sa.settings 1", server); } + if (Config.hide_emissive_mob_layers == Config.bool.YES) { + sendCommand("scoreboard players set $hide_emissive ts.sa.settings 2", server); + } else if (Config.hide_emissive_mob_layers == Config.bool.NO) { + sendCommand("scoreboard players set $hide_emissive ts.sa.settings -1", server); + } else { + sendCommand("execute if score $hide_emissive ts.sa.settings matches -1 run scoreboard players set $hide_emissive ts.sa.settings 0", server); + sendCommand("execute if score $hide_emissive ts.sa.settings matches 2 run scoreboard players set $hide_emissive ts.sa.settings 1", server); + } if (Config.play_animation_on_unsupported_blocks == Config.bool.YES) { sendCommand("scoreboard players set $play_unsupport ts.sa.settings 2", server); } else if (Config.play_animation_on_unsupported_blocks == Config.bool.NO) { diff --git a/wiki/settings.svg b/wiki/settings.svg index 24a2408..b8bcfeb 100644 --- a/wiki/settings.svg +++ b/wiki/settings.svg @@ -1,4 +1,4 @@ - +