`/script run modify(p, 'add_exhaustion', value)` casts `value` to an integer before applying the exhaustion
James103 opened this issue ยท 0 comments
fabric-carpet/src/main/java/carpet/script/value/EntityValue.java
Lines 1460 to 1462 in 1b39fea
The above code means that /script run modify(p, 'add_exhaustion', 1.5)
will actually add 1 exhaustion instead of 1.5, and modify(p, 'add_exhaustion', value
where value < 1
will do nothing as
(int) NumericValue.asNumber(v).getLong()
rounds the given value to the nearest integer towards zero, truncating any decimals, then
((PlayerEntity) e).getHungerManager().addExhaustion(0); // see above
does nothing to change the player's exhaustion level.