Topic category: Help with MCreator software
I've made a potion effect that's supposed to lower the player's max health by 1 heart every three seconds, called 'Bleeding'. When the player has one heart or lower, the effect should go away, otherwise it should last forever unless a specific item is used(which I have not implemented yet). For some reason, it isn't working, and I can't figure out why.
The procedure at the moment is On Potion Active Tick, as when I originally tried it as When Potion Started/Applied it didn't work either.
Code(just me copying down the blocks, sorry if it's messy):
Event trigger - triggered by external call or when (global trigger): No additional trigger
Set [Global: bleedinghealth] to 0
repeat 10 times
do Wait  ticks then on server-side
do if [Current health of Event/target entity] > 1
do Set [Global: bleedinghealth] to: Get [Global: bleedinghealth] + 1
Set Event/target entity data number NBT tag ["maxHealth"] to Max Health of Event/target entity - Get [Global: bleedinghealth]
else Remove specific potion effect from Event/target entity type [CUSTOM:Bleeding]
If anybody knows what I'm doing wrong, please comment below.