1

Questions About a Data Pack Idealive_help

Dermugettum's Avatar Dermugettum3/31/23 11:59 pm
1 emeralds 230 6
4/7/2023 3:05 pm
Luke_Sky_Walker's Avatar Luke_Sky_Walker
I've gotten to a point with my data pack where I want to add one last feature, but I don't know whether it is possible or not. Basically, I want to have it where the player holds an item in their mainhand or offhand, and as a result it will reduce attack damage from undead mobs while they're holding it.

The problem is I haven't come across anything that could reduce damage from certain mobs while ignoring others. The healing effect might be one thing, but I was hoping for something where I'd have more control over how much HP the player would keep, or how much less damage they'd take.
Posted by Dermugettum's Avatar
Dermugettum
Level 21 : Expert Miner
27

Create an account or sign in to comment.

6

2
04/07/2023 1:11 amhistory
Level 82 : Elite Programmer
TheDiamondPlayables
TheDiamondPlayables's Avatar
One possible solution I could think of is to flip the question on its head.
Give resistance against all incoming mobs, then add extra damage to those dealing that are not of mob type X. (so all mobs gives an illusion of default damage, except mob X)
Shouldn't be too hard to apply extra damage with /damage, but I haven't experimented much with it yet. Just giving suggestions here.
2
04/05/2023 2:04 pm
Level 36 : Artisan Mlem Mlem Bat
Luke_Sky_Walker
Luke_Sky_Walker's Avatar
I have an idea as to how you could do this but it could be kind of complicated. You would first need to make sure your undead mobs are apart of a specific team. That way, you can test if a player is damaged by that team. After they are damaged you can use a RNG to determine how often they could be damaged if they're holding a specified item (Ie: Undead mob hits player, RNG is 1/100. If # is 1 to 50, do not affect player with resistance for a few seconds [​Player takes damage]. If the # is 51 to 100 give player the resistance et voila). Only issue could be that this is a pretty advanced option and could be a challenge to create.
1
04/06/2023 10:33 pm
Level 21 : Expert Miner
Dermugettum
Dermugettum's Avatar
I think I could manage that. My only question is wouldn't this RNG only trigger after a player has taken damage while holding the item? That kind of negates the use of the item for the first attack.

I also don't want them to be immune from any mob's attack aside from the undead. That would make the amulet easy to exploit for things outside intended uses.
1
04/07/2023 3:05 pm
Level 36 : Artisan Mlem Mlem Bat
Luke_Sky_Walker
Luke_Sky_Walker's Avatar
Yeah, you could probably do that. Player gets damaged by undead mob on assigned team, if the player has the item in their offhand/main hand the RNG would get triggered and affect the player with high instant health for a split second (This way, no matter how much they got damaged it would almost instantly heal them and you could control how much they got healed + how long they'll be healed for).
2
04/02/2023 3:05 pm
Level 32 : Artisan Procrastinator
Spuduking
Spuduking's Avatar
Maybe heal the player when attacked by an undead mob? It's not perfect but the best I can think of
2
04/02/2023 4:35 pm
Level 21 : Expert Miner
Dermugettum
Dermugettum's Avatar
You'd think Mojang would add a /heal command along with the /damage command...but overlooking stuff like that is a Mojang thing to do.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome