• check_circle Advancements
  • check_circle Functions
  • check_circle Loot Tables
  • 6,248 views, 11 today
  • 604 downloads, 1 today
  • 35
  • 32
  • 15
Required Resource Pack
Avexus02's Avatar Avexus02
Level 23 : Expert Modder
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.
CreditDizzistitch - The pick up sound
CompatibilityMinecraft 1.16
toMinecraft 1.20
Tags

1 Update Logs

Update #1 : by Avexus02 08/26/2023 1:57:47 pmAug 26th, 2023

Updated for 1.20.1

Create an account or sign in to comment.

1
11/23/2023 4:01 amhistory
Level 4 : Apprentice Miner
Jasdan
Jasdan's Avatar
Question

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?
2
09/23/2022 5:17 am
Level 51 : Grandmaster Meme
calebchan
calebchan's Avatar
HI I would like to ask for permission to copy and use your super lightweight code for a datapack that involves mobs with the Glowing effect to drop glowstone dust on death. I will credit and everything, but if not, then just say you'd like to keep it trademarked, and my pack will work fine without it! :D
2
09/24/2022 2:49 amhistory
Level 23 : Expert Modder
Avexus02
Avexus02's Avatar
Hi, sorry for the late reply. You may use the "code" (being an actual programmer i'm honestly reluctant to even call datapack mcfunctions "code" but like, what else ya gonna call 'em?) Just a small footnote in the credits like what I have with Dizzistich would suffice. Thank you for asking for permission. ^w^
2
09/24/2022 5:46 am
Level 51 : Grandmaster Meme
calebchan
calebchan's Avatar
Thank you! This is such an amazing workaround to do custom mob drops. Ugh I had spent a good few hours trying to find a new way, and I just threw the whole towel on the idea

then next day I come across this
2
09/18/2022 8:45 am
Level 39 : Artisan Miner
Lordphenex
Lordphenex's Avatar
Nice pack !
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.
2
09/18/2022 9:52 am
Level 23 : Expert Modder
Avexus02
Avexus02's Avatar
Yea, wanted to avoid the headache of using loot tables there.
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.
2
09/17/2022 6:25 pmhistory
Level 26 : Expert Chef
Dizzistitch
Dizzistitch's Avatar
Yo! This pack is super well made! Perfectly optimized and super balanced! I have a tiny suggestion to add a custom sound for picking up a heart, in fact I made a quick little concept one if you wanted to use it! :D

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!
1
09/17/2022 6:46 pm
Level 23 : Expert Modder
Avexus02
Avexus02's Avatar
Thanks, I will use that sound effect and credit you!
Yea, that Age check really should've been obvious in hindsight. I'll implement it soon.
2
09/17/2022 8:03 pm
Level 26 : Expert Chef
Dizzistitch
Dizzistitch's Avatar
Awesome! Glad to hear it and will be looking forwards to seeing the pack update!
2
09/18/2022 1:02 am
Level 23 : Expert Modder
Avexus02
Avexus02's Avatar
It's been updated
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome