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 [60] 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.
Try to move "Set [Global: bleedinghealth] to 0" to the "Potion start" event.(in MCreator workspace)
And do you can place "{" ;"}" at the start and end of "Repeat" and "If" blocks?(in the comment)
Didn't work. I ended up getting it to work instead by making it execute the /attribute command for max health but changing it by 1 every 60 ticks, but this has caused some issues and it's inefficient.
I'm now trying to make it so it disables regeneration, meaning for the duration of the potion you won't be able to heal or regenerate hearts you lose. Issue with this is that I can't find an NBT tag that affects regeneration. Does anybody know how to do this?
hey mr azul, I need your help, check the post where you answered me so you can see my question,PLEASEEEE!!