Skip to content

Commit fbe6524

Browse files
committed
Even More Documentation
1 parent aead807 commit fbe6524

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

docs/utilities.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,13 @@ Optionally, a failed environment check can display a message to the user by incl
137137
data modify storage <namespace>:environment_checks result set value {<check name>: {probable_cause: "This may be caused by the programmer not expecting you to run this on a potato."}}
138138
```
139139
within your check, once again replacing the `<namespace>` and `<check name>` with the module's and the new check's name respectively, as well as adding a more adequate message.
140+
141+
Multiple modules may require the same environment check during a single reload.
142+
To cut down on lag, you should ensure your environment check tries to use a previous test result -- from the same `/reload` period -- before deciding to re-run the test.
143+
This can be done using
144+
```mcfunction
145+
execute unless data storage <namespace>:environment_checks result.<check name>
146+
```
147+
You **must also clear all check results** in post-load.
148+
149+
For a textbook example of an environment check, inspect `gm4:score_on_non_player_entity` in `base`.

0 commit comments

Comments
 (0)