BUG Global Varible Session

Published by Aizark on Sun, 07/28/2019 - 17:41
Upvotes: 1
Issue description

Hi, I was recently recommended to use Global Session Varible, but they are buggy. Try to set the event "Set global varible to 10", for example, on the right mouse click. The global variable will create chaos, it can even take negative values. I can't create anything serious on your product, I really hope that this error will be corrected, well, and a flaw with Overlay

Issue comments

In particular, I'm talking about demonstrating a variable in a GUI or HUD.

Global variables indeed support negative values (and you said you set it to 10 which is not negative?). But keep in mind that on servers, session variables won't work properly as server and client hold their own session variables, so to link them, you need to use global variables such as map type.

I notice a bug if you put a variable on a demonstration via GUI or HUD, and take a variable from a player's NBT, or a non-bootable block. At the same time, any other logic works without bugs. Variable mapping jumps from my value to -1.0

If you get -1 value, this means variable was not set yet. Even if you play singleplayer, you have two separate sides with separate variable sets: one for server and one for client.

Procedures that get triggered on both client and server (most of them) happen on both sides and for one side (most likely client) you get -1 as variable is not defined there, but for server it is so the value is jumping between these two values.

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.