Minecraft Data Packs / Quality of Life

Anvil repairs | Resolved compatibility issue

  • check_circle Advancements
  • check_circle Functions
  • 3,242 views, 2 today
  • 352 downloads, 0 today
  • 16
  • 13
  • 16
Lordphenex's Avatar Lordphenex
Level 40 : Master Miner
16
Presentation
For my first ever uploaded datapack, I bring to you this really simple quality of life datapack.
With it you can repair damaged anvils by right-clicking them with an iron block.
Please note that if you downloaded this datapack before july 11th, it won't work as intended in MC version 1.17+, due to a syntax error in my code, so you need to download this new version to play on MC 1.17+.


How to use
Just right-click on an anvil while holding an iron block and "tink-tink" the anvil is repaired.


Compatibility
This datapack should be compatible with any other datapack that respect MC Datapacks conventions.
I made this datapack in MC version 1.16.5 and tested it in 1.17.1, 1.18.2 and 1.19.


Installation
You can install this datapack in your world at anytime you want, just make sure to do /reload afterward.
If you don't know how to install a datapack, please refer to the MC Wiki page.


Uninstallation
This datapack provides a way of removing all of its content, just use either one of following commands :
/function lordphenex:_uninstall.anvil_repairs
/function #lordphenex:help


Reporting bugs or possible improvements
If you experience any issue with this datapack, please reach me out by commenting this post, I'll answer as soon as I can.
Please keep in mind that a constructive comment is always better a single phrase comment, especially when something doesn't work as it should do.
Also, if you want to give me ideas on what to implement as datapacks, please feel free to do so.


Known issue
There is a little issue with my datapack, this being the fact that any right click on an anvil will open the anvil menu, even if you just want to repair it. This is due to the fact that the anvil menu and the anvil replacement occur in the same tick so the game thinks nothing changed and won't close the menu window. I hope it won't be too annoying for you and if you have any idea of a workaround, let me know in the comments.


Licensing
This work is licensed under the CC BY-NC-ND 4.0 meaning that you cannot share a modified version of my datapacks. You also are not allowed to sell any part nor the entirety of my datapacks. In any case, if you share one of my datapacks (through a video or on a server, for example), you must give me credit.


Credit
The major part of my advancements, predicates, loot_tables and item_modifiers are made with the help of Misode's datapack generator.
CompatibilityMinecraft 1.16
toMinecraft 1.19
Tags

1 Update Logs

Update #1 : by Lordphenex 07/11/2022 3:38:47 amJul 11th, 2022

  • Changed advancement syntax that was not compatible with 1.17+ syntax, causing the anvil fix to trigger even when player was not holding iron_block.
  • Now properly tested in 1.16.5, 1.17.1, 1.18.2 and 1.19

Create an account or sign in to comment.

Raxior
12/03/2023 10:20 am
Level 1 : New Miner
Raxior's Avatar
Is this functioning for 1.20?
1
Lordphenex
12/03/2023 2:40 pm
Level 40 : Master Miner
Lordphenex's Avatar
It should. Give it a test on a blank world and report back if it is not working properly
1
Raxior
12/04/2023 3:38 am
Level 1 : New Miner
Raxior's Avatar
just tested it it doesn't sem to work at all even when it's the only datapack on a vanilla singleplayer world
1
Lordphenex
12/05/2023 3:34 pm
Level 40 : Master Miner
Lordphenex's Avatar
I'll have a look into it this week if I have time
1
Rignchen
10/05/2022 2:35 pm
Level 45 : Master Necromancer
Rignchen's Avatar
hey, shouldn't put your name as namespace cause you could easily get compatibility problems with your own datapacks
2
Lordphenex
10/05/2022 5:10 pm
Level 40 : Master Miner
Lordphenex's Avatar
I made it that way so I'm sure I won't have compatibility issues with other datapack. I also namespaced my own datapack to avoid compatibility issue in my own packs.
If I keep my own convention, my datapack should all be compatibles.
1
calebchan
09/09/2022 6:18 am
Level 51 : Grandmaster Meme
calebchan's Avatar
Hello! I'm checking out your datapacks. This is a really cool one! I think I understand your known issue.

I didn't test this, but if the fixed anvil is only subbed in one tick later, there would be one tick where there is no anvil in that block pos, and the GUI would close.

What if for one tick, a barrier block was substituted in first. I'm not suggesting an air block because if there are gravity blocks above the anvil, during the missing 1 tick, they would fall through the space. Thus a solid block has to be used, and will hold up any gravity blocks like more anvils above it.

Then, you could use some particle effects to shroud the block space while it is an invisible barrier block. This would add visual feedback to the player (you've already got the audio feedback),
2
Lordphenex
09/13/2022 8:23 am
Level 40 : Master Miner
Lordphenex's Avatar
So I just tested it but the result is not as good as I was expecting : the GUI sometimes briefly pops up (not always, maybe based on the FPS), a bit like a flash. So I'm not sure to implement it because I think it would be more uncomfortable for the user than having the GUI opened.
2
calebchan
09/13/2022 8:48 am
Level 51 : Grandmaster Meme
calebchan's Avatar
Hmmm right, it would flash, didn't think of that, and that's not nice either.

What's interesting is that it's inconsistent. FPS would make sense as the cause. Something to look into.

Thanks for trying my suggestion! Regardless, thanks for your time and effort on this idea!! 💪
2
Lordphenex
09/09/2022 8:51 am
Level 40 : Master Miner
Lordphenex's Avatar
Oh that's a really clever idea ! I will probably try it and see if I can implement it when I got time.
I already have some iron block particles coming from the anvil but maybe I can add a bit more.
2
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome