-
-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ExprLastDamage - fix everything (#6797)
* ExprLastDamage - fix everything * HealthUtils set last damage manually * ExprLastDamage - add test --------- Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
- Loading branch information
Showing
3 changed files
with
39 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/test/skript/tests/syntaxes/expressions/ExprLastDamage.sk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
test "last damage": | ||
set {_l} to location 0.5 above highest block at location(1,1,1) | ||
spawn a sheep at {_l} | ||
set {_e} to last spawned entity | ||
|
||
assert last damage of {_e} = 0 with "last damage of newly spawned entity should be 0" | ||
|
||
damage {_e} by 1 | ||
assert last damage of {_e} = 1 with "last damage of entity should be 1 after damaging it by 1" | ||
|
||
set last damage of {_e} to 3 | ||
assert last damage of {_e} = 3 with "last damage of entity should be 3 after setting to 3" | ||
|
||
# thank you for your service | ||
delete entity in {_e} |