public function setFood(float $new)
{
$attr = $this->attributeMap->getAttribute(Attribute::HUNGER);
$old = $attr->getValue();
$attr->setValue($new);
// ranges: 18-20 (regen), 7-17 (none), 1-6 (no sprint), 0 (health depletion)
foreach ([17, 6, 0] as $bound) {
if ($old > $bound !== $new > $bound) {
$reset = true;
}
}
if (isset($reset)) {
$this->foodTickTimer = 0;
}
}