#lifesteal datapack help

1 messages · Page 1 of 1 (latest)

short marten
#

I've edited a lifesteal datapack so that if you have 5 hearts you can't lose hearts anymore, so that you can't get banned. to prevent heart farming I also made it so that if you kill a player that has 5 hearts you won't get a heart from the kill. It works this way: once you have 5 hearts, you are granted an impossible advancement. Killing a player with that advancement means you won't get a heart. However there is a problem: when you kill a player with 6 hearts, you should get a heart but you don't. This is because if you die your max health is instantly set to 5 hearts and the advancement is granted, which prevents the killer from getting a heart even though the killed had 6 hearts. How can i fix this? I already tried many possibilities

severe pendantBOT
#

-# (helpers summoned) <@&1166082198152159386> <@&1202694677766348840>

signal cove
#

When they reach 5 hearts for the first time give them a tag, then if they die and have this tag give them another tag, if you only check for the second tag it should work

short marten
#

because i would need to check if the killed player has the tag in the advancement

dusk tide
short marten
#

in type specific??

#

where?

dusk tide
#

In nbt you can check for tags.
"nbt": "{Tags:[\"your_tag_here\"]}"

short marten
#

can i also check for scoreboard values?

#

although if i detect the health scoreboard the problem would be the same

short marten
#

it doesnt work

#

it would work if i could check for éverything except a tag in an advancement

#

can i do this???

#

so check if the player does NOT have that tag

night vortex
#

You can check the opposite with the inverted predicate type

short marten
#

i have this as my predicate

{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"nbt": "{Tags:["mark2"]}"
}
}
}

#

and this as my advancement

{
"criteria": {
"requirement": {
"trigger": "minecraft:player_killed_entity",
"conditions": {
"player": [
{
"condition": "minecraft:reference",
"name": "lifesteal:notmark2"
}
],
"entity": {
"type": "minecraft:player"
}
}
}
},
"rewards": {
"function": "lifesteal:health/playerkilled"
}
}

#

however if i kill a player with mark2 you still get a heart(the advancement triggers) even though it shouldn't

night vortex
#

you are testing the player for not having the tag

#

rather than testing the entity that is killed

short marten
#

oh yeah sry

#

it works now