Attempting to use global variable breaks everything

Started by Survivalist on

Topic category: Help with modding (Java Edition)

Last seen on 00:15, 11. Jan 2023
Joined Mar 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Attempting to use global variable breaks everything
Thu, 12/29/2022 - 03:29 (edited)

I have a bleed effect where if you take damage you have a chance to bleed which acts like poison. The bleed effect works but the problem is that it sometimes resets itself since it detects you taking damage from the bleed.

In order to solve this problem I have tried using a global variable called "isBleeding" which is set to true when the effect is applied and false when it is removed.

For some reason doing this causes everything to stop working I am still given the bleed effect but it doesn't actually do damage which doesn't make sense because the damage procedure is not attempting to reference the variable at all and shouldn't be affected by it. Removing the singular block that changes the variable to true or false makes everything work perfectly.

By the way just because it said I joined in 2018 I am very new to this so please don't assume I know any of the advanced stuff I tried mcreator out a while ago but haven't actually tried using it until now.

Edited by Survivalist on Thu, 12/29/2022 - 03:29
Last seen on 00:15, 11. Jan 2023
Joined Mar 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I forgot to mention but this…
Thu, 12/29/2022 - 03:26

I forgot to mention but this is version 2022.1 for Minecraft 1.16.5