Host your Minecraft server on BisectHosting - get 25% off your first month with code MODRINTH.

NOTE

This is only the resource pack needed for the data pack/mod
A separate page is needed and intended to tag it as a dependency

Animated & Connected Doors

Add a fancy opening and closing animation to your doors!
Two connecting doors will open together if only one side is opened (and closed).

All animations and door connections work on manual opening/closing and also on redstone impulses like buttons, pressure plates, redstone, ... This will also work on iron doors, so only one side needs to be powered.

Image
View the Galery for more previews

Installation

Please visit the main page to read more about installation.
Link: https://modrinth.com/datapack/animated-doors

Credits & QA

This datapack was originaly started by Scommander and discontinued
I picked it up and optimizied a few things and also ported it into the newer versions to support all doors again.
If you have any questions or need Animated Doors for a newer version i did not updated yet hit me up on Discord.

Q: My doors are invisible!
A: On first installation, all previous placed doors needs to update once before they are visible. Just look at them once.

Q: There are floating iron ingots now! / My doors are not animated!
A: If you see floating iron ingots at doors or your doors simply are not animated you need to activate the resource pack.

Q: How do i uninstall Animated Doors?
A: To uninstall Animated Doors you need to enter /function anim-door:uninstall in every region where doors exist or simply remove the datapack and enter /kill @e[tag=_betdor_marker] everytime you find a region that was not loaded yet.

Q: How do i add custom/modded doors?
A: This involve some editing of the data- & resource-pack files, but i'll try to guide you through:

Guide to add custom doors

First, unzip the data-pack & resource-pack folders to edit all files inside more easily. You will need the mod-key and door type key for this. Press F3+H to enable item IDs in Minecraft and hover over any item. You will see <mod-key>:<door-type> in dark gray.

Let's start with editing the resource pack:

NOTE - This method only work if your mod follows the vanilla style of adding blocks!

First navigate into the folder assets\minecraft\models\block\type. There are two files (left and right) for each door type. Copy both files for any door type and rename it to <door_type>_left and <door_type>_right.
Next, open both files in any text editor and replace the top and bottom texture with the path to the path of your door like the following:

{
    "parent": "minecraft:block/main/right_hinge",
    "textures": {
        "top": "<mod-key>:block/<door-type>_top",
        "bottom": "<mod-key>:block/<door-type>_bottom"
    }
}

At last, navigate into the folder assets\minecraft\models\item and open the iron_nugget.json file.
Scroll to the bottom and add for each door you want to add a new entry. I suggest to count up from 1000 to prevent incompatibilities with future updates:

{
    "parent": "item/generated",
    "textures": {
        "layer0": "item/iron_nugget"
    },
    "overrides": [
      ...

      { "predicate": {"custom_model_data": 1001}, "model": "<mod-key>:block/type/<door-type>_right"},
      { "predicate": {"custom_model_data": 1002}, "model": "<mod-key>:block/type/<door-type>_left"}
    ]
}

Remember the numbers you assigned to your door! You will need those later and i will mention them with <id-1> and <id-2>.
Congratulations! You finished the resource pack!

Editing the data pack

It will seem like a lot work but it's mostly just copy pasting stuff from a to b.

At first, open the data pack folder and navigate to data\anim-doors\functions. Here you will find the .index.md file, it's like my own little cheat code. Inside are all files that needs to be edited.


setup/on_reload.mcfunction -> Add new scoreboard to track door. Add the following line below the first block:

scoreboard objectives add _betdor_<id-1> minecraft.used:<mod-key>.<door-type>

change/<door>.mcfunction (add) -> Copy the acacia.mcfunction file, rename it to <door-type>.mcfunction and replace inside all minecraft:acacia_door text with your <mod-key>:<door-type> text. Most editors support something like ctrl + r.


setup_type/<door>.mcfunction (add) -> Copy the acacia.mcfunction file, rename it to <door-type>.mcfunction and edit numbers in each line after CustomModelData to your <id-1> and <id-2> like the following:

execute if block ~ ~ ~ #anim-doors:valid_door[hinge=left] run data merge entity @s {ArmorItems:[{},{},{},{id:"minecraft:iron_nugget",Count:1b,tag:{CustomModelData:<id-1>}}]}
execute if block ~ ~ ~ #anim-doors:valid_door[hinge=right] run data merge entity @s {ArmorItems:[{},{},{},{id:"minecraft:iron_nugget",Count:1b,tag:{CustomModelData:<id-2>}}]}

as_player.mcfunction -> Add player tracking by tracking your scoreboard created in the first step. Add the following line below the first block:

execute if score @s _betdor_<id-1> matches 1.. run function anim-doors:placed

fake_change.mcfunction *2 -> Here we need to edit two things. In the first big block add the following line

execute if block ~ ~ ~ <mod-key>:<door-type>[half=lower] run scoreboard players set type_check _betdor <id-1>

and in the last big block add the following line

execute if score type_check _betdor matches <id-1> run function anim-doors:change/<door-type>

placed.mcfunction -> Simply add the following line before the last command:

scoreboard players reset @s _betdor_<id-1>

setup_door.mcfunction -> Last thing we need to do is actually loading the door. Just add the following line to the first block:

execute if block ~ ~ ~ <mod-key>:<door-type> run function anim-doors:setup_type/<door-type>

Data pack functions done!

All technical stuff is done! Congrats! Now you just need to tell Minecraft whether your door is an iron door (only usable by redstone) or wooden door (usable by players & redstone)

Navigate to data\anim-doors\tags\blocks, open valid-door.json and add <mod-key>:<door-type> to the list.
Now you either open iron_door.json or wooden_door.json and add the same there too.

That's it!

You successfully added your custom door to the pack! You can share your work with others on our Discord, we love to see new additions ♥

External resources



Project members

Miraculixx

Owner


Technical information

License
MIT
Project ID