CoTBlockAdvanced
Link to cotblockadvanced
A registered CoT Block. Used for advanced functionality. like onRandomTick, onReplaced etc.
These functions should be run in CraftTweaker scripts, instead of ContentTweaker ones. And they are reloadable. You can get it via advanced block BEP.
This class was added by a mod with mod-id contenttweaker
. 因此,如果要使用此功能,则需要安装此mod。
导入类
Link to 导入类
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 Copyimport mods.contenttweaker.block.advance.CoTBlockAdvanced;
使用方式
Link to 使用方式
Name: setBlockColorSupplier
The block's color
Returns: the CoTBlockAdvanced, used for method chaining.
Return Type: CoTBlockAdvanced
ZenScript CopyCoTBlockAdvanced.setBlockColorSupplier(func as IBlockColorSupplier) as CoTBlockAdvanced
参数 | 类型 | 描述 |
---|---|---|
参数 func | 类型 IBlockColorSupplier | 描述 An IBlockColorSupplier. The tintIndex argument is defined by its model |
Name: setIsSideInvisible
Return Type: CoTBlockAdvanced
ZenScript CopyCoTBlockAdvanced.setIsSideInvisible(func as IBlockIsSideInvisible) as CoTBlockAdvanced
参数 | 类型 | 描述 |
---|---|---|
参数 func | 类型 IBlockIsSideInvisible | 描述 No Description Provided |
Name: setIsTransparent
Return Type: CoTBlockAdvanced
ZenScript CopyCoTBlockAdvanced.setIsTransparent(func as IBlockIsTransparent) as CoTBlockAdvanced
参数 | 类型 | 描述 |
---|---|---|
参数 func | 类型 IBlockIsTransparent | 描述 No Description Provided |
Name: setOnActivated
Sets what will happen when a player right-clicks the block
Returns: the CoTBlockAdvanced, used for method chaining
Return Type: CoTBlockAdvanced
ZenScript CopyCoTBlockAdvanced.setOnActivated(func as IBlockActivated) as CoTBlockAdvanced
参数 | 类型 | 描述 |
---|---|---|
参数 func | 类型 IBlockActivated | 描述 An IBlockActivated function, the function should return an ActionResultType |
Name: setOnAdded
Sets what will happen when the block is added.
Returns: the CoTBlockAdvanced, used for method chaining
Return Type: CoTBlockAdvanced
ZenScript CopyCoTBlockAdvanced.setOnAdded(func as IBlockAdded) as CoTBlockAdvanced
参数 | 类型 | 描述 |
---|---|---|
参数 func | 类型 IBlockAdded | 描述 No Description Provided |
Name: setOnNeighborChanged
Sets what will happen when a neighbour of the block is changed
Returns: the CoTBlockAdvanced, used for method chaining
Return Type: CoTBlockAdvanced
ZenScript CopyCoTBlockAdvanced.setOnNeighborChanged(func as IBlockNeighborChanged) as CoTBlockAdvanced
参数 | 类型 | 描述 |
---|---|---|
参数 func | 类型 IBlockNeighborChanged | 描述 No Description Provided |
Name: setOnRandomTick
Sets what will happen when the block receive a random tick. Throws an exception if the block does not tick randomly.
Returns: the CoTBlockAdvanced, used for method chaining
Return Type: CoTBlockAdvanced
ZenScript CopyCoTBlockAdvanced.setOnRandomTick(func as IBlockRandomTick) as CoTBlockAdvanced
参数 | 类型 | 描述 |
---|---|---|
参数 func | 类型 IBlockRandomTick | 描述 No Description Provided |
Name: setOnReplaced
Sets what will happen when the block is replaced. (Note. destroy means replace with air)
Returns: the CoTBlockAdvanced, used for method chaining
Return Type: CoTBlockAdvanced
ZenScript CopyCoTBlockAdvanced.setOnReplaced(func as IBlockReplaced) as CoTBlockAdvanced
参数 | 类型 | 描述 |
---|---|---|
参数 func | 类型 IBlockReplaced | 描述 No Description Provided |