Topic category: Help with MCreator software
This is a calculation I'm trying to have. It is called on an armor on body tick event and is simply for a gui that shows what the value would be if activated. When the armor is undamaged, it behaves normally and says the value would be 30, but if the armor takes any damage, the value is immediately set to 0 with no reason. I've even tired activating at this point and it does, in fact, give 0 as the value.
The calculation is supposed to be so if the armor has only taken 5 damage, it would be something like 395/400 which is ~0.99, multiplying by the 30 would be ~29.6 and still round up to 30. Despite this, it automatically defaults to 0 if the item's damage is > 0.
Am I just being dumb or is something not working here?