Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 1 addition & 29 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -331,35 +331,7 @@ jobs:
files: |
./${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ env.MC_HUMAN_VERSION_RANGE }}-datapack.zip

- name: Upload Forge mod version to CurseForge # Same reason as above
id: upload_forge_curseforge_mod
uses: Kir-Antipov/mc-publish@v3.3
if: steps.check_mod_folder.outputs.files_exists == 'true' && github.event.inputs.dry_run == 'false'
with:
curseforge-id: 1223719
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
game-versions: |
>=1.17 <=1.21.5
game-version-filter: any
fail-mode: skip

name: "Release v${{ github.event.inputs.tag }}"
version: ${{ github.event.inputs.tag }}+mod
changelog-file: CHANGES.md

dependencies: |
catalogue(optional){curseforge:459701}
midnightlib(optional){curseforge:488090}
pehkui(optional){curseforge:319596}
java: |
Java 21
Java 17
loaders: |
forge
files: |
./${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ env.MC_HUMAN_VERSION_RANGE }}-mod.jar

- name: Upload mod version to CurseForge
- name: Upload mod version to CurseForge # Duplicate uploads sadly don't work on CurseForge
id: upload_curseforge_mod
uses: Kir-Antipov/mc-publish@v3.3
if: steps.check_mod_folder.outputs.files_exists == 'true' && github.event.inputs.dry_run == 'false'
Expand Down
2 changes: 1 addition & 1 deletion .spyglassrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"env": {
"gameVersion": "1.21.5",
"gameVersion": "1.21.9",
"exclude": []
}
}
19 changes: 7 additions & 12 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
- **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 the poof animation ([#40](https://github.com/Tschipcraft/spawnanimations/issues/40)), animation sounds (closes [#39](https://github.com/Tschipcraft/spawnanimations/issues/39)), reducing the number of particles emitted by hidden Endermen, and hiding emissive mob layers ([#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 by updating batch activation logic. The whole project is now up to 45% 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
- Removed the Hoglin from the dig up animation
- Fixed most compatibility issues with [Hostile Mobs Improve Over Time](https://modrinth.com/project/ku4JD9TH) by adding missing tag recovery logic when preparing an entity for hiding. This should generally improve compatibility with other packs that override entity tags (closes [#26](https://github.com/Tschipcraft/spawnanimations/issues/26))
- Fixed poof animation playing multiple times when "Play Animation on Unsupported Blocks" is off
- Fixed possibility of hidden falling mobs losing their fall distance NBT when appearing
- Fixed v0 save format not correctly upgrading to v1 in 1.20.5 and 1.20.6 (precisely from 24w11a to 24w20a)
- Changed exclude tag from `exclude` to `ts.sa.exclude`
- **Added support for Minecraft 1.21.9** 🥉
- Updated to work with the new pack.mcmeta syntax
- Raised entity processing limits to resolve mob farm complications (Thanks @Fyoncle)
- Fixed Vanilla activation mode behaving the same way as Classic for activation distances below 25 (closes [#46](https://github.com/Tschipcraft/spawnanimations/issues/46))
- Added native support for snow blocks when playing the dig up animation
- Removed native support for some container blocks
- Expanded and reorganized tag lists to include convention tags for improved mod compatibility
2 changes: 1 addition & 1 deletion META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version="${version}+mod"
displayName="Spawn Animations"
description='''Hostile mobs dig out of the ground or poof into existence when they spawn!

§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.
§lWorks with:§r Zombies, Husks, Drowned, Skeletons, Strays, Bogged, Wither Skeletons, Spiders, Cave Spiders, Creepers, Endermen, Slimes, Magma Cubes, Zombified Piglins, Striders and Giants.

This data pack is designed to be as unintrusive as possible. Hidden entities including their worn armor and tools will only be invisible and silent.

Expand Down
2 changes: 1 addition & 1 deletion META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ version="${version}+mod"
displayName="Spawn Animations"
description='''Hostile mobs dig out of the ground or poof into existence when they spawn!

§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.
§lWorks with:§r Zombies, Husks, Drowned, Skeletons, Strays, Bogged, Wither Skeletons, Spiders, Cave Spiders, Creepers, Endermen, Slimes, Magma Cubes, Zombified Piglins, Striders and Giants.

This data pack is designed to be as unintrusive as possible. Hidden entities including their worn armor and tools will only be invisible and silent.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Hostile mobs dig out of the ground or poof into existence when they spawn.

**Works with:**
Zombies, Husks, Drowned, Skeletons, Strays, Bogged, Spiders, Cave Spiders, Creepers, Slimes, Magma Cubes, Wither Skeletons, Hoglins, Zombified Piglins, Striders, Enderman and Giants.
Zombies, Husks, Drowned, Skeletons, Strays, Bogged, Wither Skeletons, Spiders, Cave Spiders, Creepers, Endermen, Slimes, Magma Cubes, Zombified Piglins, Striders and Giants.

This data pack/mod is designed to be as unintrusive as possible. Hidden entities including their worn armor and tools will only be invisible and silent.

Expand Down
6 changes: 3 additions & 3 deletions assets/spawnanimations/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"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.",
"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, Wither Skeletons, Spiders, Cave Spiders, Creepers, Endermen, Slimes, Magma Cubes, Zombified Piglins, Striders 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, Wither Skeletons, Spiders, Cave Spiders, Creepers, Endermen, Slimes, Magma Cubes, Zombified Piglins, Striders 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": "",
Expand All @@ -17,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: 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.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 for naturally spawned mobs.",
"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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ execute if block ~ ~ ~ minecraft:cobblestone run particle block{block_state:"min
execute if block ~ ~ ~ minecraft:hay_block run particle block{block_state:"minecraft:hay_block"} ~ ~0.2 ~ 0.1 0 0.1 1 9 normal
execute if block ~ ~ ~ minecraft:gravel run particle block{block_state:"minecraft:gravel"} ~ ~0.2 ~ 0.1 0 0.1 1 9 normal
execute if block ~ ~0.3 ~ minecraft:snow run particle block{block_state:"minecraft:snow"} ~ ~0.4 ~ 0.1 0 0.1 1 9 normal
execute if block ~ ~ ~ minecraft:snow_block unless block ~ ~0.3 ~ minecraft:snow run particle block{block_state:"minecraft:snow_block"} ~ ~0.2 ~ 0.1 0 0.1 1 9 normal
execute if block ~ ~ ~ #minecraft:ice run particle block{block_state:"minecraft:ice"} ~ ~0.2 ~ 0.1 0 0.1 1 9 normal
execute if block ~ ~ ~ minecraft:obsidian run particle block{block_state:"minecraft:obsidian"} ~ ~0.2 ~ 0.1 0 0.1 1 9 normal
execute if block ~ ~ ~ minecraft:slime_block run particle block{block_state:"minecraft:slime_block"} ~ ~0.2 ~ 0.1 0 0.1 1 9 normal

# End
execute if block ~ ~ ~ minecraft:end_stone run particle block{block_state:"minecraft:end_stone"} ~ ~0.2 ~ 0.1 0 0.1 1 9 normal
# Chorus

# Nether
execute if block ~ ~ ~ #minecraft:base_stone_nether run particle block{block_state:"minecraft:netherrack"} ~ ~0.2 ~ 0.1 0 0.1 1 9 normal
Expand All @@ -35,13 +35,6 @@ execute if block ~ ~ ~ minecraft:nether_bricks run particle block{block_state:"m
execute if block ~ ~ ~ #minecraft:soul_fire_base_blocks run particle block{block_state:"minecraft:soul_sand"} ~ ~0.2 ~ 0.1 0 0.1 1 9 normal
execute if block ~ ~ ~ #minecraft:soul_fire_base_blocks run particle minecraft:soul ~ ~0.2 ~ 0.1 0.1 0.1 0.01 1 normal

# Containers
execute if block ~ ~ ~ minecraft:chest run particle block{block_state:"minecraft:chest"} ~ ~0.2 ~ 0.1 0 0.1 1 3 normal
execute if block ~ ~ ~ minecraft:trapped_chest run particle block{block_state:"minecraft:trapped_chest"} ~ ~0.2 ~ 0.1 0 0.1 1 3 normal
execute if block ~ ~ ~ minecraft:ender_chest run particle block{block_state:"minecraft:ender_chest"} ~ ~0.2 ~ 0.1 0 0.1 1 1 normal
execute if block ~ ~ ~ minecraft:hopper run particle block{block_state:"minecraft:hopper"} ~ ~0.2 ~ 0.1 0 0.1 1 3 normal
execute if block ~ ~ ~ minecraft:beacon run particle block{block_state:"minecraft:glass"} ~ ~0.2 ~ 0.1 0 0.1 1 3 normal

# Extra mob-specific particles
execute positioned ~ ~ ~ if entity @s[type=#spawnanimations:particles/nether_mob] run particle lava ~ ~0.4 ~ 0.1 0 0.1 0.01 1 normal
execute positioned ~ ~ ~ if entity @s[type=#spawnanimations:particles/end_mob] run particle dragon_breath ~ ~0.2 ~ 0.1 0 0.1 0.01 5 normal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ execute as @s[scores={ts.sa.timer=-300..99}] run function spawnanimations:intern
execute as @s[scores={ts.sa.e.nbt.Sil=0},tag=!ts.sa.verify] run function spawnanimations:internal/animation/dig_up/recover_tags/hidden
tag @s[scores={ts.sa.timer=100}] add ts.sa.verified

# Exclude out of range entities in Vanilla activation mode
execute if score $activation_mode ts.sa.settings matches -1..0 if score $activation_dist ts.sa.settings matches 1..24 as @s[tag=!ts.sa.verified,tag=!ts.sa.verify,tag=!ts.sa.to_verify] unless entity @a[gamemode=!spectator,distance=..25] run tag @s add ts.sa.verified
execute if score $activation_mode ts.sa.settings matches -1..0 if score $activation_dist ts.sa.settings matches 25.. as @s[tag=!ts.sa.verified,tag=!ts.sa.verify,tag=!ts.sa.to_verify] unless entity @a[gamemode=!spectator,distance=..100] run tag @s add ts.sa.verified

# Exclude entities that have the glowing, levitation or invisibility potion effect, are riding another entity, or are burning
execute as @s[tag=!ts.sa.verify,tag=!ts.sa.to_verify,predicate=!spawnanimations:exclude] run tag @s add ts.sa.verified
tag @s[tag=!ts.sa.verified,tag=!ts.sa.verify,tag=!ts.sa.to_verify,predicate=!spawnanimations:exclude] add ts.sa.verified

# Exclude silent or no AI mobs
execute as @s[tag=!ts.sa.verified,tag=!ts.sa.verify,tag=!ts.sa.to_verify,nbt={Silent:1b}] run tag @s add ts.sa.verified
execute as @s[tag=!ts.sa.verified,tag=!ts.sa.verify,tag=!ts.sa.to_verify,nbt={NoAI:1b}] run tag @s add ts.sa.verified
tag @s[tag=!ts.sa.verified,tag=!ts.sa.verify,tag=!ts.sa.to_verify,nbt={Silent:1b}] add ts.sa.verified
tag @s[tag=!ts.sa.verified,tag=!ts.sa.verify,tag=!ts.sa.to_verify,nbt={NoAI:1b}] add ts.sa.verified

# Hide the entity
execute as @s[tag=!ts.sa.verified,tag=!ts.sa.verify,tag=!ts.sa.to_verify] run function spawnanimations:internal/entity/hide
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ execute if block ~ ~ ~ minecraft:cobblestone run playsound minecraft:block.stone
# Other
execute if block ~ ~ ~ minecraft:hay_block run playsound minecraft:block.grass.break hostile @a ~ ~ ~ 0.85 0.6
execute if block ~ ~ ~ #minecraft:wool run playsound minecraft:block.wool.break hostile @a ~ ~ ~ 0.85 0.6
execute if block ~ ~0.2 ~ minecraft:snow run playsound minecraft:block.snow.break hostile @a ~ ~ ~ 0.85 0.6
execute if block ~ ~0.3 ~ minecraft:snow run playsound minecraft:block.snow.break hostile @a ~ ~ ~ 0.85 0.6
execute if block ~ ~ ~ minecraft:snow_block unless block ~ ~0.3 ~ minecraft:snow run playsound minecraft:block.snow.break hostile @a ~ ~ ~ 0.85 0.5
execute if block ~ ~ ~ #minecraft:ice run playsound minecraft:block.glass.break hostile @a ~ ~ ~ 0.85 0.7
execute if block ~ ~ ~ minecraft:obsidian run playsound minecraft:block.stone.break hostile @a ~ ~ ~ 0.85 0.4
execute if block ~ ~ ~ minecraft:slime_block run playsound minecraft:block.slime_block.break hostile @a ~ ~ ~ 0.85 0.4
Expand All @@ -31,12 +32,4 @@ execute if block ~ ~ ~ #minecraft:nylium run playsound minecraft:block.wart_bloc
execute if block ~ ~ ~ minecraft:nether_bricks run playsound minecraft:block.nether_bricks.break hostile @a ~ ~ ~ 0.85 0.6
execute if block ~ ~ ~ #minecraft:soul_fire_base_blocks run playsound minecraft:block.soul_sand.break hostile @a ~ ~ ~ 0.85 0.6

# Containers
execute if block ~ ~ ~ minecraft:chest run playsound minecraft:block.wood.break hostile @a ~ ~ ~ 0.85 0.6
execute if block ~ ~ ~ minecraft:trapped_chest run playsound minecraft:block.wood.break hostile @a ~ ~ ~ 0.85 0.6
execute if block ~ ~ ~ minecraft:ender_chest run playsound minecraft:block.ender_chest.open hostile @a ~ ~ ~ 0.85 0.4
execute if block ~ ~ ~ minecraft:hopper run playsound minecraft:block.metal.break hostile @a ~ ~ ~ 0.85 0.6
execute if block ~ ~ ~ minecraft:beacon run playsound minecraft:block.glass.break hostile @a ~ ~ ~ 0.85 0.4


execute if block ~ ~ ~ minecraft:lava run playsound minecraft:block.lava.pop hostile @a ~ ~ ~ 0.85 0.6
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ execute if block ~ ~ ~ minecraft:cobblestone run playsound minecraft:block.stone
# Other
execute if block ~ ~ ~ minecraft:hay_block run playsound minecraft:block.grass.break hostile @a ~ ~ ~ 0.85 0.9
execute if block ~ ~ ~ #minecraft:wool run playsound minecraft:block.wool.break hostile @a ~ ~ ~ 0.85 0.9
execute if block ~ ~ ~ minecraft:snow run playsound minecraft:block.snow.break hostile @a ~ ~ ~ 0.85 0.9
execute if block ~ ~0.3 ~ minecraft:snow run playsound minecraft:block.snow.break hostile @a ~ ~ ~ 0.85 0.9
execute if block ~ ~ ~ minecraft:snow_block unless block ~ ~0.3 ~ minecraft:snow run playsound minecraft:block.snow.break hostile @a ~ ~ ~ 0.85 0.8
execute if block ~ ~ ~ #minecraft:ice run playsound minecraft:block.glass.break hostile @a ~ ~ ~ 0.85 0.9
execute if block ~ ~ ~ minecraft:obsidian run playsound minecraft:block.stone.break hostile @a ~ ~ ~ 0.85 0.6
execute if block ~ ~ ~ minecraft:slime_block run playsound minecraft:block.slime_block.break hostile @a ~ ~ ~ 0.85 0.6
Expand All @@ -31,12 +32,4 @@ execute if block ~ ~ ~ minecraft:nether_bricks run playsound minecraft:block.net
execute if block ~ ~ ~ #minecraft:nylium run playsound minecraft:block.wart_block.break hostile @a ~ ~ ~ 0.85 0.9
execute if block ~ ~ ~ #minecraft:soul_fire_base_blocks run playsound minecraft:block.soul_sand.break hostile @a ~ ~ ~ 0.85 0.9

# Containers
execute if block ~ ~ ~ minecraft:chest run playsound minecraft:block.wood.break hostile @a ~ ~ ~ 0.85 0.9
execute if block ~ ~ ~ minecraft:trapped_chest run playsound minecraft:block.wood.break hostile @a ~ ~ ~ 0.85 0.9
execute if block ~ ~ ~ minecraft:ender_chest run playsound minecraft:block.ender_chest.open hostile @a ~ ~ ~ 0.85 0.6
execute if block ~ ~ ~ minecraft:hopper run playsound minecraft:block.metal.break hostile @a ~ ~ ~ 0.85 0.9
execute if block ~ ~ ~ minecraft:beacon run playsound minecraft:block.glass.break hostile @a ~ ~ ~ 0.85 0.6


execute if block ~ ~ ~ minecraft:lava run playsound minecraft:block.lava.pop hostile @a ~ ~ ~ 0.85 0.9
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ execute as @s[tag=ts.sa.verify] if entity @e[type=!#spawnanimations:exclude,dist

# Prevent animation on unsupported blocks if disabled
execute as @s[tag=ts.sa.verify] if score $play_unsupport ts.sa.settings matches -1..0 unless block ~ ~-0.5 ~ #spawnanimations:supported run function spawnanimations:internal/animation/dig_up/verify_in_air
execute as @s[tag=ts.sa.verify] if score $play_unsupport ts.sa.settings matches 1..2 if block ~ ~-0.5 ~ #spawnanimations:exclude run function spawnanimations:internal/animation/dig_up/verify_in_air
Loading