Animated Doors RP

Door open & close animation. Connects double doors to open simultaneously. Supports iron doors and redstone signals

203,74k

Animated Doors RP

NOTE

> This is only the resource pack needed for the data pack/mod<br> > 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!<br> 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<br> View the **Galery** for more previews

Installation

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

Credits & QA

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

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

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

A: How do i uninstall Animated Doors?<br> 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.

A: How do i add custom/modded doors?<br> 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 ``assetsminecraftmodelsblocktype``. 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`.<br> 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: ```json { "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 `assetsminecraftmodelsitem` and open the `iron_nugget.json` file.<br> 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: ```json { "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>``.<br>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 `dataanim-doorsfunctions`. 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: ```js 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: ```js 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: ```js 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 ```js 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 ```js 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: ```js 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: ```js 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 `dataanim-doorstagsblocks`, open `valid-door.json` and add `<mod-key>:<door-type>` to the list.<br> 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 ♥

ADS