Built-ins

Built-in functions not related to Minecraft.

Containers

Functions

Iteration

Math

Basic arithmetic and trigonometric functions. Degrees and radians The trigonometric functions (such as sin(), cos(), tan(), asin(), …) expect (or return) angles in degrees. It may be useful to use radians instead, use the deg() and rad() functions to convert between degrees and radians. deg(rad); rad(deg);

String

Threading

Scarpet allows to run threads of execution in parallel to the main script execution thread. In Minecraft, apps are executed on the main server thread. Since Minecraft is inherently NOT thread safe, it is not that beneficial to parallel execution in order to access world resources faster. Both getBlockState and setBlockState are not thread safe and require the execution to park on the server thread, where these requests can be executed in the off-tick time in between ticks that didn’t take all 50ms.

Types