Topic category: Help with Minecraft modding (Java Edition)
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:
Sword in inventory tick procedure:
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.