Skip to content

Commit

Permalink
remove inf check
Browse files Browse the repository at this point in the history
  • Loading branch information
17183248569 authored and gnembon committed Dec 5, 2023
1 parent 5b33291 commit 5bc3acf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/scarpet/api/Entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ players, since they are controlled client side.
### `modify(e, 'effect', name?, duration?, amplifier?, show_particles?, show_icon?, ambient?)`

Applies status effect to the living entity. Takes several optional parameters, which default to `0`, `true`,
`true` and `false`. If no duration is specified, or if it's null or 0, the effect is removed. If duration is less than 0, or it is infinity, it will represent infinity. If name is not specified,
`true` and `false`. If no duration is specified, or if it's null or 0, the effect is removed. If duration is less than 0, it will represent infinity. If name is not specified,
it clears all effects.

### `modify(e, 'health', float)`
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/carpet/script/value/EntityValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -1488,7 +1488,7 @@ else if (v instanceof final ListValue lv)
le.removeEffect(effect);
return;
}
if (duration < 0 || Float.isInfinite(NumericValue.asNumber(list.get(1)).getFloat())){
if (duration < 0){
duration = -1;
}
int amplifier = 0;
Expand Down

0 comments on commit 5bc3acf

Please sign in to comment.