Page 1 of 1

Entity's Energy

Posted: Sun Mar 22, 2015 8:13 pm
by theRustyKnife
I've been messing around with trains lately. I came to a point where I needed to read/set the amount of energy in a locomotive but I found out that the method entity.energy does not work particularly well.
If I tried to read the energy it would say either 0 (if the entity had no energy) or some different number (if it had some energy). The number depended on the type of the entity (all stone furnaces gave me the same number but it was a different one from a locomotive).
If I tried to set the energy to whatever value, the entity would always just have energy for a tiny bit (one tick I guess) and then have nothing again.
To me it seems like it's a bug but I'm pretty new to this stuff so I want to make sure I'm not missing something. Could anyone tell me if you're having this problem too or not?