Skip to content

StdLib

Package: com.hypixel.hytale.server.npc.util.expression

public class StdLib extends StdScope

Singleton standard library scope that serves as the root parent for all NPC expression scopes. Registers built-in constants and functions used in NPC role JSON expressions.

NameTypeValue
trueBOOLEANtrue
falseBOOLEANfalse
PINUMBER3.1415927 (float-precision Math.PI)
NameSignatureVariantDescription
maxmax(NUMBER, NUMBER) -> NUMBERinvariantReturns the larger of two numbers.
minmin(NUMBER, NUMBER) -> NUMBERinvariantReturns the smaller of two numbers.
isEmptyisEmpty(STRING) -> BOOLEANinvariantReturns true if the string is null or empty.
isEmptyStringArrayisEmptyStringArray(STRING_ARRAY) -> BOOLEANinvariantReturns true if the string array has length 0.
isEmptyNumberArrayisEmptyNumberArray(NUMBER_ARRAY) -> BOOLEANinvariantReturns true if the number array has length 0.
randomrandom() -> NUMBERvariantReturns a random double in [0, 1).
randomInRangerandomInRange(NUMBER, NUMBER) -> NUMBERvariantReturns a random double in [min, max).
makeRangemakeRange(NUMBER) -> NUMBER_ARRAYinvariantCreates a two-element array [v, v] from a single value.
ModifierReturn TypeSignature
public staticStdScopegetInstance()
  • StdScope — parent class providing the symbol table
  • Expression — uses this as the root scope for NPC expressions
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.