Molang/ExpressionOp

出自Minecraft基岩版开发Wiki
運算式運算子列舉
鍵名 介面字串 最小運算元數 最大運算元數 描述
Unknown -1 0 0 未知
LeftBrace 0 { 1 -1 左花括弧
RightBrace 1 } 1 -1 右花括弧
LeftBracket 2 [ 1 -1 左方括弧
RightBracket 3 ] 1 -1 右方括弧
LeftParenthesis 4 ( 1 -1 左圓括弧
RightParenthesis 5 ) 1 -1 右圓括弧
Negate 6 - 1 1 負號
LogicalNot 7 ! 1 1 邏輯非
Abs 8 math.abs 1 1 絕對值
Add 9 + 2 -1 加號
Acos 10 math.acos 1 1 反餘弦
Asin 11 math.asin 1 1 反正弦
Atan 12 math.atan 1 1 反正切
Atan2 13 math.atan2 2 2 雙參數反正切
Ceil 14 math.ceil 1 1 向上取整
Clamp 15 math.clamp 3 3 鉗制
CopySign 16 math.copy_sign 2 2 複製符號
Cos 17 math.cos 1 1 餘弦
DieRoll 18 math.die_roll 3 3 擲骰
DieRollInt 19 math.die_roll_integer 3 3 擲整數骰
Div 20 / 2 2 除號
Exp 21 math.exp 1 1 底指數
Floor 22 math.floor 1 1 向下取整
HermiteBlend 23 math.hermite_blend 1 1 Hermite融合插值
Lerp 24 math.lerp 3 3 線性插值
LerpRotate 25 math.lerprotate 3 3 線性旋轉插值
Ln 26 math.ln 1 1 自然對數
Max 27 math.max 2 2 最大值
Min 28 math.min 2 2 最小值
MinAngle 29 math.min_angle 1 1 最小角度
Mod 30 math.mod 2 2
Mul 31 * 2 2 乘號
Pow 32 math.pow 2 2
Random 33 math.random 2 2 隨機
RandomInt 34 math.random_integer 2 2 隨機整數
Round 35 math.round 1 1 捨入
Sin 36 math.sin 1 1 正弦
Sign 37 math.sign 1 1 符號
Sqrt 38 math.sqrt 1 1 開方
Trunc 39 math.trunc 1 1 截斷
QueryFunction 40 query. 0 -1 查詢函式
ArrayVariable 41 array. 0 0 陣列變數
ContextVariable 42 context. 0 0 上下文變數
EntityVariable 43 variable. 0 0 實體變數
TempVariable 44 temp. 0 0 臨時變數
MemberAccessor 45 . 1 1 成員存取器
HashedStringHash 46 ' 0 0 字串
GeometryVariable 47 geometry. 0 0 幾何變數
MaterialVariable 48 material. 0 0 材質變數
TextureVariable 49 texture. 0 0 紋理變數
LessThan 50 < 2 2 小於
LessEqual 51 <= 2 2 小於或等於
GreaterEqual 52 >= 2 2 大於
GreaterThan 53 > 2 2 大於或等於
LogicalEqual 54 == 2 2 邏輯相等
LogicalNotEqual 55 != 2 2 邏輯不等
LogicalOr 56 || 2 2 邏輯或
LogicalAnd 57 && 2 2 邏輯與
NullCoalescing 58 ?? 2 2 空合併
Conditional 59 ? 2 3 條件
ConditionalElse 60 : 2 2 條件否則
Float 61 0 0 浮點數
Pi 62 math.pi 0 0
Array 63 [] 1 1 陣列
Geometry 64 0 0 幾何(內部)
Material 65 0 0 材質(內部)
Texture 66 0 0 紋理(內部)
Loop 67 loop 2 2 循環
ForEach 68 for_each 3 3 對每個
Break 69 break 0 0 中斷
Continue 70 continue 0 0 繼續
Assignment 71 = 2 2 賦值
Pointer 72 -> 2 2 指針
Semicolon 73 ; 1 -1 分號
Return 74 return 1 1 傳回
Comma 75 , 0 0 逗號
This 76 this 0 0 this