From 8173d83d1b0f2e7a065febc711d4749a5e98e6ef Mon Sep 17 00:00:00 2001 From: hiisuuii Date: Fri, 26 Jan 2024 21:51:38 -0700 Subject: [PATCH] clarify again --- tags/faq/assert.ytag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tags/faq/assert.ytag b/tags/faq/assert.ytag index e94dd4f..addd437 100644 --- a/tags/faq/assert.ytag +++ b/tags/faq/assert.ytag @@ -2,5 +2,5 @@ type: text --- -You should avoid using `assert` in your mod code. If the assert passes, it will work as expected. However, if it fails, Minecraft will crash. Assertions are also disabled by default in the JVM, and will be ignored, which may lead to undefined behavior and potentially a NullPointerException. +You should avoid using `assert` in your mod code. If the assert passes, it will work as expected. However, if it fails, Minecraft will crash. Assertions are also disabled by default in the JVM, and will be ignored when your mod is run outside an IDE, which may lead to undefined behavior and potentially a NullPointerException. Instead of using the assertion pattern `assert someObject != null;`, you should use the null-checking pattern: `if (someObject != null) { /* Code here */ }