Closed lovebug0706 closed 8 months ago
EntityAttributeInstance attributeInstance = entity.getAttributeInstance(BOOB_GROWING_START_TIME);
if (attributeInstance.getBaseValue() < 0.0) {
double currentTime = Time.currentTime(entity.getWorld());
entity.getAttributeInstance(BOOB_GROWING_START_TIME).setBaseValue(currentTime);
}
It looks like the crash is due to entity.getAttributeInstance(BOOB_GROWING_START_TIME) returning null and not being validated before .getBaseValue() is used on the result.
It might also be a solution to move the attribute check into the preexisting player check if there's no plan to expand to include other entities.
Probably because it wasnt meant for other creatures, but maybe you can add it. Heres the error:
The game crashed whilst ticking entity Error: java.lang.NullPointerException: Cannot invoke "net.minecraft.class_1324.method_6201()" because "attributeInstance" is null
Example: I shot a chicken, or a villager.