Type Control
在 Minecraft 中更好地掌控你的数据!
关于本模组中类型命名的说明
str 标准字符串
char 标准字符串,长度为 1
func 标准字符串,表示一个函数
object 类似 / JSON 的对象
array 数组
ANY 可以是任何类型
null 空值
bool 值为 1 或 0 的整数,或 true 或 false(取决于上下文)
函数
字符串
Loop
遍历字符串中的每个字符
返回 null
参数
string : str | 要遍历的字符串
function : func | 要运行的函数
args : object | 传递给函数的任何其他参数
在每个字符上运行的函数将接收以下参数:
char : char | 字符串中的当前字符
ARGS : ANY | 通过 args 参数传入的任何参数,解包为直接参数
Split
按指定字符将字符串拆分为列表
返回 array | 输出到存储区
参数
string : str | 要拆分的字符串
char : char | 用于拆分字符串的字符
namespace : str | 输出目标存储区的命名空间
path : str | 输出目标存储区的路径
Concatenate
拼接两个字符串
返回 str | 输出到存储区
参数
string1 : str | 被拼接的目标字符串
string2 : str | 要拼接到 string1 末尾的字符串
namespace : str | 输出目标存储区的命名空间
path : str | 输出目标存储区的路径
Compare
比较两个字符串
返回 bool | 直接返回
参数
string1 : str | 第一个要比较的字符串
string2 : str | 第二个要比较的字符串
数组
Loop
遍历数组中的每个元素
返回 null
参数
array : array | 要遍历的数组
function : func | 要运行的函数
args : object | 传递给函数的任何其他参数
在每个元素上运行的函数将接收以下参数:
element : ANY | 数组中的当前元素
ARGS : ANY | 通过 args 参数传入的任何参数,解包为直接参数
Concatenate
将数组合并为字符串
返回 str | 输出到存储区
参数
array : array | 要合并的数组
namespace : str | 输出目标存储区的命名空间
path : str | 输出目标存储区的路径
Type Control
Get more control over your data in minecraft!
Note about how types are named in this
str A standard string
char A standard string, with length 1
func A standard string, represents a function
object A map like / JSON object
array An array
ANY Can be anything
null nothing
bool either an int of value 1 or 0, or true or false (depends on context)
Functions
Strings
Loop
Loops through each character in a string
Returns null
Parameters
string : str | The string to loop through
function : func | the function to be run
args : object | Any additional parameters to be passed to the function
The function that is run on each charachter in the string is passed the following parameters:
char : char | The current charachter of the string
ARGS : ANY | Any arguments passed in through the args parameter, unpacked into direct arguments
Split
Splits a string into a list by a specified character
Returns array | outputs to a storage
Parameters
string : str | The string to be split
char : char | The character to split the string at
namespace : str | The namespace of the storage to output to
path : str | The path of the storage to output to
Concatenate
concatenates 2 strings
Returns str | outputs to a storage
Parameters
string1 : str | The string to be concatenated onto
string2 : str | The string to be concatenated to the end of string1
namespace : str | The namespace of the storage to output to
path : str | The path of the storage to output to
Compare
Compares 2 strings
Returns bool | direct return
Parameters
string1 : str | The first string to be compared
string2 : str | The second string to be compared
Arrays
Loop
Loops through each element in an array
Returns null
Parameters
array : array | The array to loop through
function : func | the function to be run
args : object | Any additional parameters to be passed to the function
The function that is run on each charachter in the string is passed the following parameters:
element : ANY | The current element of the array
ARGS : ANY | Any arguments passed in through the args parameter, unpacked into direct arguments
Concatenate
Concatenates an array into a string
Returns str | outputs to a storage
Parameters
array : array | The array to be concatenated
namespace : str | The namespace of the storage to output to
path : str | The path of the storage to output to
评论 0
登录后参与评分
还没有评论,来抢沙发吧