I advise against using the static methods in this class directly as they may be merged into CrT's BEP at any point. If you need to access the Bracket Expression Parser methods dynamically, you can use

zencode
Copy
var myName = "misc";
<itemgroup:${myName}>

This class was added by a mod with mod-id contenttweaker. 因此,如果要使用此功能,则需要安装此mod。

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

ZenScript
Copy
import mods.contenttweaker.BracketHandlers;

Name: getCoTBlock

Gets the registered advanced CoT block. Will throw an error if the block could not be found

Returns: The found IIsCotBlock
Return Type: CoTBlockAdvanced

ZenScript
Copy
<advancedblock:test_block>

// BracketHandlers.getCoTBlock(tokens as string) as CoTBlockAdvanced

BracketHandlers.getCoTBlock("test_block");
参数类型描述
参数
tokens
类型
string
描述
What you would createDataCompound in the BEP call

Name: getCoTItem

Gets the registered advanced CoT item. Will throw an error if the item could not be found

Returns: The found IIsCotItem
Return Type: CoTItemAdvanced

ZenScript
Copy
<advanceditem:test_item>

// BracketHandlers.getCoTItem(tokens as string) as CoTItemAdvanced

BracketHandlers.getCoTItem("test_item");
参数类型描述
参数
tokens
类型
string
描述
What you would createDataCompound in the BEP call