requireMinecraftClient¶
val requireMinecraftClient: Minecraft
The running Minecraft, for code that cannot execute without one - drawing a widget, handling a click, reading the options behind a tooltip.
Throws if there is none, and says so: an assertion naming the situation beats the bare NullPointerException from somewhere further down that a laundered platform type produces. It is the deliberate choice of the two, which is the point of it having a name.