Bleeding Potion Effect isn't working?

Started by Blue-Guy on

Topic category: Help with MCreator software

Last seen on 05:21, 9. Apr 2022
Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Bleeding Potion Effect isn't working?

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.

Last seen on 09:48, 19. Aug 2023
Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Try to move "Set [Global:…
Tue, 08/24/2021 - 18:05

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)

Last seen on 05:21, 9. Apr 2022
Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Didn't work. I ended up…
Tue, 08/24/2021 - 21:32

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?

Last seen on 19:23, 15. Sep 2021
Joined Aug 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hey mr azul, I need your…
Mon, 09/06/2021 - 03:07

hey mr azul, I need your help, check the post where you answered me so you can see my question,PLEASEEEE!!