Entity's Energy

Place to get help with not working mods / modding interface.
User avatar
theRustyKnife
Filter Inserter
Filter Inserter
Posts: 260
Joined: Thu Feb 26, 2015 9:26 pm
Contact:

Entity's Energy

Post 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?
Post Reply

Return to “Modding help”