Global Variables prevent potion effects from being applied

Started by Tommy50377 on

Topic category: Help with Minecraft modding (Java Edition)

Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Global Variables prevent potion effects from being applied
Sat, 05/09/2020 - 03:52 (edited)

I have been trying to make a sword that, when right clicked with, gives you a "rage" effect. Essentially it just applies speed, strength, and resistance for 10 seconds, and has a 30 second cool down. The problem is, whenever I introduce global variables into the right click procedure, the potion effects either don't apply, or they don't do anything. The other parts of the if statement (Sets the timer to 30 and sets "rageNotice" to false) work just fine, but the potion effects don't work. I have managed to make the potion effects apply to the player, but they don't have any effect. Like it will say I have speed 2 for 10 seconds, but I won't actually move any faster. If I change it from being a global variable to just being "if true" the potion effects will work, even though the global variable I'm using by default is true. I don't know if I'm doing anything wrong, or I've found some sort of bug. Here are the blocks.

Right click procedure:

https://imgur.com/a/LBBZWnD

Sword in inventory tick procedure:

https://imgur.com/a/lyX7CJf

Edited by Tommy50377 on Sat, 05/09/2020 - 03:52
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This might be a bug. I don’t…
Sat, 05/09/2020 - 12:04

This might be a bug.

I don’t really know anything about global variables though. If you cannot solve the problem, try opening a support ticket.