Global variables breaking potion effects

Published by Tommy50377 on Sun, 05/10/2020 - 20:03
Status
Can not reproduce
Type
Product/platform
MCreator/Windows
Priority
Normal
Issue description

I was trying to make a sword that gives potion effects with a right click that had a cool down, but found that whenever I introduced a global variable into the right click procedure, the potion effects either would not apply or didn't work. The strange thing is that the other parts in the If statement (setting "rageTimer" to 30 and setting "rageNotice" to false) worked just fine, but the potion effects didn't. I played with it a bit and found a way to get the potion effect to apply, but it wouldn't have any effect (It would say I had speed 2 for 10 seconds, but I wouldn't actually run any faster). When I removed the global variable and changed it to if true, it worked without a problem. But when I re introduced the global variable (Which by default is true), it once again stopped working. I think this has to be some sort of bug, because I don't know what else could cause this. Here are the blocks

Sword right click procedure:

https://imgur.com/a/LBBZWnD

Sword in inventory tick procedure:

https://imgur.com/a/lyX7CJf

Issue comments

Sorry but this is not enough context.

When possible, attach your MCreator workspace (or even better a minimal example workspace required to reproduce the bug), game logs (full logs, do not crop them, in text format, not screenshots of logs) from the Console tab or terminal and steps to reproduce the bug in your workspace. If logs are long, use service such as Pastebin to host the log and provide the link to the log from the ticket. Please specify which mod elements to check in your workspace too, if applicable.



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.