- check_circle Advancements
- check_circle Functions
- check_circle Loot Tables
- 6,820 views, 3 today
- 649 downloads, 2 today
- 35
- 31
- 15
Required Resource Pack
5
HeartDrops for 1.20+
This is a very simple, lightweight datapack that makes most mobs (hostiles, not like cows or sheep) drop a heart when the player is below half (5 hearts) health. It works with ranged weapons (bows, tridents, etc.) so as long as the target died less than 128 blocks away from you. This is configurable by using the command /scoreboard players set #maxhealth heartdrops.config <value>, where <value> is twice the amount of hearts you can have before you can no longer get the heart drops. For example, if you set it to 20, that would mean you would always get hearts, because the maximum in vanilla minecraft is 10 hearts.
The hearts will always heal one heart, as you would expect. I might make this changeable if enough people are interested. I may also make the maximum hearts required percentage based, who knows. You do not get hearts from killing players, but that is also a consideration, same with configurable drop rates.
If you struggle to stay alive during fights, this can really help you without making things too easy.
Things that will definitely break this datapack:
- Modifications that stop mobs from dropping XP.
- Only works for vanilla mobs, though modded mobs won't break the datapack.
Please let me know of any bugs or conflicts that come up.
- Patch 9.18.2022, bug fix and new sound provided by Dizzistitch.
Credit | Dizzistitch - The pick up sound |
Compatibility | Minecraft 1.16 |
to | Minecraft 1.20 |
Tags |
1 Update Logs
Update #1 : by Avexus02 08/26/2023 1:57:47 pmAug 26th, 2023
Updated for 1.20.1
5714040
119
Create an account or sign in to comment.
Can you make them use the texture for the health-bar hearts so it wouldn't require a resourcepack download and so the hearts match whatever resourcepack the player is using?
then next day I come across this
Maybe when you check for experience orb, you can check for a smaller distance as most player will kill mobs only 80 blocks away (5 chunks). You brought a good way of ensuring loot tables compatibility across datapacks.
Maybe you should schedule the function with the append argument because it will replace the schedule by default.
I'll consider this, 128 was just to be extra safe if someone somehow sniped a mob from the maximum distance they can even spawn, but in the interest of optimization 80 will probably suffice for 99.99% of cases.
I'll try using append in the next patch.
Link is here: cdn.discordapp.com/attachments/778324851487801367/1020822687834189905/pickup.ogg
By the way, in the check for an experience orb to summon the heart, you should make it check that the experience orb has an Age value of 0b, 1b, or 2b (I forget which one works lol) so it only applies to the most recent one dropped by the mob.
Again, awesome pack!
Yea, that Age check really should've been obvious in hindsight. I'll implement it soon.